Recursive BLE UART Broadcast? (Questions regarding Bluetooth "Mesh") #2199
Replies: 3 comments
-
Posted at 2017-05-04 by @gfwilliams Looks like a nice idea!
Because your Pucks are on 1v88? Try 1v92! There are a huge amount of issues (including the lack of decent error messages) that have been fixed since the release.
Puck.js won't advertise until you disconnect BLE from the device. I think it's a pretty standard BLE thing. Reconnection should still be possible while broadcasting Eddystone - I just tried it here. Best to try again when 1v92 is installed though as it might have been an issue with 1v88.
There's nothing built in, but why not pre-load each Puck with a function that does the recursive send. For example if you can it You'd need to be a bit clever though - you don't want Puck A sending a command to Puck B, but Puck B then sending it back to Puck A. I guess you'd want a 'transaction ID' sent along with the command so Pucks knew to ignore a command if they'd seen it before.
There is no maximum length - it's just what will fit in RAM. The longer it is the longer it'll take to send though! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-04 by intern Thanks +Gordon for your replies. I will update the Puck tomorrow and hopefully it will fix the issues at the start. Also I was wondering where is the code that I uploaded stored in the Puck? Is it in the RAM or the flash memory? Thanks for your help again :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-04 by @gfwilliams
RAM, unless you type
Yes, just type
If you send |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-05-04 by intern
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?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.
Beta Was this translation helpful? Give feedback.
All reactions