Description
Hi maintainers. This is just a short information about my previous wifi obd dongle problems. Hope this help someone out, for further debugging and tests. The root cause is not ELMduino, this library work as expected.
I've submitted a pull request for the connected state problem a while ago. And what i can say, WIFI_MODE doesn't fix anything :) Sorry for the wrong input last time.
Here is my summary of what is going wrong on the side of Wifi. I've debugged days with a lot of different adapters.
ESP32 and ESP8266 both have unreliable wifi network
This is the base problem. All ESP32 and ESP8266 modules i've tested (5 different) have the same issues. Sending a raw AT Command works fine. Like for example AT @1
. Receiving the answer as difficult.
- Most of the time, you get back what you have sent. For example
AT @1
including some weird characters at the end, mostly?
. - Once in a while, you get the correct answer, in the case of the example AT command, this is something like
OBDII RS232 to xxx Interpreter
. You can improve this behaviour when settingsetNoDelay(true)
on theWifiClient
-> https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/client-class.html#setnodelay - I wrote a testscript that just send this one command in a interval of 1 second. 76 of 100 received trash data. Only 24 received correct data.
- It doesnt matter how long you wait for data to be received, after the trash data is received, which curiously correctly is terminated with an
>
, there is no more data the comes down the line. Only after sending another AT command, you get back data.
ESP32 BluetoothSerial
Same code as above for Wifi (Except the wifi client changes with BT Serial), work without problems and 100 of 100 requests receive correct data.
Testscenario - All show similar results
- 3 different ESP32 and 2 different ESP8266 modules
- 7 different OBD2 Wifi dongles, from cheap to more expensive
- I have also tested all wifi adapters with a smartphone app that can send serial messages. Here it work without any problems. So all tested wifi adapters are generally fine and work as expected.
Conclusion
Don't use OBD2 WIFI adapters on ESP32 or ESP8266. You will have troubles.
I wanted to write down my testing hell of the last days, to help others with my experience.
Have nice holidays. Cya.