-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transmit humidity data #24
Comments
I would suggest you start with the temperature example (https://github.com/floe/BTLE/blob/master/examples/temperature/temperature.ino) and change the UUID to the one for humidity (should be in the BTLE specification UUID list). |
Thank you for your answer. I tried, I succeeded. However, I need battery power, temperature and humidity. I tried to use NRF_DEVICE_INFORMATION_SERVICE_UUID, but nothing works. Please tell me what I'm doing wrong? `#include <BTLE.h> RF24 radio(9, 10); struct battery_level_data { void setup() { void loop() { battery_level_data battery_data; nrf_service_data temp_data; nrf_service_data hum; btle.preparePacket(); if (!btle.addChunk(0x16, sizeof(battery_data), &battery_data)) { if (!btle.addChunk(0x16, sizeof(temp_data), &temp_data)) { if (!btle.addChunk(0x16, sizeof(hum), &hum)) { btle.transmitPacket(); delay(500); |
INFORMATION_SERVICE won't work for humidity, that's something entirely different. 0x2A6F seems to be correct, see also here: NordicSemiconductor/Android-nRF-Connect#52 |
I probably asked the question not quite correctly .. I managed to send the humidity, as you advised, replacing 0x1809 with 0x2A6F. But I do not understand how to transfer 3 parameters at once in one package - tempurature, humidity, and battery charge. My sensor needs all of them. |
I think the code you posted actually looks pretty correct (apart from the humidity UUID). What does e.g. the nRF Connect app show for your device when all 3 parameters are present? |
Only 2 parameters will arrive in NRF connect. There is no third at all (humidity). The message "hum does not fit" arrives in the serial port. It feels like btle.addChunk doesn't add a third parameter. If we swap the blocks |
OK, then you're running out of space in the advertisement, for the nRF24, you can only have at most 21 bytes of payload. Try setting the name to "" (empty string). |
Please tell me how to use this library to transmit humidity data?
The text was updated successfully, but these errors were encountered: