Telemetry: Set Up
This document is a quick tutorial to set up:
codegen-tooling-msxiv (required for DBC file)
virtual CAN (required for testing
AWS (required for DynamoDB)
Raspberry Pi Startup Script
The following are not needed but are here in case we need to install them for some reason
Node-Red (optional)
Chronograf (optional for collecting data)
Grafana (optional for dashboards)
Make sure that the RasberryPi and Node-Red password are changed from their default setting.
Generating the DBC File
Follow the instructions in the repo and run the commands below as well if things aren’t working still.
GitHub - uw-midsun/codegen-tooling-msxiv: [Deprecated] Codegen tooling for MSXIV!
# You may need to be root or use "sudo" to run these commands
# Update packages and install dependency packages for services
apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get clean \
&& echo 'Finished installing dependencies'
# Install packages
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang-format \
git \
golang-go \
golang-goprotobuf-dev \
protobuf-compiler \
python-pip \
&& rm -rf /var/lib/apt/lists/*
# Clone and install project dependencies
git clone https://github.com/uw-midsun/codegen-tooling-xiv.git \
&& cd codegen-tooling-xiv \
&& pip install -r requirements.txt
# Generate DBC and templates
cd codegen-tooling-xiv \
&& make gen \
&& make gen-dbc
Setting up Virtual CAN
Here is a link to set up CAN interfaces or look below to set up virtual CAN.
modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
Setting up AWS
Go to the link below to set up AWS on your machine.
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
If you’re too lazy to look at the link, just run the commands below.
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
If you are installing AWS on a Raspberry Pi refer to the link below to install and set up AWS credentials.
https://ownthe.cloud/posts/configure-aws-cli-on-raspberry-pi/
The two tables (that should already be set up and which the script will write to) are:
can_messages
gps_data
To be able to write to these tables. You’ll need to configure AWS credentials first. Refer to https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html
Again if you don’t feel like looking at the link, just run the command aws configure
If you are using AWS-educate, this doesn't seem to work for so I have to manually go to ~/.aws/credentials
and write down my credentials there.
Startup script for Raspberry Pi
Copy the following code below into rc.local on the Raspberry Pi so that the telemetry scripts can be run on startup. To access rc.local, run:
sudo vim /etc/rc.local
Once you have opened rc.local, copy and paste the following code below.
Installing and Running Node-Red
To install Node-Red, you can refer to the RPI Documentation or run the command below.
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
To start Node-Red run
node-red-start
Once it is up and running you can access Node-Red by going to this URL
http://127.0.0.1:1880/admin
Installing InfluxDB.chronograf
To install and run InfluxDB you can refer to to the installation instructions or run the commands below.
Once it is up and running you can access InfluxDB by going here
http://127.0.0.1:8888
Installing Grafana
Once it is up and running you can access Grafana by going to this URL
http://127.0.0.1:3000/
login: admin
password: admin