how to determine RX window value's to 1 ?
- This topic has 9 replies, 2 voices, and was last updated 2 years, 5 months ago by SaSa.
-
AuthorPosts
-
July 21, 2022 at 9:35 am #32880SaSaParticipant
hello all,
how I can change RX window value from 0 to 1 in a downlink message ? I tried different ways as you see in code that I attached here but it doesn’t work
screen shot :
https://i.postimg.cc/YSpCTNKB/Inked12.jpgdownlinks = []; for (var i = 0; i < msg.payload.length; i++) { downlink = {}; var pay = msg.payload[i].System_Activated; if (pay === null ) { //downlink.payload = new Buffer("00", "hex"); } else { downlink.payload = new Buffer( "21"+pay, "hex"); downlink.eui = msg.payload[i].valve_EUI; downlink.port = 2; downlink.ack = true; downlink.RxWnd = false; } downlinks.push(downlink); } return [downlinks];
July 21, 2022 at 10:02 am #32882Jason ReissKeymasterA downlink can be queued through MQTT, rx_wnd is one of the parameters.
Instead of RxWnd use rx_wnd?
July 22, 2022 at 3:18 am #32884SaSaParticipantThanks Jaosn as always. I tested rx_wnd but it didn’t change.
July 22, 2022 at 7:10 am #32885Jason ReissKeymasterDoes the lora-out node have an rx window setting?
Otherwise you can use an MQTT out node to connect to localhost:1883 and send downlinks too.
July 25, 2022 at 8:53 am #32887SaSaParticipantThanks Jason,
I check the MQTT method explained in the link but I didn’t get really how I should to adapt this node with a function node. Can I ask you please to propose me an alternative way that I could change it in function ?
July 25, 2022 at 8:57 am #32888Jason ReissKeymasterMay I ask why you need to specify RX1 in the first place?
July 26, 2022 at 4:20 am #32894SaSaParticipantYes of course. Because in a downlink sent by my function,
Rx value is 0
by default (which I try to change) and my valve doesn’t apply command. since when I sent manually exactly the same payload, port, eui, ack butRx = 1
the valve act exactly what it should.July 26, 2022 at 7:53 am #32897Jason ReissKeymasterI looked into our custome lora-out node and it does not support the rx window settings.
In the UI there is LoRaWAN > Network Settings page, see the Network Server Testing section.
Check Disable Rx2 to use only Rx1.
Otherwise MQTT or API can be used to set the rx_wnd setting, many articles of how to use MQTT and HTTP APIs are available for node-red.
Using inspect in a browser when downlink is scheduled this api is called.
https://10.17.100.141/api/lora/packets/queue
{“deveui”:”00-80-00-00-00-01-58-34″,”port”:1,”data”:”EjM=”,”ack_retries”:0,”rx_wnd”:1,”ack”:false}Hope this helps.
July 28, 2022 at 8:46 am #32902SaSaParticipantthanks Jason, I’ll try to get by with Mqtt method since I know it’s not so easy.
- This reply was modified 2 years, 5 months ago by SaSa.
July 29, 2022 at 4:07 am #32905SaSaParticipant@jason fortunately I found something which helped me to command the end-device, I’m not at all sure if it’s logic or not but it works literally and by now : `downlinks = [];
for (var i = 0; i < msg.payload.length; i++) {
downlink = {};
var pay = msg.payload[i].System_Activated;
// let rx_wnd = 1;if (pay === null ) {
//downlink.payload = new Buffer(“00”, “hex”);
} else {
downlink.payload = new Buffer( “21”+pay, “hex”);
downlink.eui = msg.payload[i].valve_EUI;
downlink.port = 2;
downlink.ack = true;
downlink.delay = 1;
}downlinks.push(downlink);
}return [downlinks];`
I think this line of code
downlink.delay = 1;
changesRX window
value to 1 -
AuthorPosts
- You must be logged in to reply to this topic.