This repo contains the car data processing server that collects ProtocolBuffer data over UDP and logs it to CSVs, binary log files and influxdb for monitoring and data exploration. Currently built for Sundae and expected to be updated for future cars.
This software is open sourced with the idea that it could save work for other solar car teams in getting data collection up and running. It can collect data at a fairly high rate (~20 packets/sec on a slow laptop), output that data to InfluxDB, CSV and a binary log and it is designed to be modified to support different transfer protocols and wire formats, though some work will be required to add code that can deserialize the specific data send by a car. If you are a member of a solar car team considering using this software, please create an issue on this repo explaining what you want to use this for and fork the repo to add support for your car. The issue will help us understand how teams use telemetry and track issues related to adding support for your car. Note that this repo is licensed under the GPL, so if you fork the repo, that fork must also be open sourced and licensed with a GPL-compatible license.
Note: if you are on Mac, I highly recommend installing with brew. If you install brew, you can install go with brew install golang
.
Otherwise, download and install from here.
After you install, you need to setup a folder as your GOPATH. There is a good guide here. I set my folder to ~/go
(a folder in my home directory called "go"). While you are editing your shell config, it is also really helpful to add ~/go/bin
to your PATH variable to whenever you install a go program, telemetry included, it is available to run anywhere on the system.
- Clone the repo:
git clone --recurse-submodules [email protected]:sscp/telemetry.git
for ssh orhttps://github.com/sscp/telemetry.git
for https - Run
make install
to install thetelemetry
command in$GOPATH/bin
- Run
telemetry collect <run_name>
to collect data (works if you have$GOPATH/bin
in your path, otherwise run$GOPATH/bin/telemetry collect <run_name>
directly) - Data will appear in the folders
blogs
andcsvs
in your current directory
- Clone the repo (Make sure to clone the
sandbox
submodule as well with--recurse-submodules
as shown above) - Run
docker-compose up
in the repo, this will compile telemetry, and download and run all other services (influx, jaeger, etc) - Run
make install
to install thetelemetry
command in$GOPATH/bin
- Run
telemetry call start <run_name>
to collect data (works if you have$GOPATH/bin
in your path, otherwise run$GOPATH/bin/telemetry call start <run_name>
directly)
Telemetry looks for a config file in ~/.telemetry.yml
in your home folder. You should create one if you want to modify settings like ports, but it should also work without any config. You can also select a config like this: telemetry -c <configfile> collect <run_name>
.
If you are new go Go, I highly recommend the tour. It is a great introduction that assumes basic programming skills and quickly gets you up to speed with the way Go works.
There are unit tests that can be run with make test
.
We use protocol buffers and GRPC, which means we need to compile .proto
files. This can be done with make generate
(wrapper for go generate
). First run make install-tools
to install the required libraries/compilers.
We essentially follow this workflow. This means whenever you want to start working on something, pull the latest changes from master git pull
, then create a new branch to work on git checkout -b <firstname>/<feature>
. (For me this would look something like this: git checkout -b jack/influx
, for working on adding influx). You can now work on this branch, committing as often as you like with git commit -m "fixed this bug"
. You should also push periodically to GitHub. The first time you push a branch you run git push -u origin <yourbranchname>
and every time after that you just run git push
. Once you have your branch on GitHub, you should create a "Pull Request" by going to the repo page and clicking the "Pull Requests" tab and then clicking "New pull request". You then select your branch and create the PR, which lets us easily review code.