Closed kairos0ne closed 1 year ago
I'm afraid there's not much I can do to help with suggestions on the unstable BLE - I assume it's pretty stable when you're writing code from the PC, so I guess it's something to do with the ESP32 module. It could even be power supply related if you're running an ESP32 and a bunch of neopixels...
But on the substr
front - substr exists, but is for Strings. You're using uartService.write(packet.buffer)
so you're writing to the UART library with an ArrayBuffer. Normally Espruino would handle stuff like that but the UART library isn't built-in and was only expecting you'd be sending strings.
Using: uartService.write(E.toString(packet.buffer))
instead would probably fix it.
If you have other errors like this please can you ask on the forum first? Otherwise it gets very hard to keep track of things in the bug tracker here
Thanks for the help will raise issues in forum as requested.
I actual see a few issue here, the connection over BLE is unstable for some reason only connects intermittently.
Also I see this error substr is not available... seems odd as this std lib for JS
Here is the error:
Here is the PUCK.js code
and here is the ESP32-s2 code