blob: d167fa7ea7fa7366d4cab886bf0e7df2be2fea52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Work in progress.
Reading CAN messages from CAN ids I want, decode and append to a file. Use it with [remote_plot](https://git.flylightning.xyz/remote_plot/)
build, install, and run
```sh
make
sudo make install
mycan
```
usage
```sh
# 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](https://github.com/howerj/dbcc) via `dbcc all_SRE_edited.dbc`, see Makfile. all_SRE_edited.dbc is edited from [SR-16 Custom BMS.dbc](https://github.com/spartanracingelectric/SR16-CustomBMS/blob/main/SR-16%20Custom%20BMS.dbc) by editing some lines to make dbcc work.
Infrastructure configs, included in pi_configs dir
- I prefer manage infrastructure configs using my [cfg](https://git.flylightning.xyz/fsh/tree/sh/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
- Use a database like SQLite
- More platform independent
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.
|