Using the guide, I am able to program a Puck to "forward" the commands sent from the PC (Web Bluetooth IDE) In this case, I am able to turn on the LED of a second Puck without prior programming on that Puck.
When I upload the code I sometimes get the error Uncaught Error: Unhandled promise rejection: undefined, it seems to be pretty random as I am able to get it to work after reuploading the code a few times. Why does this happen? (My Pucks are on 1v88)
When I try to send a Eddystone broadcast command using this method e.g. require("ble_eddystone").advertise("goo.gl/B3J0Oc"); I am unable to detect the Eddystone broadcast using Beacon Tools app on my phone. Disconnecting and reconnecting the second Puck ends up with a Connection error. In the end I am forced to reset the second Puck by pulling out the battery. Is it possible that the UART connection will interfere with the Eddystone broadcast?
Currently I am only testing on two Pucks, but is there an efficient way to make the code "recursive", such that if I add more Pucks and they are only in range of the second Puck, I can make the second Puck search for other Pucks nearby, then send the command again? I know that one way to do it is to put the whole code in the "commands to be sent field" i.e.
But this will only make the command broadcast 2 times in total which does not help if the number of Pucks increase. It would be great if the command becomes recursive so that each Puck that receives the broadcast can turn on the LED + search for other Pucks nearby and send them the command. Does the Puck have some functions to do this?
#4. What is the maximum command length that the require("ble_simple_uart").write() function supports?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi +Gordon,
I am doing some tests on BLE UART using the ble_simple_uart module from the guide at http://www.espruino.com/Puck.js+BLE+UART
Using the guide, I am able to program a Puck to "forward" the commands sent from the PC (Web Bluetooth IDE) In this case, I am able to turn on the LED of a second Puck without prior programming on that Puck.
The code that I am using is:
However, I have some questions:
Uncaught Error: Unhandled promise rejection: undefined
, it seems to be pretty random as I am able to get it to work after reuploading the code a few times. Why does this happen? (My Pucks are on 1v88)require("ble_eddystone").advertise("goo.gl/B3J0Oc");
I am unable to detect the Eddystone broadcast using Beacon Tools app on my phone. Disconnecting and reconnecting the second Puck ends up with a Connection error. In the end I am forced to reset the second Puck by pulling out the battery. Is it possible that the UART connection will interfere with the Eddystone broadcast?Currently I am only testing on two Pucks, but is there an efficient way to make the code "recursive", such that if I add more Pucks and they are only in range of the second Puck, I can make the second Puck search for other Pucks nearby, then send the command again? I know that one way to do it is to put the whole code in the "commands to be sent field" i.e.
But this will only make the command broadcast 2 times in total which does not help if the number of Pucks increase. It would be great if the command becomes recursive so that each Puck that receives the broadcast can turn on the LED + search for other Pucks nearby and send them the command. Does the Puck have some functions to do this?
#4. What is the maximum command length that the
require("ble_simple_uart").write()
function supports?Thanks.