Problems with Payload format tool

Hey. I am the perfect TTN beginner and immediately in trouble

The application x
return payload decoder test fault message:
Error(“Internal error: Converter threw error:Line 27:2 Unexpected end of input”)
and the application y return same decoder function test correct

The error message does not clear even if the code is changed.
The error message is always the same:
Error(“Internal error: Converter threw error:Line 27:2 Unexpected end of input”)
Error handling raises the error from line 27: 2.
However, my code does not have when 13 lines?

This problem started when I copied and pasted a long code into the editor, executed the code, and got an error message. Although I have removed all the codes editor, changed, extended and shortened code, reset the test script is always the same error message.

Error(“Internal error: Converter threw error:Line 27:2 Unexpected end of input”)
… my Decoder function is …

function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};

// Decode bytes to int
var testShort = (bytes[1] << 8) | bytes[0];

// Decode int
decoded.short = testShort;

return decoded;
}


Does anyone have any idea how to fix or circumvent such a problem?

Thanks for the tips !

image

The error is about the Converter, not the Decoder.

So, what code is in the Converter? If you don’t need it, just click “remove converter” to see the default, which does nothing.

Converter

(Aside: Converter and Validator will not be available in V3, so for new applications I’d put everything in the Decoder instead.)


Thank you for your advice
I did as you advised and removed the converter code and now the decoder works just fine.

Thank you

1 Like