2
\$\begingroup\$

I am looking for guidance and advice on how to real-time read values from the diagnostic port of my motorbike (CAN-BUS), using a Raspberry Pi ZERO W and a dedicated expansion board, designed ad-hoc: https://www.amazon.it/gp/product/B07PQJMFVP/ref=ppx_yo_dt_b_asin_title_o02_s01?ie=UTF8&psc=1

The final goal is to log data on an SD card, on board of the RSBPi.

  1. Is real-time reading technically doable?
  2. Has anyone else attempted that already?
  3. I am completely new to this, so what are the crucial things I should consider and do to get at least a basic data streaming on the RSBPi?
  4. What "fatal error" should I avoid? I am afraid to damage or corrupt the ECU of the bike, expensive and most importantly crucial for riding.

Thank you for dedicating your time to my question as well as for any input you might be willing to share.

\$\endgroup\$
2
  • \$\begingroup\$ upvote for interesting, clearly presented question \$\endgroup\$
    – jsotola
    Commented Apr 18, 2020 at 2:17
  • \$\begingroup\$ Isn't Pi = Linux? If so, then you can't have real-time. Sounds like the wrong tool for the task. \$\endgroup\$
    – Lundin
    Commented Apr 21, 2020 at 7:48

1 Answer 1

1
\$\begingroup\$
  1. You can't have real-time on Linux systems. You should use a "bare metal" microcontroller instead if you need real-time.
  2. No idea. Lots of questionable hobbyist projects out there.
  3. You need to know the bus "infrastructure". Which nodes are there, what CAN bus protocol are they using, what's the baudrate, 29 or 11 bit id, where is termination placed, what physical connectors to use, stub considerations if you plug in on the bus, where to supply the board from etc etc. And obviously, connect signal grounds (you'd be surprised how many quacks there are who don't).
  4. Aimlessly sending CAN data on a live bus designed by someone else, when you don't know neither the protocol nor the real-time considerations made by the one who designed the bus. Doing so is plain dangerous.

    Examine if the ODB port got supply pins along with the bus, then treat them with care. Accidentally shorting those with other pins might damage electronics if you are unlucky.

    Apart from that, you can't really cause harm by just passively listening in on a CAN bus.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.