-
Notifications
You must be signed in to change notification settings - Fork 30
Http GET polling causes crash when host disconnected #22
Comments
Hi @andrewk123 Can you post your |
Hi @andrewk123 I couldn't duplicate the issue as the code was running normally. I suggest you check your board / WebServer code The debug terminal
No reset happened at all. I close the issue now until you can prove this is the bug of the library BTW, the WebServer Nodejs code to test with
|
Thanks for your response.
It actually does not matter what the node.js code is since the point is that the target ip is not available.
Andrew
… On Nov 22, 2021, at 7:50 PM, Khoi Hoang ***@***.***> wrote:
Hi @andrewk123
Can you post your internal NodeJS server code
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Let me qualify my previous comment. This error is caused when the target host is not available (ie there is no response from the host at all (such as the target host is completely down). It is the lack of response that causes the issue (as described above). Try this again with requestOpenResult = request.open("GET", "http://192.168.99.30:3000/index"); where 192.168.99.30 is a none existing IP address. Please re-open this issue. |
These 2 are different scenarios, but anyway, I can duplicate the crash only with Certainly, please post anything you've investigated / experienced so far to help speed up the tests / fix. I'm opening the issue now. |
OK, found the bug. I'll publish a new release by tomorrow. |
Hi @andrewk123 The AsyncHTTPRequest_Generic releases v1.4.0 has just been published. Your contribution is noted in Contributions and Thanks. Please have more tests to verify the bug has been squashed. Regards, Releases v1.4.0
|
Thanks! That seems to have completely resolved the issue. I will do some further testing this evening and advise if I find anything of interest. Thanks for your work on this! |
A follow up to a previous issue since I am seeing the same issue.
Bug report is as follows:
Describe the bug
Multiple requests to an internal NodeJS server when the server is disconnected causes a crash.
Steps to Reproduce
Use the example "AsyncHTTPRequest_ESP.ino"
Only changes in this sketch are as follows:
Line 49 #define ASYNC_HTTP_LOGLEVEL 4
Line 52 #define HTTP_REQUEST_INTERVAL 10
Line 59 and 60 add SSID and Password
Line 102 change to requestOpenResult = request.open("GET", "http://192.168.59.188/ping.htm");
Expected behavior
When the target is disconnected an HTTP error code should be returned after a very short timeout (ideally controlled by setTimeout() or the like).
Actual behavior
When http://192.168.59.188/ping.htm is available everything works as expected (the ping page just generates an OK) which is printed by the Sketch. However if you connect the ethernet cable, requests receive no response (as expected). However, after several requests (typically 3) the ESP restarts,
Please ensure to specify the following:
Arduino IDE 1.8.13
ESP8266
,ESP32
orSTM32
Core Version (e.g. ESP8266 core v2.7.4, ESP32 v1.0.5 or STM32 v1.9.0)ESP8266 Core 3.0.2
Here is the debug output:
AsyncHTTPRequest @ IP : 192.168.1.23
[AHTTP] open( GET , url = http://192.168.1.21/ping.htm
[AHTTP] _parseURL(): scheme+host HTTP:// 192.168.1.21
[AHTTP] _parseURL(): port+path+query 80 /ping.htm
[AHTTP] open: conneting to hostname = 192.168.1.21:80
[AHTTP] _connect()
[AHTTP] send()
[AHTTP] _buildRequest()
[AHTTP] _HTTPmethod = 0
[AHTTP] GET /ping.htm HTTP/1.1
[AHTTP] host : 192.168.1.21:80
[AHTTP] _send(), _request->available = 50
[AHTTP] *can't send
[AHTTP] open( GET , url = http://192.168.1.21/ping.htm
[AHTTP] _parseURL(): scheme+host HTTP:// 192.168.1.21
[AHTTP] _parseURL(): port+path+query 80 /ping.htm
[AHTTP] open: conneting to hostname = 192.168.1.21:80
[AHTTP] _connect()
[AHTTP] send()
[AHTTP] _buildRequest()
[AHTTP] _HTTPmethod = 0
[AHTTP] GET /ping.htm HTTP/1.1
[AHTTP] host : 192.168.1.21:80
[AHTTP] _send(), _request->available = 50
[AHTTP] *can't send
H[AHTTP] open( GET , url = http://192.168.1.21/ping.htm
[AHTTP] _parseURL(): scheme+host HTTP:// 192.168.1.21
[AHTTP] _parseURL(): port+path+query 80 /ping.htm
[AHTTP] open: conneting to hostname = 192.168.1.21:80
[AHTTP] _connect()
[AHTTP] send()
[AHTTP] _buildRequest()
[AHTTP] _HTTPmethod = 0
[AHTTP] GET /ping.htm HTTP/1.1
[AHTTP] host : 192.168.1.21:80
[AHTTP] _send(), _request->available = 50
[AHTTP] *can't send
H[AHTTP] open( GET , url = http://192.168.1.21/ping.htm
[AHTTP] _parseURL(): scheme+host HTTP:// 192.168.1.21
[AHTTP] _parseURL(): port+path+query 80 /ping.htm
[AHTTP] open: conneting to hostname = 192.168.1.21:80
[AHTTP] _connect()
[AHTTP] send()
[AHTTP] _buildRequest()
[AHTTP] _HTTPmethod = 0
[AHTTP] GET /ping.htm HTTP/1.1
[AHTTP] host : 192.168.1.21:80
[AHTTP] _send(), _request->available = 50
[AHTTP] *can't send
H[AHTTP] _onError handler error = -13
[AHTTP]
_onDisconnect handler
[AHTTP] _setReadyState : 4
[AHTTP] responseText()
[AHTTP] responseText() no data
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Note: It takes approximately 30 seconds from the first [AHTTP] *can't send till the _onDisconnect handler fires. The reset happens at the time the next request would happen after the _onDisconnect handler fires.
Thanks for your help
Originally posted by @andrewk123 in #16 (comment)
The text was updated successfully, but these errors were encountered: