The LoRa Serialization library lets me encode for humidity, temperature, and others, but I’m having trouble with the bitmap.
So others see the full setup for the basics that work:
–>On the Payload Formats tab, encoder, use the following (modify accordingly):
function Encoder(json, port) {
var bytes = encode([json.humidity, json.temperature], [humidity, temperature]);
return bytes;
}
// https://github.com/thesolarnomad/lora-serialization/blob/master/src/encoder.js
// paste the entire contents of the encoder.js below
For the JSON fields:
{"humidity": 48.2, "temperature": 24.82 }
which gives
// encoded payload:
D4 12 09 B2
For bitmap (boolean?), I’m trying the following to be able to send on/off to various functions on the node. I believe I’m not formatting the bytes variable properly in the second line:
function Encoder(json, port) {
var bytes = encode([json.bitmap], [bitmap]); //missing something ???
return bytes;
}
with various attempts in the fields:
{"a": false} //outputs 00
{"a": true} //outputs 80
{"a": true, "b": true, "c": true, "d": true, "e": true, "f": false, "g": true, "h": true} //outputs 00
Thank you again for the help–and your time.