You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something like the following will do just fine; the backend application can easily decode it if documented.
// Reserve 6 bytes (3 words) to send temperature, humidity and voltage
byte data[6];
double temp = faboHumidity.getTemperature();
double humi = faboHumidity.getHumidity();
// Encode the 2 doubles into the first 4 bytes
int temp = 100 * hts221.getTemperature();
int humi = 100 * hts221.getHumidity();
data[0] = temp >> 8; // or: highByte(temp)
data[1] = temp; // or: lowByte(temp)
data[2] = humi >> 8;
data[3] = humi;
// For some reason the core library uses port 19; please document!
return LoRa_send(19, (uint8_t*) data, 4, NO_ACK);
...
long voltage = badger_read_vcc_mv();
data[4] = voltage >> 8;
data[5] = voltage;
// One could use a different port here
return LoRa_send(19, (uint8_t*) data, 6, NO_ACK);
(I'd argue that sending the values should be part of the core library at all. For decoding the above see also Getting Badgerboard to work with TTN.)
The text was updated successfully, but these errors were encountered:
Status packet is not meant to be sent very often and is meant rather as keepalive packet, thus its confirmed. Since Badgerboard is meant mostly for making proof-of-concepts, and JSON is simply human readable, we started with it. But we will add similar function You proposed.
Sending JSON is just a waste of bandwidth, and so is using confirmed uplinks for all data.
badgerboard/src/badger.cpp
Lines 533 to 587 in a2b1dfe
Something like the following will do just fine; the backend application can easily decode it if documented.
(I'd argue that sending the values should be part of the core library at all. For decoding the above see also Getting Badgerboard to work with TTN.)
The text was updated successfully, but these errors were encountered: