Chat freely about anything...

User avatar
By martinayotte
#48068 Do you mean the "timeout" loop ?
Although the 1000ms is quite short for an HTTP request, I don't see any reason why it hangs the ESP other than simply skipping the response if it didn't came within the 1000ms. Your should try with something like 5000ms instead.
User avatar
By mixxx2005
#48072 I think it is more with data.sparkfun than with codes function itself, because even in browser it hangs when refreshed, so I believe that same thing somehow hang ESP.

Maybe by sparkfun.com hanging -- response message size greater than ESP's RAM what cause it to crash?

As I do not need serial monitor to tell "1 success" , I can perfectly live without this part off code.
User avatar
By martinayotte
#48074 Yes, the data.sparkfun is maybe slow responding, but that doesn't explain the reason that you've said that ESP becomes hang.
Removing this timeout loop will lead to other problems in the cases where responses are not instantaneous, because the next loop for printing the response will be skipped since nothing is already received.
User avatar
By mixxx2005
#48076 Ok, tomorrow I try code with timeout, bet without client.read - because this is the part that I mean in previous comment, that cause issues with oversized string.


Code: Select all  while(client.available()){
    String line = client.readStringUntil('\r'); - See more at: http://www.esp8266.com/viewtopic.php?f=6&t=10127&start=4#sthash.wKrbdTnj.dpuf