Telemetry
Table of contents
Description
The telemetry software section of the project comprised such tasks
- creating software for relaying CANBUS messages through MQTT via 4G using a Raspberry pi
- creating software for reading CANBUS messages from main CANBUS loop using STM32 chip and sending via serial to raspberry
- lowering boot time of Raspberry pi
- writing script to be launched at boot to connect to the internet via modem
- reference here https://www.jeffgeerling.com/blog/2022/using-4g-lte-wireless-modems-on-raspberry-pi/
- for more info about modem etc refer to Electrical
- making the SD used by the pi read-only; this is needed as micro-sd cards are failure prone, especially on Rpi hardware
Architecture description
Canbus message reader STM32
Most of it is still not implemented, but shouldn't take long to implement.
A simple loop reading the canbus port and relaying it to the serial interface will be more than enough; depending on board used package filtering could be done either on the STM board or raspberry pi
Message Relay via raspberry pi
This is the meaty part of the project
Connecting the pi to the internet
Sti
Boot script
While looking around the github page you might find a .sh script called mqtt_boot.sh; this bash script is run by systemD at boot.
It can be modified to include also the commands to connect via 4g in the future.
If the underling OS is wiped/changed drastically remember to re-setup such script to launched at boot; asking any LLM how to do it should be enough.
Boot time optimization
For now it is simply an headless (IE no desktop interface software like x11, gnome, Etc..) installation of Raspberry OS; this setup starts in around 15-20s.
Further optimization can be done by profiling the boot to strip not needed functionality; reference to how here
- https://forums.raspberrypi.com/viewtopic.php?t=277010
- https://forums.raspberrypi.com/viewtopic.php?t=373140
- Another option could be using an nvme/usb3 storage sistem
How to compile the project
Remaining work
FAQ
the setup is the one of the original creator, how do i access the pi?
until now work was done via ssh (credential are user: racingpi , password: 1234) using my personal wi.fi hotspot; the simpler way is to use the physical Lan port of the py, then if needed change the wifi config to the new user.
I see some errors in the log from the a serial interface, what is wrong?
It is mostly a matter of flags used when reading the serial port, refer to the documentation of the attached serial device.
Also remember that most Linux distros could have some serial issues because of braille devices driver (IE BRLTTY); disabling them could help.