JonnoFTW / rpi-can-logger

Project to log CAN bus data from a PiCAN2 and a GPS module
128 stars 20 forks source link

Problem during logging #6

Closed nagyapi closed 2 months ago

nagyapi commented 2 months ago

Hi,

First of all, thank you for your work. I would like to ask for a little help. I've installed the repository on a Raspberry Pi Zero 2 W, but I'm stuck. I tried testing the logging feature, but it was unsuccessful, or I may have missed something. I sent messages via a PCAN USB adapter from PCAN-View to an MCP2515 CAN bus adapter ( mcp2515 which I modified for 3.3V supply and 16 MHz)

Here is the insalled .yaml configuration file:

channel: can0
disable-gps: true
fms: true
interface: socketcan
log-bluetooth: false
log-folder: ~/log/can-log/
log-level: warning
log-messages: ~/log/can-log/messages/
log-pids: [FMS_ENGINE_HOURS, FMS_FUEL_CONSUMPTION, FMS_ENGINE_TEMP, FMS_FUEL_ECONOMY]
log-size: 32
log-trigger: FMS_ENGINE_HOURS
pid-file: ~/log/can-log.pid
sniffing: false
tesla: false
vehicle-id: scania
verbose: true

Changing "sniffing: false" to "true" did not solve the problem.

I checked the status of the rpi-logger.service:

After checking the .json file I see this: {"vid": "scania", "trip_id": "20240630_150437_P1aGqk_scania", "trip-sequence": 83}

If I run the can_sniff_test.py I see the messages.

What could be wrong? Thanks!

JonnoFTW commented 2 months ago

What kind of vehicle are you running on? You need to ensure that whatever is sending the CAN data is sending on the same PIDs as specified in the config.

The PID code to log-pids mapping is here: https://github.com/JonnoFTW/rpi-can-logger/blob/master/rpi_can_logger/logger/fms_pids.py#L247-L286

nagyapi commented 2 months ago

Sorry, the sample message was wrong. Now it works. Thank you!