There may be a simple answer to this but, being a ChirpStack newbie I’m having trouble finding it.
I have an MCF-LW12MET power sensor which sends a payload message requesting a real time clock update at regular intervals and expects a response containing the current time.
I could handle this upstream of chirpstack by subscribing to the MQTT topic for the sensor and responding to the time requests but it would be clumsy solution because I’d have to tell the server about each new device as it was added.
know I have to do this anyway but it still feels clumsy because my upstream server currently doesn’t need to know which type of sensor it’s getting data from, that level of configuration is done in the device profile codecs.
Is there any way to queue a downlink from within a codec or any other functionality I might have missed that could achieve the same end? (Or plans to implement something perhaps?)
There is not.
However, please note that you could group all devices that are the same under a single application. Then you can either use one of the integrations or subscribe to all devices under the given application in MQTT using a wildcard. That way the end-application does not need to know about each device.
Alternatively, you could configure device tags to indicate how your end-application should handle data for each device.
Currently my host app only needs to read from devices and can be limited to just the Rx topics.
I would have a preferred not to weaken security (Even if it is only marginally) by opening up Tx as well but, maybe one day…
I’m not sure about the device implementation, but please note that if it supports the DevTimeReq mac-command, then this should already work out-of-the-box with ChirpStack In this case the time synchronization is handled by the ChirpStack Network Server an no custom logic is required.
These device does not support DevTimeReq (pity) and I solved this putting node red in between to handle MCF timesync requests.
Also note that thingsboard integration will not works “out of the box” since these devices send 2 measures in one frame (each 30min one lora frame with each 15min measures) and you need to setup timestamp of the one received by devices.