Node-Red v0.15.3???
Home › Forums › Conduit: AEP Model › Node-Red v0.15.3???
- This topic has 13 replies, 3 voices, and was last updated 2 years, 2 months ago by SaSa.
-
AuthorPosts
-
January 20, 2020 at 9:59 pm #30176bdbuysse@gmail.comParticipant
Are there plans to upgrade node-red on conduit gateways to a more recent version? I love that your gateways come equipped with node-red as it affords a simple way to get exposed to the LoRa stack, but was saddened when I recently purchased a MTCAP-915-041A-ND gateway and found out it is still using v0.15.3. The Node-Red community still lists Multitech as a sponsor, but it seems your gateways are stuck on a 2016 release.
January 21, 2020 at 8:16 am #30177Jason ReissKeymasterThis has been discussed many times before.
The hardware does not support hw floating point operations, sw floating point was last supported in node.js in the installed version v0.10.48, node-red v0.15.3 is the last version available.An updated gateway will be available this year.
May 13, 2022 at 4:28 am #32758SaSaParticipantHello Jason,
To be honest i saw your answer which is for 21 jan 2020, and I wanted to ask you pls if any upgrade has released till today for node-red ?
thanks in advance,
May 13, 2022 at 7:29 am #32760Jason ReissKeymasterSabri,
The current hardware still does not support hw float point operations required for newer versions of node-red.
We are working on updated hardware platforms that should be available later this year.
July 12, 2022 at 9:12 am #32814SaSaParticipanthello Jason,
hope you are doing great,
In fact I got a question, I’m running a code to aim to recive data from an API and to sort them.
The probleme is that I can see the resulte of this function in node-red v.2.2.2 but not in 0.15.3 ?
var data = [];
for (var i = 0; i < msg.payload.length; i++) {
var Pay = msg.payload[i].System_Activated;
let Dev_eui = msg.payload[i].valve_EUI;if (msg.payload === null) {
data.push({ payload: “Don’t action”, Dev_eui: Dev_eui, port : “1”, ack: “1” });
} else {
data.push({ payload: Pay, Dev_eui: Dev_eui, port : “1”, ack: “1” });
}
}
data = JSON.stringify(data);
console.log (msg.data);
return {data}`July 12, 2022 at 9:54 am #32815SaSaParticipantI have another probleme also, when I send a payload to an end-device, but it add something that doesn’t existe in patload.
could you please help me ?
using this code :
msg.eui = "XXXXXXXXXXXXX"; msg.payload = "31"; port = "1" ; ack = "1"; return msg;
July 12, 2022 at 11:51 am #32816Jason ReissKeymastermsg.payload = "31";
This will send two bytes, 3 and 1 in ascii as 0x33 and 0x31 shown below.
The downlink format is [TYPE][DEVADDR][FCNT][PORT][PAYLOAD]at+send hello
018856a20005000000013331OK
End of packet is
Port: 01 Payload: 3331To send only one byte.
msg.payload = new Buffer("31", "hex");
at+send hello
018856a2000a0000000131OK
End of packet is
Port: 01 Payload: 31Port is an int and ack is a bool.
msg.port = 1 ; msg.ack = true;
July 12, 2022 at 11:56 am #32817Jason ReissKeymasterFor your original JS code
How is System_Activated and value_EUI added to a payload?
This would not come out of the network server on Conduit.var Pay = msg.payload[i].System_Activated; let Dev_eui = msg.payload[i].valve_EUI;
Not sure why you create an array for data and push packets into it.
Only one downlink should be created. “eui” instead of “Dev_eui” as your second example should be used.This doesn’t look right.
data.push({ payload: Pay, Dev_eui: Dev_eui, port : “1″, ack: “1″ });
Let me know if you have more questions, seems like you are making progress in the right direction?
July 13, 2022 at 4:13 am #32818SaSaParticipantThanks Jason,
so with your help I could resolve the problem of payload and it sends correctly now.For the second part, we have some data which arrive from our database using a API request. the aim of this function is just to sort and analyse theses data and redirect them to our End-devices.
data format:
[{"ID":10132,"Humidity":53,"Date_Interpreted":"2022-07-12T04:38:42.000Z","System_Activated":null,,,"valve_EUI":"XX-XX-XX-XX-XX-XX-XX-XX"},{"ID":1970,"Humidity":61,"Date_Interpreted":"2022-06-23T09:01:33.000Z","System_Activated":null,"valve_EUI":"XX-XX-XX-XX-XX-XX-XX-XX"}]
By using this function, we want just to send
"system_activated"
as"payload"
to an end-device with eui :"valve-eui"
in a message containing"port = 1"
, and"ack: true"
Thanks in advance for your help.
July 13, 2022 at 8:44 am #32819Jason ReissKeymasterReviewing functionality of Node-red and returning an array should result in each message in the array being passed to the next node.
https://nodered.org/docs/user-guide/writing-functionsThis code should queue a single byte to the node based on the System_Activated field. You can change the value as needed.
downlinks = []; for (var i = 0; i < msg.payload.length; i++) { downlink = {}; downlink.eui = msg.payload[i].valve_EUI; if (msg.payload[i].System_Activated) { downlink.payload = new Buffer("01", "hex"); } else { downlink.payload = new Buffer("00", "hex"); } downlink.port = 1; downlink.ack = true; downlinks.push(downlink); } return downlinks;
July 18, 2022 at 7:08 am #32831SaSaParticipantthanks Jason,
the code that you sent me works but doesn’t result what I want exactly, It applies just for the first array.
thanks in advance.
July 18, 2022 at 8:04 am #32832Jason ReissKeymasterI am not sure exactly what you are meaning to do. Hopefully there is enough example code for you to play with and get to work for your use case?
July 19, 2022 at 8:27 am #32834SaSaParticipantok, I’ll try to better explain you my issue,
first of all this is exactly the format of data that I receive from my database using http request :
[{"ID_Inter":1980,"lumiere":62,"Date_Inter":"2022-06-23T09:31:33.000Z","System_Activated":null,"valve_EUI":"xx-xx-xx-xx-xx-xx-xx-xx"}, {"ID_Inter":1981,"lumiere":62,"Date_Inter":"2022-06-23T09:34:33.000Z","System_Activated":null,"valve_EUI":"xx-xx-xx-xx-xx-xx-xx-xx"}, {"ID_Inter":1982,"lumiere":62,"Date_Inter":"2022-06-23T09:37:33.000Z","System_Activated":10,,"valve_EUI":"xx-xx-xx-xx-xx-xx-xx-xx"}]
Using the code that you sent me, I mean this :
downlinks = []; for (var i = 0; i < msg.payload.length; i++) { downlink = {}; downlink.eui = msg.payload[i].valve_EUI; if (msg.payload[i].System_Activated) { downlink.payload = new Buffer("01", "hex"); } else { downlink.payload = new Buffer("00", "hex"); } downlink.port = 1; downlink.ack = true; downlinks.push(downlink); } return downlinks;
In result, I see just a downlink sent to the first eui where ID_Inter”:1980. since it should be sent to all devices.
could you help me please to solve this problem, I can’t really understand the logic of this version of node-red.
thanks in advance.
- This reply was modified 2 years, 2 months ago by SaSa.
July 21, 2022 at 4:42 am #32876 -
AuthorPosts
- You must be logged in to reply to this topic.