I've now fixed the multiple disconnect issue, so on newer builds your code outputs this.
>onInit()
**** STARTING ****
=undefined
WiFi Connected!
["AT+CIPSTART=0,\"TCP\",\"weeso\",1888\r\n"
net client before callback {"type":0,"opt":{"host":"weeso","port":1888},"sckt":1}
net client callback {"type":0,"opt":{"host":"weeso","port":1888},"sckt":1,"conn":true}
] "\r\nERROR\r\n0" <--- "\r\nERROR\r\n0"
net client disconnected {"type":0,"opt":{"host":"weeso","port":1888},"conn":true} *** undefined
net closed, had_error: false
] "0,CLOSED\r\n" <--- ",CLOSED\r\n"
For some reason the other debug lines didn't make it into your dump - but an error (with no other info) is reported by the ESP8266. There's no socket number so I guess we just have to hope that it's always in response to a CIPSTART :)
I had a bit of a fiddle with the EspruinoWiFi driver to try and get it to detect errors, but it does seem there is some issue reporting them back through the HTTP/TCPIP stack so I'm not going to put that code in until I can get the whole thing going.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I've now fixed the multiple disconnect issue, so on newer builds your code outputs this.
For some reason the other debug lines didn't make it into your dump - but an error (with no other info) is reported by the ESP8266. There's no socket number so I guess we just have to hope that it's always in response to a CIPSTART :)
I had a bit of a fiddle with the EspruinoWiFi driver to try and get it to detect errors, but it does seem there is some issue reporting them back through the HTTP/TCPIP stack so I'm not going to put that code in until I can get the whole thing going.