Connect to OBD through custom code

Good afternoon

I am trying to run a custom python3 code to read the OBD data and do some machine learning. My intent is to run the code locally on the AutoPi itself, not through the cloud interface.

The problem that I am facing is the following: I do not seem to be able to establish a connection nor read data from the OBD device, my hypothesis is that there is some process being run on the background that is making the serial connection busy.

I do not what to flash a fresh Raspian image on the AutoPi, as that would create some problems of their own, but so far it is looking like the only possible solution.

Does anyone know how to stop the background saltstack process?

Have you tried just stopping minion?
SSH in and try service salt-minion stop. Might work.

Yes I did, but unfortunately it just causes the AutoPi to reboot after a while

Hi @Gabriel_Signoretti,

The salt-minion service maintains a heartbeat to the underlying powermanagement, to ensure that the AutoPi will reboot if the software is stuck. If you stop the salt-minon, the heartbeat is stopped and eventually the device will reboot.

To disable this during development, you could just add the small hardware jumper on the board:

This will keep the device up and disable the heartbeat.

best
Peter

Thanks for the reply, Peter! so, is there any way to listen to the OBD serial port without turning off the salt minion then?

Thanks again for all the help, guys!

Hi Gabriel,

You can always just use the monitor function to listen to the CAN bus:

http://docs.autopi.io/commands/obd/#obd-monitor

Thats part of the standard software.

best
Peter