BlueWave Studio forum
OBDII for Safe Shutdowns? - Printable Version

+- BlueWave Studio forum (https://bluewavestudio.io/community)
+-- Forum: OpenAuto Pro (https://bluewavestudio.io/community/forum-86.html)
+--- Forum: OBD-II (https://bluewavestudio.io/community/forum-103.html)
+--- Thread: OBDII for Safe Shutdowns? (/thread-3460.html)



OBDII for Safe Shutdowns? - PaladinBIGDan2077 - 06-12-2022

Hello,

I recently wanted to write a script that would basically tell the pi to shutdown from the OBDII adapter. This would be checked using the OBD interface that’s connected via Bluetooth. Essentially it’ll check for the average RPM and if the average rpm becomes zero or stays at a constant value for more than 10 seconds it would initiate a shut down. I feel like this may work because when I put my car into the accessory mode, the values from the OBD two module become constant even though it’s still connected to the pi. Essentially a quick and dirty solution would to an automated shutdown. All I have to do is just put the car in accessory mode [ this has the effect of shutting the engine off] and then waiting for the Pi screen to go black then turning the key to off. 

However I have had no luck trying to get the OBDII module to be recognized in Python. Initially it worked after I paired the ELM327 module, but after a reboot it is only recognized in OpenAuto Pro. I read somewhere that OpenAuto Pro will automatically initiate the RFCOMM1 interface with the OBDII interface, so that might be why it is not detected outside of OAP. 

Nevertheless, I think this would be a nice feature to add to open auto pro especially since it’s not too difficult to implement. Has anybody thought about doing something like this?


RE: OBDII for Safe Shutdowns? - BlueWave - 06-13-2022

OpenAuto Pro does not setup any rfcomm interface.

In order to implement your idea you can have a look at API example https://github.com/bluewave-studio/openauto-pro-api/blob/main/api_examples/python/ObdRead.py