-
• #2
There's no better option than the BLE UART if you want to do it wirelessly. You could implement your own characteristics, but it'd be just as slow - if not more so.
The issues with writing while Puck.js is transmitting could just be a buffer overflow - if it's waiting to send data while also receiving stuff.
When you're writing code I'd definitely try doing what the IDE does though, which is to send character code 16 at the start of line for each new declaration (which disables echo for that line). You can get the
espruino
NPM package (the CLI tools) to output the exact characters it would have sent to a file, which might help you there.Otherwise you can just send
"echo(0)\n"
before everything to totally turn echo off for all commands.I'm afraid I'm not up to speed on the Android BLE APIs so I don't know if there's a faster way to do BLE - but I guess there must be if Web Bluetooth can do it. It might be worth looking at the sourcecode for the Nordic UART app and seeing if they do something different?
-
• #3
Thank you, Gordon. I didn't know about the "echo(0)\n", should come in handy.
-
• #5
No problem - thanks for letting me know!
-
• #6
Guys, please send some JS code samples for learning how it works on puck.js.
Charlie at Intellijoule, Inc.
-
• #7
Specifically what are you after? Interfacing from Android, or just generally?
There are already a bunch of examples for using Web Bluetooth, Python or JavaScript to interface to Espruino here: http://www.espruino.com/Interfacing#bluetooth-le
I've been using building an android app to communicate with my puck over UART and that has been going quite well.
However, it is too slow and unreliable for sending large scripts.
Due to the limitations of writing to Bluetooth characteristics, I have to write them in this way (excuse the pseudo-code):
The problems with this are:
Is there a way to write these longer scripts without using the UART?