- Download foxglove studio at https://github.com/foxglove/studio/releases
- Connect to the Pi's network (KS7E)
- Open foxglove studio
- Open a connection to the Pi's IP (192.168.1.7) on port 8765
- Look at data
to get into a dev environment locally (on linux):
- install nix:
sh <(curl -L https://nixos.org/nix/install) --daemon
- enable flakes:
Add the following to
~/.config/nix/nix.conf
or/etc/nix/nix.conf
:
experimental-features = nix-command flakes
-
run
nix develop
to enter dev shell -
(optional) run upv.sh to start the virtual CAN-dapter for testing things or up.sh if you have an actual CAN-dapter plugged in
-
run
runner.py
for the local usb to CAN listener on host machine
usage notes:
- update to newest DBC:
nix flake lock --update-input can_pkg_flake
TODO:
- Update this readme with a new list of goals
flowchart TD
sym[PCAN symbol editor generation of `.sym` file] --> CI
subgraph user input
sym
end
CI[remote CI generation and release of dbc / proto] --> pio[local built platformio util CAN lib]
CI --> np[local built nix proto gen lib]
CI --> bin[remote schema binary generation using ci devshell]
bin --> fg[foxglove webserver service]
np --> mc[mcap writer / CAN msg to protobuf service]
CI --> cantools[cantools dbc load]
input:
- CAN -> protobuf stream
output:
- saved files at time steps
- encoded websocket stream of data
- desired behavior for the data flow:
- on hardware receive in the data_handler script data gets pushed into a container triggers both the webserver and the data writer to use that data
- once both the data writer and the foxglove websocket have finished processing the data delete the data from the container
- a desired workflow is that it all we need to do to add a new input that we will be seeing over the wire is to add a .proto to a specific folder. No code changes should be required.
flowchart TD
CAN[RPI CAN] --> py_async_q[encoded CAN data]
py_async_q --> des[DBC based CAN parser]
des --> pb_pack[protobuf packet creation]
pb_pack --> data_q1[webserver protobuf packet queue]
pb_pack --> data_q2[MCAP file writer protobuf packet queue]
subgraph websocket thread
data_q1 --> enc[serialize into protobuf packet]
enc --> py_foxglove[foxglove server websocket]
end
subgraph file writer thread
data_q2 --> py_mcap[MCAP file writer]
end