Skip to content

Instantly share code, notes, and snippets.

@nachocarballeda
Created January 2, 2020 17:35
Show Gist options
  • Save nachocarballeda/eacf8c84bd7e5488e6c86c83dcf22865 to your computer and use it in GitHub Desktop.
Save nachocarballeda/eacf8c84bd7e5488e6c86c83dcf22865 to your computer and use it in GitHub Desktop.
nodered msg composer part
if (keychar === "12") { //12 is the keychar for OTA Configs
var payload = msg.payload.substr(2);
} else {
var payload = msg.payload.substr(4);
}
if(keychar === "12") {
msg.payload = eui + "/configuration/" + payload;
msg_is_config = true;
} else {
msg.payload = eui + "/messages/partials/"+ keychar + "?time=" + msg.time + "&msg=" + sequence_number + ";" + payload;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment