Deploy Javascript files to a Puck from native code #3079
Replies: 6 comments
-
Posted at 2017-05-25 by @gfwilliams 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 Otherwise you can just send 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? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-28 by chustar Thank you, Gordon. I didn't know about the "echo(0)\n", should come in handy. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-30 by chustar @gfwilliams Just coming back to say echo (0) and prepending char(16) has been VERY helpful! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-31 by @gfwilliams No problem - thanks for letting me know! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-09-05 by user67760 Guys, please send some JS code samples for learning how it works on puck.js. Charlie at Intellijoule, Inc. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-09-09 by @gfwilliams 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 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-25 by chustar
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?
Beta Was this translation helpful? Give feedback.
All reactions