Espruino Wifi issues #4477
Replies: 1 comment
-
Posted at 2017-05-09 by @gfwilliams Sorry you've hit problems - but wow, thanks for tracking this down so far. Do you have a simple example that'll reproduce this? And do you know what the value of I'd be a little worried about leaving the Posted at 2017-06-15 by dave_irvine I think I might be running into something similar. If I open a http get and a http post at the same time and pipe from the get to the post, I eventually get a freeze which I imagine is the esp8266 failing silently. Posted at 2017-06-16 by @gfwilliams It's odd - I was pretty sure I'd made some recent changes to help with this issue though. Do you think you could check on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-05-08 by SteveHayles
Firstly huge kudos to the developers of Espruino; it's fairly mind blowing being to able to easily and quickly prototype systems on fast hardware with such a simple and well thought development process.
I have come across issues trying to get a reliable send / receive system using MQTT. The problems do not come from the MQTT libraries themselves and I think I have tracked the issues to the EspruinoWifi module which is causing the socket to close during a 'send' cycle.
The following code
attempts to send data using the well known CIPSEND, OK>, sendMyData, SEND OK pattern of the ESP8266 and if there is no incoming data during the send period then everything works fine.
The issue comes in that the callback data will sometimes contain other incoming data (say from an +IPD call) from the RX buffer in which case the final else clause (line 24) determines there has been an error.
I have tried various attempts to better synchronize calls to the SEND function and 'lock' any receive events but haven't been successful.
What does anyone think about simply returning the callback in any situation that is outside the normal flow ?
I have tried it as follows
and it allows the socket to stay running but it still doesn't feel quite right. With a more explicit error clause (not sure what that looks like from the ESP2866 when it fails to send) it seems a workable solution and has allowed me to send and receive asynchronous (publish and subscribe independently) with decent size messages at upwards to 10Hz.
Any thoughts on whether it's a valid fix or whether there are better solutions ??
Thanks and regards,
Steve
Beta Was this translation helpful? Give feedback.
All reactions