Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 1.78 KB

README.md

File metadata and controls

81 lines (62 loc) · 1.78 KB

simple_can_monitor

This is a hacky tool to monitor the boat data during tests.

image

Setup the Pi on the first use

Setup WIFI to automatically connect

Just follow: https://www.tech-sparks.com/raspberry-pi-auto-connect-to-wifi/

Install dependencies

sudo apt update -y && \
sudo apt install -y --no-install-recommends git cpufrequtils

Allow ssh -X (for debug/developing only)

echo '\nX11Forwarding yes' | sudo tee -a /etc/ssh/sshd_config

Configure SPI/CAN

echo 'dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25' | sudo tee -a /boot/config.txt
sudo sed -i '/dtparam=spi=on/s/^#//g' /boot/config.txt

Set CPU to performance mode

echo 'GOVERNOR="performance"' | sudo tee -a /etc/default/cpufrequtils
sudo systemctl restart cpufrequtils

Disable monitor power-save

sudo sed -i 's/#xserver-command=X/xserver-command=X -s 0 -dpms/' /etc/lightdm/lightdm.conf

Install our simple can monitor

git clone https://github.com/ZeniteSolar/simple_can_monitor
cd simple_can_monitor
./build.sh

Using

To install and run it as a systemd service, run:

build.sh

To uninstall it:

sudo systemctl disable simple_can_monitor.service

To stop it:

sudo systemctl stop simple_can_monitor.service

Developing

The Messages shown can be changed by directly changing the main.py code.

Add a virtual can interface:

sudo ip link add dev vcan0 type vcan

To run the script on a given terminal, just call:

run.sh

Then, play some candump file:

canplayer vcan0=can0 -I ~/ZeniteSolar/2023/can_data/01072023/datasets/can/candump/candump-2023-07-01_145823.log