brendan-w / python-OBD

OBD-II serial module for reading engine data
GNU General Public License v2.0
1.02k stars 360 forks source link

Library not working with Bluetooth OBDs? #278

Open simply-Gamic opened 1 month ago

simply-Gamic commented 1 month ago

I've been trying to get the library working the past few days but for some reason it just won't work.

I have an ELM327 Bluetooth adapter, which works perfectly with an app on my phone. But when trying to connect to it via my laptop (win11) it won't work.

The first weird thing is that I get two instances of the obd2 when trying to connect to it via Bluetooth. One is shown as a Bluetooth LE device (so Bluetooth 4.0+) and one needs a pin and then gets connected as two virtual com ports (one outgoing, one going in)

First problem I encountered was that the port naming of the library is different to win11s naming scheme, so I had to adjust it inside the utils.py to just "COMx" where x is the port number. Now it auto detects both com ports properly and also identifies that port 9 (the incoming) is the only viable one. But it never connects fully, just freezes at the initialization process.

When using the pyserial library standalone, I can successfully connect to the port and receive blank data. But when I try to write to it, to get an answer, it freezes as well for some reason.

I've downloaded another program, that's also for obd2 and inside that the Bluetooth option straight up doesn't work and trying to connect via the com port, results in it saying the baudrate can't be detected. (Even if I manually adjust it to the correct one)

Through a c# library I managed to connect to the obd via the com9 port but it also freezes in the initialization.

So what's the issue here? Help would be much appreciated :))