ruuvitag GATT services #7526
Replies: 1 comment
-
Posted at 2020-12-03 by @gfwilliams What you're doing looks fine - you just need to call Calling All you need to do is pull the battery and re-insert it with the button held down for ~10 seconds and the ruuvitag will boot without loading your code and will be back to normal for connections Posted at 2020-12-03 by @gfwilliams Also, what you're seeing above in the screenshot is because I guess you maybe put it into DFU mode when powering up? If you power up normally you should be fine. Posted at 2020-12-03 by titaniumwhite You're right, it was power up in DFU mode. Posted at 2020-12-03 by @gfwilliams Have you tried just reflashing using the firmware update mode (maybe to a Ruuvitag firmware) and then flashing back to Espruino? I'd have thought that should fix it. The issue might be that on Espruino devices I the bootloader is smart enough to time out after around 5 seconds if the device is powered with the button held down. If RuuviTag's doesn't do that then the only way of booting into Espruino with the button held down may be trial and error - powering on while pressing BTN1 at exactly the right point. Have you tried turning bluetooth off and on on your PC?
Actually you can attach a USB-TTL converter to D4 and D5 on the Ruuvitag, power it on, and communicate with it that way at 9600 baud. Posted at 2020-12-03 by @gfwilliams
Shouldn't on Espruino - 128 bit UUIDs go in a scan response packet so they don't interfere with the normal device. Posted at 2020-12-03 by titaniumwhite
Yes, I tried flashing both Ruuvitag firmware and Espruino but it fails in both cases.
I tried, but my laptop can't see the Ruuvi. I get the same error when I try to connect with the nRF app and when I try to flash in bootloader mode. Seems like something's broken in the GATT protocol because the Ruuvi Bluetooth is not working anymore. Posted at 2020-12-03 by titaniumwhite So, to change data on the notify characteristics of the UART service do I have to write something like that?
And then, from the script on the laptop, I have to read the data value of the notify descriptor, isn't that right? Posted at 2020-12-04 by @gfwilliams Yes - you just enable notifications for that characteristic on the PC and you get a callback whenever you call updateServices on the Ruuvitag Posted at 2020-12-04 by titaniumwhite Sorry for insisting, but I tried again in the second Ruuvi I have and now it's not working anymore, as the former.
The Ruuvi is not visible on Bluetooth anymore, nRF Connect can see it only in bootloader mode. Tomorrow I'll flash the Ruuvi through the Ruuvitag DevKit, but I'd like to understand how to make it works. Thanks a lot for helping, I really appreciate that. Posted at 2020-12-07 by @gfwilliams
I'm not sure how you're getting into bootloader mode... and that's without physically touching the beacon?
Is it possible that it's just that your PC/Mac/something is auto-connecting to the Ruuvitag? It'll stop advertising or being visible once it is connected to another device. As I'd mentioned above you can get serial communications to a Ruuvitag running Espruino, so that could be a good way to debug it. I'm not sure how much extra help I can be to be honest. While Ruuvitag were supporting Espruino (hence the builds) for quite a while, they stopped at the end of 2019. I've maintained a few builds for them for free since then, but it's now a year since they stopped and if you've got issues you should probably get in touch with them. Who knows, if they see there's value in getting me to support Espruino they might start supporting the project again :) Posted at 2020-12-07 by titaniumwhite I'm sorry they stopped supporting Espruino, they both are great projects with great potential. Uncaught Error: Invalid Service UUID: UUID string should only contain hex characters and dashes I found the related following issue on github espruino/Espruino#1723. Posted at 2020-12-08 by Robin Mon 2020.12.07 Hi @titaniumwhite I'm responding as I noticed your post arrived indicating a Time Zone near myself, and most that are likely to respond, wont be available until tomorrow. I'm not a wiz using GATT, but I did remember a forum post a while back that asked a similar question. @gfwilliams provided a specific example in post #13 and How to: *'Generate a UUID compliant with RFC 4122'* > https://www.cryptosys.net/pki/uuid-rfc4122.html I Googled using the 'site' qualifier: which returns a bunch of references which may assist also. These may not answer your question directly, but I didn't want you spinning your wheels just waiting until sunrise. Hope you find some insight there. . . . Posted at 2020-12-08 by @gfwilliams Actually that error you pointed to is for ESP32 - I don't believe it was ever an issue on official boards. Thanks @robin - there's a good example of using UUIDs at the link you posted on http://forum.espruino.com/conversations/323285/ And actually looking again at your code it's obvious - sorry I didn't spot it before! You're actually trying to use the text
If you want to use the UUIDs as constants at the start of the code you'd have to manually set it in code:
Posted at 2020-12-10 by titaniumwhite @robin thanks for the links, they're very useful to me, the one about UUID particularly. @gfwilliams thanks for the correction.
Just removing the advertise, the Ruuvi doesn't crash anymore and now my webapp can see and connect to it. Posted at 2020-12-14 by @gfwilliams
No. Literally all it does is add that UUID to the bundle of advertising data it sends out when it's not connected to anything. The only reason you'd do that is if you wanted a way to 'find' your devices (eg, "scan for all devices with service |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-12-03 by titaniumwhite
Hi guys,
I'm trying to connect a Ruuvitag supporting Espruino to my laptop through Noble.js. I need to collect some data through a sensor soldered on the Ruuvitag and to send them to the laptop.
I flashed this code through the Espruino Web IDE to make the Ruuvi notify the central module as soon as it collects data, but I guess I have misunderstood something since the Ruuvi is not connecting nor Bluetooth flashing anymore. There is the screenshot of nRF Connect connected to the Ruuvi in bootloading below, it seems there is no more the Nordic UART Service... oops.
Luckily I have one more Ruuvi and I really need to make it communicate with the laptop.
How can I make it?
Do I have to create my own service and my own notify characteristic?
Or do I have to use the UART characteristic for notification as above?
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions