Access txInfo in the decodeUplink function

Hi

Is there a way to access to information like txInfo.modulation.lora.spreadingFactor inside of decodeUplink()?

I know that I can grab that information in the script that subscribes to the MQTT broker, but I would have to change that script to read that value and at the moment I don’t have access to the embedded running that script, I have acces to our chirpstack only. That’s why I though, I could “inject” that information in the decoded payload that is returned in decodeUplink() so that the script can generate a new sensor with the spreading factor, but it seems that there is no way to access this information from the decodeUplink() function.

On a different project running with a Milesight gateway I am able to access this information because they expose the “lora object” as LoraObject (see https://github.com/Milesight-IoT/SensorDecoders/blob/main/LoRaObject.md) which can be pretty useful. So, is this possible with chirpstack?

Thanks

This is not possible. Please note that ChirpStack implements the Payload Codec API as specified here:

Personally, I don’t think it is a good idea to expose this data to the codec. In my opinion, the codec functions should only facilitate the decoding of a byte array to sensible data.

1 Like

Thank you for the explanation.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.