Great! That's really strange... I guess it could be a firewall issue? It's possible it's some new 'feature' that block connections to other devices on the local network? I imagine if you're connected to the public BTWiFi rather than BTHub then that'd do it?
I think realistically Espruino will struggle at much past 5 requests/sec. It's not just the 20 bytes, but the headers that get sent are usually pretty huge each time (plus there's extra for opening/closing the socket) - and the connection to the Wifi is usually only around 11 kBytes/sec.
I guess you could actually rate-limit your HTTP requests to 2 a second or so, but send the whole frame each time?
Or yes, websockets would be the way to go - you should be able to push packets of data through that pretty fast.
Also, I don't know if you're doing it or not, but you can use 'template strings' that use the backtick character for HTML: `
They can be multi-line, so it gets really nice and easy to write actual HTML alongside the JS code
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.
Great! That's really strange... I guess it could be a firewall issue? It's possible it's some new 'feature' that block connections to other devices on the local network? I imagine if you're connected to the public
BTWiFi
rather thanBTHub
then that'd do it?I think realistically Espruino will struggle at much past 5 requests/sec. It's not just the 20 bytes, but the headers that get sent are usually pretty huge each time (plus there's extra for opening/closing the socket) - and the connection to the Wifi is usually only around 11 kBytes/sec.
I guess you could actually rate-limit your HTTP requests to 2 a second or so, but send the whole frame each time?
Or yes, websockets would be the way to go - you should be able to push packets of data through that pretty fast.
Also, I don't know if you're doing it or not, but you can use 'template strings' that use the backtick character for HTML:
`
They can be multi-line, so it gets really nice and easy to write actual HTML alongside the JS code