Firmware for the Supermileage Telemetry module. The Telemetry system is an LTE-connected data-collection module that records data from multiple sensors on each of the three Supermileage vehicles, logs the data, and uploads it to the cloud. The data gets processed and stored on Google Cloud and can be accessed using Grafana. There is also a custom PCB design available.
The Telemetry system can log data from the following sensors:
- Temperature (on Telemetry)
- Accelerometer & Gyroscope (on Telemetry)
- 2x Thermocouples
- GPS (via i2c)
- Engine ECU (via UART)
- Fuel-Cell Controller (via optical UART)
- Brushless Motor Controller (via CAN)
- Lithium-Ion BMS (via CAN)
- Vehicle Accessories (via CAN)
- Steering Wheel (via CAN)
Some of our libraries are submodules, so we have to clone with those in mind. If starting anew, use the following command:
git clone --recurse-submodules https://github.com/supermileage/telemetry-firmware.git
Or, if it's already cloned:
git submodule init
git submodule update
Common libraries are carried over and compiled using a symlink. For POSIX OSes, this wouldn't be a problem when cloning. However, if developing on Windows, make sure you install Git with symbolic link support (as illustrated here). Then, clone with:
git clone --recurse-submodules -c core.symlinks=true https://github.com/supermileage/telemetry-firmware.git
IMPORTANT: you need administrator permissions for this, so make sure you clone it in a command prompt ran as admin.
All options should generate a .bin
file, which will be your application firmware payload for flashing.
The CLI supports cloud compilation, which requires you to sign into the Particle Cloud. If this is the most accessible option, you can invoke it with the following (assuming you are in the root directory):
particle compile electron <directory> --saveTo firmware.bin --followSymlinks
Where <directory>
is the directory with the project.properties
file. For example, urban.
The Particle workbench also supports compilation (locally, too). Once installed, invoke it in the command bar by searching for Particle: Compile application (local)
. Note that this requires you to be in the nested vehicle directory in your VSCode workspace. This means you should open the instance of VSCode in the nested directory and work with that; any changes to the libraries will be reflected across all vehicles. Make sure you're targetting 1.5.2.
A pre-built image is available that includes the dependencies to compile. The command is wrapped up with a Makefile in the root directory, meaning you can simply run make proto
or make urban
to build the firmware for the respective vehicles.
Once you have the .bin
file, put the Particle board in DFU mode:
- Hold down both buttons
- Release only the
RESET
button while holding down theSETUP
button - Wait for the LED to start flashing yellow
- Release the
SETUP
button
Then connect the board to your PC, and run:
particle flash --usb firmware.bin
This will flash the firmware onto the board.
Particle Workbench has all this functionality built-in, so it abstracts away a lot of the hassle of learning the CLI. Use that if you're unsure.
This project contains a set of unit tests. For information on building and writing tests, see the README.md in the test folder.