Closed zaneclaes closed 4 years ago
It works now with fast=false, and a no voltage check. Thank you!
@ajalberd glad to hear it! I also packaged it up as a Docker container to run on my Raspberry Pi Kubernetes cluster, along with Prometheus exporting, if you're curious: https://github.com/zaneclaes/node-pi-obd-monitor
This looks fine to me. It won't interfere with already working systems but should help fix the RaspberryPi Bluetooth issue.
Can anyone please guide me ho to change "fast=False" I am using raspberry pi 4. But still I can't connect my bluetooth OBD adaper using python-obd connector. Thank You
This corrects the following issue, detected on a Raspberry Pi connecting via Bluetooth (though it may not be exclusive to this case): https://github.com/brendan-w/python-OBD/issues/160
The root cause was that the
send
command was attempting to retrieve responses from the OBD adapter before they were available for the startup commands (likely due to latency over Bluetooth or some slowness with the dongle itself). I verified that each ofATH1
,ATL0
, andAT RV
would not work on my Raspberry Pi 4 with bluetooth without using at least a 0.1 second delay.My first thought was to use the
fast=False
configuration value to add a delay to__send()
, but on experimentation I discovered that this created an artificial delay which was unnecessary for retrieving values later (such asSPEED
). Instead, I modified the__send()
function to retry theread()
if the response was empty for up to one second. AFAIK, this should not be problematic in that a response is always expected by any monitoring commands sent to the OBDII adapter.... but I defer to the maintainers, as I only just started reading about the OBDII/ELM327 protocol specifics today.
// fyi @alistair23 @ajalberd