Try using wifi.at.debug(); to get more details out of the communication between Espruino and ESP8266.
I hope the your .getPrice() thing close the http request everytime you make the access and tries not to start over all again.
What I personally do not like is that wifi stuff is not in an onInit(). If you put it in one, declare the variables outside of onInt() and used inonInit().
Then upload the code. Nothing will happen yet... intentionally. Then you save "save()" in the console: this will save the code in the flash (assuming you have 'no save on upload configured in your IDE), and when done, it invokes onInit(). This way you make sure that nothing runtime is saved that is not run thru and initialized when power-cycle it.
I had no issues... the code structure is solid with the error handling... What you could think of is to do retries on error with a setTimeout() (and clearing stuff up that may be pending). I think the connect to ESP8266 is repeatable, for the connect to Wifi I would first issue a real/complete disconnect and catch eventual errors...
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.
@DamianMontero,
your code id correctly structured:
Code is taken from a different board and example.
Try using
wifi.at.debug();
to get more details out of the communication between Espruino and ESP8266.I hope the your
.getPrice()
thing close the http request everytime you make the access and tries not to start over all again.What I personally do not like is that wifi stuff is not in an
onInit()
. If you put it in one, declare the variables outside ofonInt()
and used inonInit()
.Then upload the code. Nothing will happen yet... intentionally. Then you save "save()" in the console: this will save the code in the flash (assuming you have 'no save on upload configured in your IDE), and when done, it invokes
onInit()
. This way you make sure that nothing runtime is saved that is not run thru and initialized when power-cycle it.I had no issues... the code structure is solid with the error handling... What you could think of is to do retries on error with a setTimeout() (and clearing stuff up that may be pending). I think the connect to ESP8266 is repeatable, for the connect to Wifi I would first issue a real/complete disconnect and catch eventual errors...