how to determine RX window value's to 1 ?

Home Forums General how to determine RX window value's to 1 ?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #32880
    SaSa
    Participant

    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.jpg

    downlinks = [];
    
    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];
    #32882
    Jason Reiss
    Keymaster

    A downlink can be queued through MQTT, rx_wnd is one of the parameters.

    Instead of RxWnd use rx_wnd?

    #32884
    SaSa
    Participant

    Thanks Jaosn as always. I tested rx_wnd but it didn’t change.

    #32885
    Jason Reiss
    Keymaster

    Does 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.

    https://www.multitech.net/developer/software/lora/lora-network-server/mqtt-messages/

    #32887
    SaSa
    Participant

    Thanks 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 ?

    #32888
    Jason Reiss
    Keymaster

    May I ask why you need to specify RX1 in the first place?

    #32894
    SaSa
    Participant

    Yes 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 but Rx = 1 the valve act exactly what it should.

    • This reply was modified 1 year, 9 months ago by SaSa.
    • This reply was modified 1 year, 9 months ago by SaSa.
    #32897
    Jason Reiss
    Keymaster

    I 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.

    #32902
    SaSa
    Participant

    thanks Jason, I’ll try to get by with Mqtt method since I know it’s not so easy.

    • This reply was modified 1 year, 9 months ago by SaSa.
    #32905
    SaSa
    Participant

    @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; changes RX window value to 1

    • This reply was modified 1 year, 9 months ago by SaSa.
    • This reply was modified 1 year, 9 months ago by SaSa.
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.