How to setup a custom NRF Service on Bangle.js 2 #7911
Replies: 2 comments 4 replies
-
|
Hi Leon, Did you find code as an example somewhere that you based this off, or was this an AI suggestion? The problem is the There isn't enough time to come up with data in time to send it to the connected computer, so you have to set the value ahead of time - it's not possible to have an It's odd the new characteristic doesn't appear - usually if you're connected to the device when you run the code you'll see some kind of message if something has gone wrong... Maybe put in some print statements to ensure it's actually running? To transfer the data you can create 2 characteristics - one that can be watched with 'notify' for data to be pushed out of it, and one that the client can write to to set it off. To push data out of a 'notify' service you use NRF.updateServices, there's an example at: https://www.espruino.com/Reference#l_NRF_updateServices But really, this kind of thing is what the Bluetooth UART characteristic that's built into Bangle.js is great for - your client can just connect to the Bangle and listen on the Nordic UART characteristics it provides, and you just use |
Beta Was this translation helpful? Give feedback.
-
|
@enaon when using NRF.setAvertising it actually works to the point i can atleast see my service. But only if use a 16bit UUID not with 128bit UUIDs. Anyway, thanks! @gfwilliams I do not quite get why the transfer size should be an issue, as i can send my data in chunks. Because thats what i am doing with nordic UART anyway and i dont quite understand in what way a custom service actually differs from the nordic UART. Sorry if thats a bit nooby, i am just learning about all this stuff |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, as the title suggests i am trying to set a custom service to send some health data that i record and safe locally on the watch to my smartphone. Therefore i am trying to create a NRF service but unfortunately its not working. I cant find the service even though i wrote the code into a boot.js file which should be running whenever the watch starts, right. Let me share you my code, especially the part with NRF.Services should be relevant. What am I doing wrong?
All the best
Leon
Beta Was this translation helpful? Give feedback.
All reactions