-
Notifications
You must be signed in to change notification settings - Fork 96
write() takes 5 seconds, because it gets stuck at http.getString() #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here is how the output looks like when I execute the code on my ESP8266 device:
That "1021" is a sensor read that normally happens every 200 milliseconds. You can see that it got stuck for 5 seconds after sending data to influxdb. |
Why do we even need this getString() here? Response code is what is really important here. Can we have a way to disable this getString() call when not needed? |
Perhaps this is how it should be fixed:
|
Feel free to create PR |
I'm exactly in the same situation. 5 seconds lost :(. 13:38:19.052 -> --> writing to amperometri: |
### SOLUTION I've overwritten libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp with the version of the file you can find in caf891d316 tree here (not still accepted in the master ?) https://raw.githubusercontent.com/esp8266/Arduino/caf891d316a689bc5564a88a7796d7a8496345f5/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp this is my output :) right now . ~ 1 seconds as my delay code delay(1000); |
Will this solution mess up anything that uses the library? |
I also hit this, although in my case it hangs indefinitely. Checking for 204 before calling getString() fixed it for me. |
Hi ! Can you show us your implementation? Thanks |
@ivanpiffer I just changed the code in the function
|
I use the latest ESP8266-Arduino library (2.6.3). And the latest ESP8266_Influx_DB library (2.0.0).
When I execute the influx.write() call, it takes 5 seconds to complete. It gets stuck on this:
https://github.com/tobiasschuerg/ESP8266_Influx_DB/blob/5cf6cc93f6df73f18cebd6e06df79cc741002fe3/InfluxDb.cpp#L166
I use influxdb version 1.7.9.
The text was updated successfully, but these errors were encountered: