You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Have you tried turning on 'throttling' in the IDE settings? You could also check the value of E.getErrorFlags() to see if the upload itself somehow overflowed Espruino's internal buffers.

    When you're sending function calls over bluetooth, have you previously called echo(0)? You can also get a similar effect by sending character #16 at the beginning of a line.

    If you've still got echo turned on, what happens is Espruino sends back the characters that you send it, plus =undefined\n or similar when the function is executed (it's even worse for multi-line stuff). So if you're sending 8 characters (eg foo(42)\n) as fast as you can at 9600 baud down Bluetooth, Espruino's trying to send foo(42)\n=undefined\n (also at 9600 baud) so quite quickly the output buffer gets full and it waits, and then the input buffer gets full and it drops characters.

    There's also potentially an issue that if you're using a WS2811 LED strip, Espruino has to turn off interrupts so that it can reliably output the waveform that's required. That means that if you're sending a lot of data to a big strip, and sending data down bluetooth via serial, characters can get lost.

    Best way to avoid that right now would be to make sure that the sender leaves a pause after sending the command, so Espruino has time to send the data to the WS2811s.

    Hopefully at some point soon I'll switch to using DMA for the WS2811s, and when that happens I can leave interrupts on and the problem should go away.

About

Avatar for Gordon @Gordon started