Error: could not handle packet: gateway: invalid protocol version"

Hi.
I am sending upd packet with

nc -u 192.168.1.106 1700

to lora-gateway-bridge but in lora-gateway-bridge,I have this error:

Jun 24 09:29:00 ubuntu lora-gateway-bridge[2273]: time=“2018-06-24T09:29:00+04:30” level=error msg=“gateway: could not handle packet: gateway: invalid protocol version” addr=“192.168.1.105:44192” data_base64=eyJzdGF0Ijp7InRpbWUiOiIyMDE0LTAxLTEyIDA4OjU5OjI4IEdNVCIsImxhdGkiOjQ2LjI0MDAwLCJsb25nIjozLjI1MjMwLCJhbHRpIjoxNDUsInJ4bmIiOjIsInJ4b2siOjIsInJ4ZnciOjIsImFja3IiOjEwMC4wLCJkd25iIjoyLCJ0eG5iIjoyfX0K

How can I fix it?

The UDP protocol is documented here: https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT.

Make sure your UDP packet is compatible with that protocol :slight_smile:

Because I use netcat and I dont use packet forwarder, Can you make a udp packet with that protocol with this info?

Bytes Function
0 protocol version = 2
1-2 random token : for example 1234
3 PULL_DATA identifier 0x02
4-11 Gateway unique identifier (MAC address): for example : 00:0c:29:19:b2:37

Please take a look at the LoRa Gateway Bridge test-code: https://github.com/brocaar/lora-gateway-bridge/blob/master/internal/gateway/backend_test.go.

It contains code that handles the UDP <> Go struct code. You can use that as an example to generate UDP packets that are compatible with the packet-forwarder PROTOCOL.txt :slight_smile: You don’t have to use the packet-forwarder, but you do have to use the same protocol :slight_smile:

Does the protocol version prepend to the message?

The full protocol is fully documented in the PROTOCOL.txt document, linked in one of my previous posts.