Unable to bind socket errors if ESP32 not powercycled between uploads, strange error messages #7137
Replies: 1 comment
-
Posted at 2018-06-07 by Wilberforce The issue is the the build is compiled with 10 sockets. If you saved the result of you your server connect as a global:
Then before the reset - you could do This will shut down the connect and close the socket. By the way, are using using a telnet connection? It is so much faster than the com port connection. Oh - and your call to get the time - rather than have a page that returns the time - you can get the time out of the header.. Posted at 2018-06-07 by @gfwilliams
Something seems odd there - if you call Posted at 2018-06-08 by Wilberforce Following the calls from I have also observed this behaviour in the ESP8266 build. Posted at 2018-06-08 by DrAzzy Hmm, yeah - it seems like something that would be good to fix, since it is a nuisance during development to have to power cycle the board after each upload. I will try manually doing server.close() I am using the telnet connection - I think this is one of the most compelling features of the ESP8266/ESP32. It's so much more convenient than having to fiddle with wires to upload. For doing the time with the header, how do I access the headers from within Espruino? It doesn't appear to be supported (based on my reading of the reference) As I understand it, the callbacks provide an httpCRs and httpCRq object - but the API reference for these does not mention any method to get the headers. Posted at 2018-06-13 by @gfwilliams I think Posted at 2018-06-13 by Wilberforce
Posted at 2018-06-13 by DrAzzy Thanks. I've created an issue for the incomplete API documentation. https://github.com/espruino/EspruinoDocs/issues/441 Posted at 2018-06-14 by Wilberforce @drazzy It allows the port to be reused. Posted at 2019-03-08 by AkosLukacs I think I got this issue on an ESP32 with 2v01 when trying to use MQTT / tinyMQTT. With MQTT the error message is
at this call: Edit: A simple http get does work.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-07 by DrAzzy
It looks like there's a problem with servers not getting cleaned up when the board is reset (for example, when you click "send to Espruino" in the IDE):
First time I upload and try to fire up the server, it works. The second time:
It isn't clear to me yet exactly what the key factor is that makes this fail, but the code below readily reproduces it for me. Upload code once.
Request in browser:
(board IP address):7348/status?un=testuser&pw=testpass
Upload code again. Watch for error in console.
Powercycling the board fixes it.
Also, sometimes when I click send to Espruino, the following is printed to console:
Much thanks to everyone for all the work they've put into the ESP32 support.
Beta Was this translation helpful? Give feedback.
All reactions