• Ahh, ok. Your problem could be that by default Espruino is acting as a normal command-line interface. It 'echo's the characters you send it back to you, and that could be causing buffering problems since it may be trying to send more characters to you than you are to it.

    One way to debug would be to make sure you set notifications on the RX characteristic, and dump the data you receive back from Puck.js somewhere so you can see if you get any errors.

    You can either send echo(0)\n to stop echoing, or you can prefix each statement you send with \x10 (char code 16) to stop it on a per-statement basis.

    The other easy solution to this is to run your code through the Espruino command-line tools: https://www.npmjs.com/package/espruino

    If you do espruino -p puck_bluetooth_address myfile.js -o output.js then it'll output the exact text that the IDE would have sent to Puck.js - you can then send that slightly modified text over yourself.

About

Avatar for Gordon @Gordon started