Connect to RuuviTag from a Flutter application

Hello everyone!

I have a Flutter app project and I want to connect with RuuviTag.

How can I connect from a Flutter app with RuuviTag and collect all the data (Temperature, Create Date, Update At , Location …), and keep listening to it?

Any idea how to do that?

Hello,

If you connect to RuuviTag and register to Nordic UART Service notifications you’ll get a notification with current sensor data every 2.5 seconds. More details are at Bluetooth connection - docs

1 Like

Hello!

I wrote a proof of concept flutter app a few years ago using flutter_blue | Flutter Package .
It did not connect to the tags tho, just listened for the bluetooth advertisements and decoded the data. But you should be able to connect and read data using that library too.

1 Like

Hi,

Thanks for your reply.

What I could collect data after connecting with the tag via this package:

Tag name, and I could to know:

DiscoveredDevice(id: C4:58:38:21:B6:67, name: Ruuvi B667, serviceData: {}, serviceUuids: [6e400001-b5a3-f393-e0a9-e50e24dcca9e], manufacturerData: [153, 4, 5, 23, 70, 105, 133, 190, 154, 253, 236, 0, 28, 3, 32, 176, 54, 193, 47, 237, 196, 88, 56, 33, 182, 103], rssi: -69)

But I couldn’t read other data like (Temperature, Create Date, Update At). Do you know why I couldn’t?

Could you please send me the flutter project you have worked on it? to read all data.

The ManufacturerData is what you are looking for!

hex: 99, 04, 05, 17, 46, 69, 85, BE, 9A, FD, EC, 00, 1C, 03, 20, B0, 36,
C1, 2F, ED, C4, 58, 38

see Packet Formats

99 04 Ruuvi Mfg ID
05 is the packet format
17,46 is the temperature
69,85 is the humidity
BE,9A is the air pressure
FD,EC is the X acceleration
00,1C Y
03,20 Z
B0,36 reflects the battery voltage and TX power
C1 is the movement counter
2F,ED Seq number
C4, 58, 38… is the MAC

3 Likes

I’ll see if I can find the source, not sure where it is. But as @dgerman said, manufacturerData is what you are looking for. You just need to decode the data.

I took the opportunity to brush up on my dart syntax and made a quick parser for dataformat 5. Hope that helps :slight_smile:
http://dartpad.dev/e313223c361538a0db468dde9a2707f4

2 Likes

Hello everyone!
I read here that the interval for notification is 2.5 sec. Is there a posibility to change this to e.g. 250ms for a period of time?
Thanks a lot!
Best Regards Holgus

Hi @Holgus ,

afaik : No (unfortunately)

Of course, I may be able to learn something new in the future. :wink:

It’s possible to code such logic in the firmware itself, e.g. some custom firmwares transmit once per 10 seconds most of the time and switch to 10 times / s when something interesting is happening. However official Ruuvi software does not support interval changes like that

Thank you for the feedback! This possibility could be interesting for the movement function.