aboutsummaryrefslogtreecommitdiff

Archived. Has license issues. Reading CAN messages from CAN ids I want, decode and append to a file. Use it with remote_plot

The code is licensed under GPL-3.0-or-later. mycan.c uses some codes from https://files.waveshare.com/upload/4/4e/RS485_CAN_HAT_Code.zip which does not have a license which means those codes are non-free close souce proprietary, so I don't think I'm allowed to add a free and open soruce license to mycan.c. all_SRE_edited.dbc is edited from "SR-16 Custom BMS.dbc" file from https://github.com/spartanracingelectric/SR16-CustomBMS/blob/main/SR-16%20Custom%20BMS.dbc and authors of SR16-CustomBMS does not have a license in their code repository for "SR-16 Custom BMS.dbc" file, so authors of SR16-CustomBMS have the copyright on "SR-16 Custom BMS.dbc" file, so all_SRE_edited.dbc can be considered non-free close souce proprietary code. So there are license issues because I use both non-free and free copyleft license codes together.

build, install, and run

make
sudo make install
mycan

usage

# use default can0 network interface
mycan
# use vcan0 network interface
mycan vcan0

all_SRE_edited.c and all_SRE_edited.h are auto generated by dbcc via dbcc all_SRE_edited.dbc, see Makfile. all_SRE_edited.dbc is edited from SR-16 Custom BMS.dbc by editing some lines to make dbcc work.

Infrastructure configs, included in pi_configs dir

  • I prefer manage infrastructure configs using my cfg script, but that script is my personal project and I don't want to force people to use that, so I include those config files in this repo and I did not manage it with my cfg script on raspberry pi.
  • /boot/firmware/config.txt raspberry pi configs to make CAN hat work and make CAN network interface on raspberry pi work
  • /etc/systemd/system/can0.service autostart CAN network interface configs
  • /home/Spartan_Racing_Charger/.config/systemd/user/mycan.service autostart mycan
  • To enable and start can0 autostart, run sudo systemctl enable --now can0. To enable mycan autostart, run sudo systemctl --user enable --now mycan.

mycan future improvements

To assemble the raspberry pi for remote plotting software, CAN hat need to be placed and inserted onto raspberry pi's male pins. Touchscreen display needs to be put at the bottom of the raspberry pi. All these three items should be screwed with metal rods. Display needs to connect to raspberry pi's 5V and GND ground for power. Raspberry pi it self also need to connect to power supply on 5V and GND ground. CAN hat needs to connect to CAN high and CAN low wires to receive CAN messages from battery BMS.

On raspberry pi, I saved some temporary files I used to work on like git repos in ~/test. Those files can be cleaned if you want.