Hi
I can be the firmware.
But also if you require an ACK from TTN.
You should change the follwing line;
uint8_t CMD_SEND_PREFIX[4] = { 0x50, 0x0C, 0x00, PORT };
// 0x50 0x08 0x00 PORT for without
0x0C -> ACK isn't supported by TTN yet, that will explain the duplicates
use 0x08 for now.
The missing items is because you are probaly almost out of range of the station.
If this isn't the case, can you please post or send me the source code? Then I can take a closer look.
Jan