Increasing RX WINDOW not working

Hi there

I’m having bad time trying to increase the RX Window to 5 seconds.
I’ve changed the Device Profile and set RX1 = 5.

Then I did Reactivate the device on activation tab.

NS Version 3.10.0 -> Docker image

However, I’m still getting 1 second RX1 delay.

[
    {
        "downlinkMetaData": {
            "gatewayID": "0000f80332020e73",
            "txInfo": {
                "frequency": 925700000,
                "power": 27,
                "modulation": "LORA",
                "loRaModulationInfo": {
                    "bandwidth": 500,
                    "spreadingFactor": 8,
                    "codeRate": "4/5",
                    "polarizationInversion": true
                },
                "board": 0,
                "antenna": 0,
                "timing": "DELAY",
                "delayTimingInfo": {
                    "delay": "5s"
                },
                "context": "So0sFA=="
            }
        },
        "phyPayload": {
            "mhdr": {
                "mType": "UnconfirmedDataDown",
                "major": "LoRaWANR1"
            },
            "macPayload": {
                "fhdr": {
                    "devAddr": "0023392c",
                    "fCtrl": {
                        "adr": true,
                        "adrAckReq": false,
                        "ack": false,
                        "fPending": false,
                        "classB": false
                    },
                    "fCnt": 522,
                    "fOpts": [
                        {
                            "cid": "LinkADRReq",
                            "payload": {
                                "dataRate": 0,
                                "txPower": 0,
                                "chMask": [
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true
                                ],
                                "redundancy": {
                                    "chMaskCntl": 0,
                                    "nbRep": 1
                                }
                            }
                        },
                        {
                            "cid": "RXParamSetupReq",
                            "payload": {
                                "frequency": 923300000,
                                "dlSettings": "08"
                            }
                        },
                        {
                            "cid": "RXTimingSetupReq",
                            "payload": {
                                "delay": 1
                            }
                        }
                    ]
                },
                "fPort": null,
                "frmPayload": null
            },
            "mic": "109bfc6d"
        }
    },
    {
        "uplinkMetaData": {
            "rxInfo": [
                {
                    "gatewayID": "AAD4AzICDnM=",
                    "time": null,
                    "timeSinceGPSEpoch": null,
                    "rssi": -55,
                    "loRaSNR": 12.5,
                    "channel": 4,
                    "rfChain": 1,
                    "board": 0,
                    "antenna": 0,
                    "location": {
                        "latitude": 0,
                        "longitude": 0,
                        "altitude": 0,
                        "source": "UNKNOWN",
                        "accuracy": 0
                    },
                    "fineTimestampType": "NONE",
                    "context": "So0sFA==",
                    "uplinkID": "YeQfKOGwSIStk1+HPMcoJQ==",
                    "crcStatus": "CRC_OK"
                }
            ],
            "txInfo": {
                "frequency": 916000000,
                "modulation": "LORA",
                "loRaModulationInfo": {
                    "bandwidth": 125,
                    "spreadingFactor": 8,
                    "codeRate": "4/5",
                    "polarizationInversion": false
                }
            }
        },
        "phyPayload": {
            "mhdr": {
                "mType": "UnconfirmedDataUp",
                "major": "LoRaWANR1"
            },
            "macPayload": {
                "fhdr": {
                    "devAddr": "0023392c",
                    "fCtrl": {
                        "adr": true,
                        "adrAckReq": true,
                        "ack": false,
                        "fPending": false,
                        "classB": false
                    },
                    "fCnt": 2857,
                    "fOpts": null
                },
                "fPort": 1,
                "frmPayload": [
                    {
                        "bytes": "WdqP8HnrTrzxI0A945FfUs9giaN3H1Hm"
                    }
                ]
            },
            "mic": "3f9beaf7"
        }
    }
]

I’ve also changed RX2 downlink frequency and it is not taking into account:

  • frequency:923300000 -> 0
  • dlSettings:“08” -> 0

Logs:

01/09/2020 11:17:36INFO[255003] gateway/mqtt: uplink frame received           gateway_id=0000f80332020e73 uplink_id=b769e371-9400-41ad-925d-c02a2e230d7f
01/09/2020 11:17:37INFO[255004] uplink: frame(s) collected                    ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 mtype=UnconfirmedDataUp uplink_ids="[b769e371-9400-41ad-925d-c02a2e230d7f]"
01/09/2020 11:17:37INFO[255004] sent uplink meta-data to network-controller   ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] device gateway rx-info meta-data saved        ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] device-session saved                          ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_addr=0023392c dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] finished client unary call                    ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 grpc.code=OK grpc.ctx_id=40df8eba-06a7-49e1-b319-dca885c5940c grpc.duration=15.977025ms grpc.method=HandleUplinkData grpc.service=as.ApplicationServerService span.kind=client system=grpc
01/09/2020 11:17:37INFO[255004] adr request added to mac-command queue        ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_eui=0004a30b0023392c dr=4 nb_trans=1 req_dr=0 req_nb_trans=1 req_tx_power_idx=0 tx_power=0
01/09/2020 11:17:37INFO[255004] pending mac-command block set                 cid=LinkADRReq commands=1 ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] pending mac-command block set                 cid=RXParamSetupReq commands=1 ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] pending mac-command block set                 cid=RXTimingSetupReq commands=1 ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] gateway/mqtt: publishing gateway command      command=down downlink_id=4fff6002-00bf-4c10-9c13-6825971d70f7 gateway_id=0000f80332020e73 qos=0 topic=gateway/0000f80332020e73/command/down
01/09/2020 11:17:37INFO[255004] device-session saved                          ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 dev_addr=0023392c dev_eui=0004a30b0023392c
01/09/2020 11:17:37INFO[255004] storage: downlink-frame saved                 ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7 token=20479
01/09/2020 11:17:37INFO[255004] backend/gateway: downlink tx acknowledgement received  downlink_id=4fff6002-00bf-4c10-9c13-6825971d70f7 gateway_id=0000f80332020e73
01/09/2020 11:17:37INFO[255004] sent downlink meta-data to network-controller  ctx_id=4fff6002-00bf-4c10-9c13-6825971d70f7
01/09/2020 11:17:37INFO[255004] finished unary call with code OK              ctx_id=ff3ec7af-c344-4837-b1a2-06c3b5ecd9cf grpc.code=OK grpc.method=GetDeviceActivation grpc.service=ns.NetworkServerService grpc.start_time="2020-09-01T14:17:37Z" grpc.time_ms=1.376 peer.address="10.42.217.163:45116" span.kind=server system=grpc

Is there a way to completely flush device configs ?

Any idea what’s going wrong ?

Thanks

The device-profile reflects the initial used configuration. After that, ChirpStack will try to change the state of each device to what you have configured in the chirpstack-network-server.toml configuration using mac-commands.

Ok, so you mean there is no effect changing device-profile ?
I can’t have a default 1 sec on config file and manage different situations using device-profile ?
Even if a delete the device, and recreate it using device-profile to 5 secs it doesn’t take into account.

What is the correct use ?

I’ve changed config file to 5s. Reactivated the device, still having 1s. Deleted device and recreated:

[
    {
        "downlinkMetaData": {
            "gatewayID": "0000f80332020e73",
            "txInfo": {
                "frequency": 923300000,
                "power": 27,
                "modulation": "LORA",
                "loRaModulationInfo": {
                    "bandwidth": 500,
                    "spreadingFactor": 8,
                    "codeRate": "4/5",
                    "polarizationInversion": true
                },
                "board": 0,
                "antenna": 0,
                "timing": "DELAY",
                "delayTimingInfo": {
                    "delay": "5s"
                },
                "context": "bQX4xA=="
            }
        },
        "phyPayload": {
            "mhdr": {
                "mType": "UnconfirmedDataDown",
                "major": "LoRaWANR1"
            },
            "macPayload": {
                "fhdr": {
                    "devAddr": "0023392c",
                    "fCtrl": {
                        "adr": true,
                        "adrAckReq": false,
                        "ack": false,
                        "fPending": false,
                        "classB": false
                    },
                    "fCnt": 0,
                    "fOpts": [
                        {
                            "cid": "LinkADRReq",
                            "payload": {
                                "dataRate": 0,
                                "txPower": 0,
                                "chMask": [
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true,
                                    true
                                ],
                                "redundancy": {
                                    "chMaskCntl": 0,
                                    "nbRep": 1
                                }
                            }
                        },
                        {
                            "cid": "RXParamSetupReq",
                            "payload": {
                                "frequency": 923300000,
                                "dlSettings": "08"
                            }
                        }
                    ]
                },
                "fPort": null,
                "frmPayload": null
            },
            "mic": "554cf3b8"
        }
    },
    {
        "uplinkMetaData": {
            "rxInfo": [
                {
                    "gatewayID": "AAD4AzICDnM=",
                    "time": null,
                    "timeSinceGPSEpoch": null,
                    "rssi": -55,
                    "loRaSNR": 11.2,
                    "channel": 0,
                    "rfChain": 0,
                    "board": 0,
                    "antenna": 0,
                    "location": {
                        "latitude": 0,
                        "longitude": 0,
                        "altitude": 0,
                        "source": "UNKNOWN",
                        "accuracy": 0
                    },
                    "fineTimestampType": "NONE",
                    "context": "bQX4xA==",
                    "uplinkID": "NRyKbcDoT42XfFNCST42XQ==",
                    "crcStatus": "CRC_OK"
                }
            ],
            "txInfo": {
                "frequency": 915200000,
                "modulation": "LORA",
                "loRaModulationInfo": {
                    "bandwidth": 125,
                    "spreadingFactor": 8,
                    "codeRate": "4/5",
                    "polarizationInversion": false
                }
            }
        },
        "phyPayload": {
            "mhdr": {
                "mType": "UnconfirmedDataUp",
                "major": "LoRaWANR1"
            },
            "macPayload": {
                "fhdr": {
                    "devAddr": "0023392c",
                    "fCtrl": {
                        "adr": true,
                        "adrAckReq": true,
                        "ack": false,
                        "fPending": false,
                        "classB": false
                    },
                    "fCnt": 2899,
                    "fOpts": null
                },
                "fPort": 1,
                "frmPayload": [
                    {
                        "bytes": "3q0BljgsQAbUdiLU0tuGlyqPIRsIvco0"
                    }
                ]
            },
            "mic": "1adb94da"
        }
    }
]

It looks like ChirpStack does respect your 5s delay :slight_smile:

Hi @brocaar

It doesn’t. This property lead me crazy too. I saw this and thought there must be some error in my interpretation.
But you can see the logs. There is 1 second between uplink and downlink.

Then I took the spectrometer to be sure:

You can’t see on the picture, but believe there is one second between the two waves.

I could get the 5 seconds by changing the toml file and booting the entire server.(!)

My doubt still on device-profile.
Can it be used to have devices on different rx delays on same server configuration ?
If so, what is the right procedure to use ?

Thank you

Hi @brocaar

Is it possible to get some direction on it ?
It isn’t clear the way we have to use the device-profile, after you’ve pointed that it takes only for initial configuration, my understanding get worst.

Having one NS serving many devices, may we use device-profile to manage different RX delays ?
If so, what’s is the recommendation and how it should be used ?

Thanks a lot

As ABP devices are pre-provisioned by the vendor before they enter the network, the NS initially takes the information from the device-profile in order to correctly communicate. Then, it will try to align these devices with your configuration in the chirpstack-network-server.toml configuration (using mac-commands).

Hi @brocaar

Thanks for your explanation.
It becomes clear now.

Although it does make sense, since we have the functionality (device-profile) maybe it would be nice to have the ability to use this as device configuration and let users mix devices configurations along the network.

I have some (bad) experiences where the device doesn’t take the server configuration sent by mac. I know it is a bad LoRaWAN stack implemented on HW side, but there are quite a lot the devices out there and we have no control over it or over what users is going to buy, then it becomes a platform issue.

Just pointing, if it can be a future possibility.

Thanks again

It has been requested before.

The reason for the current approach is that there are situations where the parameters entered by an end-user are illegal to use (e.g. certain frequencies). As a network-operator (assuming this is not the same user), you want to make sure that devices are compliant with local regulations. In my opinion, this should be the responsibility of the network admin (able to make modifications to the chirpstack-network-server.toml file), not the end-user.

2 Likes

Hi @brocaar

The approach isn’t wrong at all if you assume that end user is using CS app interface.
However if you assume that the implementation is through a proprietary app and talking with CS through API one can manage those rules by itself. Allowing or not changing certain parameters thus having the warranty everything is compliant.

That’s really true when you have a shared NS along with some customers.

I can show you the use case we have here in a session if you think it can help.

I would put a +1 on this demand.

Thanks