Hello everyone,
We recently updated our ChirpStack server from version 5.14 to 5.15 (using the JavaScript Codec for downlink encoding). Following this update, we encountered an issue where input.fPort is now undefined within the encodeDownlink(input) function.
In version 5.14, we successfully used the fPort to determine the encoding logic, like this:
function encodeDownlink(input) {
switch(input.fPort) {
case 3:
return encodePort3(input);
case 4:
return encodePort4(input);
case 10:
return encodePort10(input);
case 20:
return encodePort20(input);
default:
return {
bytes: [0, 0],
};
}
}
Observations in v5.15: After debugging the input object in the new version, we found only two fields:
variables: (Currently empty).
data: Contains the JSON object we want to encode.
The fPort field is completely missing from the input object. We could technically add the port manually inside the JSON payload, but this would require significant changes to our existing integrations and API calls.
Our questions:
Is the fPort still accessible from the encodeDownlink function in v5.15? If so, what is the new path or variable name?
Has the signature of the input object changed recently?
Is there updated documentation available for the JavaScript codec specifically for these versions?
Any guidance on how to retrieve the target fPort within the encoder without modifying the payload would be greatly appreciated.
Thank you for your help!
