Thanks for posting up the code, it's a nice idea! - I just gave it a try.
What I believe is happening is Unable to create socket happens because you have too many active connections. Espruino via ESP8266 can handle around 4 I believe - but you fire off 3 at the same time.
While that works normally, if a connection gets slowed down for some reason and isn't closed after 30 seconds, now you're using 4 at once. One more and it'll fail.
If it's like me, I found that after a while it did start working again?
If you output when a socket opens and when it closes (like above), you'll probably be able to see it happening.
So... Personally I'd request each of your symbols in turn, after each one has completed - that'll probably make these slightly broken connections far less frequent. You could actually update more often, but could just update each token in turn?
You could also skip an update if something is already in progress (I believe connections will time out after 60 seconds anyway)
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.
Thanks for posting up the code, it's a nice idea! - I just gave it a try.
What I believe is happening is
Unable to create socket
happens because you have too many active connections. Espruino via ESP8266 can handle around 4 I believe - but you fire off 3 at the same time.While that works normally, if a connection gets slowed down for some reason and isn't closed after 30 seconds, now you're using 4 at once. One more and it'll fail.
If it's like me, I found that after a while it did start working again?
If you output when a socket opens and when it closes (like above), you'll probably be able to see it happening.
So... Personally I'd request each of your symbols in turn, after each one has completed - that'll probably make these slightly broken connections far less frequent. You could actually update more often, but could just update each token in turn?
You could also skip an update if something is already in progress (I believe connections will time out after 60 seconds anyway)