Conneect RuuviTag with ESP32

Hi Fam
I have in my possession a RuuviTagPro sensor and an ESP32-C3 board. I have implemented the connection between ESP32 and Ruvvi ​​ with BLE and I can receive the measurements from Ruvvi ​​and see them from terminal on ESP32. However, I also want to receive the measurements that are stored in the sensor’s memory (as you can with the synchronization) when i want . Does anyone know what I can do about it?

Maybe @otso would have clues for this. Also check https://docs.ruuvi.com if that would be helpful in this case.

Hello,

You can find the description of communication protocol to read the history in our docs.

Hello,

I have read the description of the communication protocol and have implemented the window until my sensor sends me its heartbeat.

I wonder what request/order I should send to my sensor so that it returns the files it has been collecting for 10 days

Hello,

If you’re getting the heartbeat notifications you’re 90% done :slight_smile:

The details on log reading are on this page.

In short, to read all the data send 11 bytes: 3 Byte header: 0x3A 0x3A 0x11, 4 bytes for current epoch time in seconds 1720175015 → 0x66 0x87 0xC9 0xA7 and to read all the logged data send 4 bytes of zeroes: 0x00 0x00 0x00 0x00

The whole message is 0x3A 0x3A 0x11 0x66 0x87 0xC9 0xA7 0x00 0x00 0x00 0x00

The tag does not know what the real time is, it will calculate the timestamps of data based on timestamp you send. Once all data is sent, final message is 0x3A 3A 10 FF FF FF FF FF FF FF FF.

You should request only data you need, i.e. don’t read 10 days of history every day but rather run one sync for 10 days and then daily 1-day sync. That saves the battery a bit.

Hello,

Thank you for your help, I was able to send the message in the format you suggested and now I received all the data it had saved. Thank you also for the advice on saving battery

2 Likes