But it results in no response (error or success) from the TTN stack & no live data displayed.
My downlink formatter:
function encodeDownlink(input) {
// Input is a string true or false
var states = ["false", "true"];
return {
bytes: [states.indexOf(input.data.state1)],
fPort: input.fPort,
warnings: [],
errors: []
};
}
function decodeDownlink(input) {
return {
data: {
state1: ["false", "true"][input.bytes[0]]
},
warnings: [],
errors: []
}
}
I’ve had previous success with the V2 format but no making much headway here. I note the V2 docs had a curl example but the V3 doesn’t, if I get this working I might submit a pull request to include a working example.
If you want to add the port in, it would be simplest to add it to the data object.
See the documentation, both Getting Started and Reference, linked bottom right of the console, for details, like the curl example you were looking for:
Many thanks for the reply & pointing out the location of the reference. For others I can confirm that the following works with my payload formatter as per my original post.
Your welcome - as the solution to the problem was provided by me, perhaps my response should be the solution, I did the thinking so you could CopyNPasta & test