Getting the data via characteristics

29 views
Skip to first unread message

Joonas Uusnäkki

unread,
Apr 12, 2021, 10:44:31 AM4/12/21
to Rhythm Badges
Hello!

I am using this project as a reference to create a new hub that runs in web.
I am using ReactJS, vanilla JavaScript and Web Bluetooth API in it.

I was wondering when getting the service 6e400001-b5a3-f393-e0a9-e50e24dcca9e from the badge we only have:
  1. Characteristic "Notify" : 6e400003-b5a3-f393-e0a9-e50e24dcca9e
  2. Characteristic "Write/Write without response" : 6e400002-b5a3-f393-e0a9-e50e24dcca9e
According to Chromes' bluetooth internals and other web pages these characteristics cannot read the given value from badge. I am really stuck with my project and was wondering how can I read the value of the voice data that is transmitted from a badge with these characteristics that are in the original MIT python code as well?

Thank you very much

oren.l...@gmail.com

unread,
Apr 12, 2021, 3:45:37 PM4/12/21
to Rhythm Badges
Hi Joonas!

The protocol depends on which version of the badge firmware you are using. If I programmed the badges, you probably are using the old protocol (or probably an the older version of the badge firmware). If you can program the badges, you can use the new protocol.

A few things to note (from the top of my head... it has been a while..)
  • After the badge is turned on, it will wait for a server/hub to connect to it and "sync" it. That means sending the current (UTC) time. I think that the same command also tells if what data to start collecting (audio, proximity, or both)
  • The badge will close the connection after several seconds of inactivity, so if you want to continuously read from the badge, you need to send a command periodically. 

New protocol:
This protocol has cleaner implementation and code. 

Old protocol
The code for communicating with the badge is quite messy (my least favorite part of the code base). You can find reference code here:

Joonas Uusnäkki

unread,
Apr 15, 2021, 6:23:14 AM4/15/21
to Rhythm Badges

Hey, 

Thanks for a very informative message!
I really didn't expect the badges to disconnect after a while but that is one thing to consider.
According to my colleague we are using the new protocol.

Let's see if I can get this thing to work: at the moment I am just trying to read the voice data from the badge.
According to the bluetooth internals we cannot read it straight from the badge itself, like it has been done here (class NrfReadWrite, lines 36-47) https://github.com/HumanDynamics/openbadge-hub-py/blob/master/src/nrf.py

The idea of the project is to minimize the current code for a proof-of-concept type of hub.

-Joonas

Joonas Uusnäkki

unread,
Apr 15, 2021, 6:47:49 AM4/15/21
to Rhythm Badges

Like here:
On Monday, 12 April 2021 at 22:45:37 UTC+3 oren.l...@gmail.com wrote:
bluetoothInternalsBadge.PNG

Oren Lederman

unread,
Apr 15, 2021, 12:30:36 PM4/15/21
to Joonas Uusnäkki, Rhythm Badges
Correct. You can't just stream it from a characteristic. The only characteristic we expose is the one that allows to talk to the badges and request data. And you'll need to tell the badge to start recording that data.

I vaguely remember that in the example terminal there is a steaming command.

If you just want to use the badge as a "dumb" microphone, you will need to write a new firmware. In that case, you might want to use a nRF52 dev board that has a built in microphone. I remember seeing a few of these. The firmware should be fairly simple, since you don't need to deal with storing data and time sync 

--
You received this message because you are subscribed to the Google Groups "Rhythm Badges" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rhythm-badge...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rhythm-badges/3ff13119-afe7-4c92-b281-30bae888076fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages