Closed pascaltippelt closed 4 years ago
Thank you for the kind compliments on the lib, I'm glad it's working for you :)
I'll see what I can do to incorporate WiFi into the library and add a new example.
Actually, I think I got ahead of myself - I already have an ESP32 WiFi example here. Does it not work for you?
Well, your programming skills are faster than the light. Yes, it works, I can finally get values from my old car. :blue_car: :+1:
There is one minor issue with those cheap WiFi adapters: They sometimes close the telnet connection (maybe if there were no requests for a certain time or so). So does you lib check if the telnet client is still connected before a request and, if not, tries to reconnect? Or should this be done manually?
Here you can see the first succesfull run of my implementation (still slow as I only poll data once a second).
There is one minor issue with those cheap WiFi adapters: They sometimes close the telnet connection (maybe if there were no requests for a certain time or so). So does you lib check if the telnet client is still connected before a request and, if not, tries to reconnect? Or should this be done manually?
To keep the library as flexible and simple as possible, any automatic reconnects should be done at sketch-level. You could test for connection issues in the error printing function.
Here you can see the first succesfull run of my implementation (still slow as I only poll data once a second).
Looks good! Are you having problems with the connection if you poll faster than 1Hz?
No I don't have problems getting more values. It is for being able so "see" the single values.
Everything fine!
So in the loop() I would check Telnet state and then get my value like this?
if (!client.connected()) {client.connect(server, 35000);}
//get Values...
By the way... When exactly is it required to myELM327.flushInputBuff()
?
I don't have much experience in WiFi programming, but it looks ok to me. Googling might produce some good example code.
myELM327.flushInputBuff()
is automatically called so you don't have to. If you experience a lot of ELM327 status errors, you could try calling that function after printing the error, but idk if that would help.
Thank you!
Hi,
it is me again... I finally got one thing working: Use a ESP32 to connect it to a WiFi OBD adapter:
[This is my fast and dirty 'does it work' code]
Basically those adapters provide an open WiFi network ("WiFi_OBDII") with a telnet server at port 35000.
This telnet server passes through the serial interface. If you send a AT Z, you will get your response.
May it be possible to use this connection for your (by the way great) library?
Best regards
Pascal