helium/gateway-rs

listen_addr is ignored

Closed this issue · 2 comments

arha commented

My LoRa hardware has its own UDP packet forwarder. It works with IoT nodes and TTN on its own, so the RF and UDP layers should be fine.

But for some reason, in settings.toml, listen_addr is completely ignored.

With the default setting, listen_addr = "127.0.0.1:1680" on startup it shows
Jul 23 05:25:13.331 INFO starting, listen: 127.0.0.1:1680, module: gateway

Altering the ip, to say, bind on all interfaces, listen_addr = "0.0.0.0:1680"
Jul 23 05:26:41.837 INFO starting, listen: 127.0.0.1:1680, module: gateway

or even altering the port to say 4321
Jul 23 05:28:13.192 INFO starting, listen: 127.0.0.1:1680, module: gateway

This behaviour is also confirmed via netstat, no matter what I set in the config file, it always seems to bind to the localhost interface

# netstat -alpn | grep 1680
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 127.0.0.1:1680          0.0.0.0:*                           3844763/helium_gate

Since my packet forwarder is networked, I can't receive any packets.

A cursory test with the gateway stopped confirms data nc -l -u -p 1680 spews UDP frames in my console. Going down the rabbit hole, I copy some of those frames, start the gateway and echo 'frames' | nc -u 127.0.0.1 1680' works wonders. The debug logs for the gateway start showing me logs for radio frames:

ignoring semtech udp parsing error invalid GWMP version, raw bytes [...], module: gateway

With listen_addr = "0.0.0.0:1680", as soon as I do echo 'frames' | nc -u 192.168.... 1680' I get Ncat: Connection refused.

arha commented

Fixed it right after opening the issue - for the latest x86 release, helium-gateway-v1.0.0-alpha.28-x86_64.deb . Leaving it here for the future.

deb://CONTENTS/etc/helium_gateway/settings.toml has a setting called listen_addr, but in default.toml the setting is called listen.

Right you overrode listen address in your custom settings.toml. This was a breaking change made in alpha.19. Sorry you never noticed.