The Things Gateway, setup problems

Hi all,
I have a Things Gateway that I’d like to setup on our school. Once I get this working, it’ll be the 8th node in Oslo, Norway. I’ve used the gateway on a couple occasions, using wifi to connect it to the network. This has worked great. To make the installation permanent, I wanted to get it hooked up to the cabled network. I changed the settings in the router and plugged it in. Led 1 goes blue, 2 and 3 also and then - blip - one blink on led 4 and the process restarts (see video https://www.youtube.com/watch?v=KZckGsdOZXk).

From the documentation for LED-status, it looks like the router has connected to the web using a standard port and that it’s activated, but the second it tries to connect to the server, it fails just as it’s supposed to connect to the server. Could it be that our network blocks the traffic, so it restarts since it can’t get through?

It seems to be a bit under-documented what ports the gateway requires, but from other forum posts it seems that port 1700 is used. We’ve checked traffic on this port and there’s nothing trying to use it. Is there any documentation that explains what ports should be opened in a network router for TTN to work?

I tried debugging using Adafruit’s TTL to USB adapter, but I got nothing on the RX-port. Does the serial adapter have to be 3.3V?

Any help much appreciated!

I guess a simple test would be: try with another ethernet network?

Was the WiFi also on the school network?

I’m using 3.3 volt indeed (but that’s just as my Raspberry Pi’s UART is 3.3 volt). Note that the labels on the gateway’s PCB are weird; RX should read TX, and the other way around, I feel. But the FAQ on the forum and in the documentation include images.

Not for this gateway. It’s using MQTT, and the UART log below shows a reference to a server port 8882. The default port for TLS-enabled MQTT would be 8883, and search results on this forum indeed show that port for older logs; maybe it might use that again, some day? (This might be related to the gateways being bridged to V3 since quite recently?) And maybe different regions use different ports too?

Also, it’s using HTTPS, on the default port 443.

All initiated from the gateway; no incoming port mapping needed:

CNFG: Account Server URL: https://account.thethingsnetwork.org
...
CONF: ROUTER URL: mqtts://bridge.eu.thethings.network:8882
...
FREQ: APP_URL_Buffer: https://account.thethingsnetwork.org/api/v2/frequency-plans/EU_863_870
Click to show full boot log
[2020-02-09T12:19:37.802Z] MAIN: Rebooting gateway for firmware update check
[2020-02-09T12:19:43.328Z] MON: SYS Stack size: 2837
[2020-02-09T12:19:43.330Z] MON: TCPIP Stack size: 3763
[2020-02-09T12:19:43.333Z] MON: APP Stack size: 3292
[2020-02-09T12:19:43.335Z] MON: LoRa Stack size: 3877
[2020-02-09T12:19:43.338Z] MON: heap usage: 283KB (288KB), free: 55KB
[2020-02-09T12:19:46.664Z] SNTP: State change from 0 to 0
[2020-02-09T12:19:46.668Z] SNTP: State change from 0 to 0
[2020-02-09T12:19:46.671Z] 
[2020-02-09T12:19:46.673Z] 
[2020-02-09T12:19:46.674Z] 
[2020-02-09T12:19:46.680Z] **************************
[2020-02-09T12:19:46.682Z] *   The Things Network   *
[2020-02-09T12:19:46.685Z] *      G A T E W A Y     *
[2020-02-09T12:19:46.689Z] **************************
[2020-02-09T12:19:46.692Z] Firmware name: AmazingAckermann, type: 0, version: 1.0.8, commit: 846da98b, timestamp: 1574945235
[2020-02-09T12:19:46.714Z] Bootloader revision: 1, commit: 7167873a, timestamp: 1496411298
[2020-02-09T12:19:46.717Z] Build time: Nov 28 2019 12:48:18
[2020-02-09T12:19:46.719Z] Reboot reason: 0x10
[2020-02-09T12:19:46.746Z] BOOT: (persisted info) 6F 72 72 65 01 10 AB 2C E7 17 05 C9 92 3A 50 B5 
[2020-02-09T12:19:46.749Z] 
[2020-02-09T12:19:46.751Z] 
[2020-02-09T12:19:46.752Z] 
[2020-02-09T12:19:46.753Z] 
[2020-02-09T12:19:46.755Z] WIFI: Entering state 0
[2020-02-09T12:19:46.757Z] WIFI: Entering SCAN state 0
[2020-02-09T12:19:46.760Z] 
[2020-02-09T12:19:46.761Z] MAIN: Initialisation complete
[2020-02-09T12:19:46.763Z] LORA: Changing state from 0 to 0
[2020-02-09T12:19:46.911Z] 
[2020-02-09T12:19:46.914Z] MAIN: Leaving state 0
[2020-02-09T12:19:46.917Z] MAIN: Entering state 1
[2020-02-09T12:19:46.923Z] FLASH: Magic bytes found: wifi config present
[2020-02-09T12:19:46.928Z] FLASH: Magic bytes found: activation data present
[2020-02-09T12:19:46.932Z] FLASH: Magic bytes found: FOTA data present
[2020-02-09T12:19:46.936Z] FLASH: Loading Firmware Data
[2020-02-09T12:19:46.950Z] CNFG: (Firmware HASH (sha256)) F7 4B 6E FA 9E 91 AE E4 2C 62 8E D2 50 1B 43 3C C0 69 36 41 AA 52 86 F7 67 0F 44 7A 6E FD 25 F2 
[2020-02-09T12:19:46.953Z] FLASH: Loading WiFi Data
[2020-02-09T12:19:46.957Z] CNFG: WiFi SSID:      <redacted>
[2020-02-09T12:19:46.960Z] CNFG: WiFi key:       ***
[2020-02-09T12:19:46.962Z] CNFG: WiFi conn_type: 1
[2020-02-09T12:19:46.966Z] CNFG: WiFi sec_type:  4
[2020-02-09T12:19:46.969Z] FLASH: Loading Activation Data
[2020-02-09T12:19:46.972Z] CNFG: Gateway ID:         arjanvanb-gw-1
[2020-02-09T12:19:46.975Z] CNFG: Gateway Key:        ***
[2020-02-09T12:19:46.978Z] CNFG: Account Server URL: https://account.thethingsnetwork.org
[2020-02-09T12:19:46.982Z] CNFG: Locked:             true
[2020-02-09T12:19:46.984Z] CNFG: Locked first time:  false
[2020-02-09T12:19:46.987Z] 
[2020-02-09T12:19:46.990Z] MAIN: Leaving state 1
[2020-02-09T12:19:46.992Z] MAIN: Entering state 2
[2020-02-09T12:19:46.994Z] INET: State change to 0
[2020-02-09T12:19:47.288Z] LORA: Initialisation complete
[2020-02-09T12:19:47.292Z] LORA: Changing state from 0 to 1
[2020-02-09T12:19:47.538Z] WIFI: Entering state 1
[2020-02-09T12:19:47.542Z] ETH: IP Address: 0.0.0.0 
[2020-02-09T12:19:47.546Z] WIFI: Entering state 2
[2020-02-09T12:19:47.550Z] WIFI: Disabling modules
[2020-02-09T12:19:47.553Z] Head magic match void: trying to free an already freed block, ignore
[2020-02-09T12:19:47.556Z] WIFI: Entering state 3
[2020-02-09T12:19:48.419Z] WIFI: Enabling modules for client
[2020-02-09T12:19:48.422Z] WIFI: Entering state 6
[2020-02-09T12:19:48.425Z] 
[2020-02-09T12:19:48.426Z] 
[2020-02-09T12:19:48.429Z] >WIFI: IP Address: 0.0.0.0 
[2020-02-09T12:19:48.634Z] SNTP: State change from 0 to 1
[2020-02-09T12:19:48.820Z] INET: Gateway has Ethernet
[2020-02-09T12:19:48.823Z] INET: State change to 2
[2020-02-09T12:19:48.828Z] INET: Connected to a network, waiting for DHCP lease, checking validity with ping
[2020-02-09T12:19:49.734Z] CB: SNTP: State change from 1 to 2
[2020-02-09T12:19:51.735Z] ETH: IP Address: 192.168.0.12 
[2020-02-09T12:19:53.735Z] WIFI: IP Address: 192.168.178.53 
[2020-02-09T12:19:53.826Z] INET: State change to 3
[2020-02-09T12:19:53.829Z] INET: Ping probe
[2020-02-09T12:19:53.840Z] INET: Ping response from PIC32INT, set as default
[2020-02-09T12:19:53.843Z] INET: State change to 4
[2020-02-09T12:19:54.298Z] LORA: Wait init complete, waiting for application.
[2020-02-09T12:19:54.302Z] LORA: Changing state from 1 to 2
[2020-02-09T12:19:55.234Z] SNTP: State change from 2 to 3
[2020-02-09T12:19:56.335Z] SNTP: State change from 3 to 4
[2020-02-09T12:19:56.675Z] MON: SYS Stack size: 3959
[2020-02-09T12:19:56.677Z] MON: TCPIP Stack size: 3815
[2020-02-09T12:19:56.679Z] MON: APP Stack size: 7987
[2020-02-09T12:19:56.682Z] MON: LoRa Stack size: 3909
[2020-02-09T12:19:56.686Z] MON: heap usage: 180KB (188KB), free: 160KB
[2020-02-09T12:19:57.436Z] SNTP: State change from 4 to 5
[2020-02-09T12:19:57.447Z] SNTP: State change from 5 to 6
[2020-02-09T12:19:57.450Z] SNTP: State change from 6 to 7
[2020-02-09T12:19:57.453Z] INET: State change to 5
[2020-02-09T12:19:57.455Z] 
[2020-02-09T12:19:57.457Z] MAIN: Leaving state 2
[2020-02-09T12:19:57.459Z] MAIN: Entering state 3
[2020-02-09T12:19:57.461Z] 
[2020-02-09T12:19:57.463Z] CNFG: Load online user config state change to 4
[2020-02-09T12:19:57.466Z] HTTP: Close active socket 0
[2020-02-09T12:19:57.469Z] HTTP: Starting connection
[2020-02-09T12:19:57.477Z] HTTPS: Connection Opened: Starting TLS Negotiation
[2020-02-09T12:19:57.480Z] HTTP: Wait for TLS Connect
[2020-02-09T12:19:57.940Z] HTTP: TLS Connection Opened: Starting Clear Text Communication
[2020-02-09T12:19:57.967Z] HTTP: Got 1511 bytes
[2020-02-09T12:19:59.970Z] HTTP: Connection Closed
[2020-02-09T12:19:59.973Z] HTTP: Close active socket 1
[2020-02-09T12:19:59.977Z] CONF: Parsing response token: HTTP/1.1 200 OK
[2020-02-09T12:19:59.982Z] CONF: ROUTER URL: mqtts://bridge.eu.thethings.network:8882
[2020-02-09T12:19:59.985Z] 
[2020-02-09T12:19:59.987Z] CNFG: Load online user config state change to 6
[2020-02-09T12:20:01.983Z] FREQ: APP_URL_Buffer: https://account.thethingsnetwork.org/api/v2/frequency-plans/EU_863_870
[2020-02-09T12:20:01.987Z] HTTP: Starting connection
[2020-02-09T12:20:01.996Z] HTTPS: Connection Opened: Starting TLS Negotiation
[2020-02-09T12:20:01.999Z] HTTP: Wait for TLS Connect
[2020-02-09T12:20:02.513Z] HTTP: TLS Connection Opened: Starting Clear Text Communication
[2020-02-09T12:20:02.550Z] HTTP: Got 1266 bytes
[2020-02-09T12:20:04.552Z] HTTP: Connection Closed
[2020-02-09T12:20:04.555Z] HTTP: Close active socket 1
[2020-02-09T12:20:04.557Z] 
[2020-02-09T12:20:04.560Z] CNFG: Load online user config state change to 7
[2020-02-09T12:20:04.562Z] 
[2020-02-09T12:20:04.565Z] CNFG: Configuring LoRa module
[2020-02-09T12:20:04.567Z] LORA: Changing state from 2 to 3
[2020-02-09T12:20:04.573Z] LORA: Starting reconfiguration
[2020-02-09T12:20:04.578Z] LGMD:Answer, cmd: 0x31, size: 1
[2020-02-09T12:20:04.580Z] <0x00>LGMD:Answer, cmd: 0x31, size: 1
[2020-02-09T12:20:04.683Z] LGMD:Command, cmd: 0x3A, size: 0
[2020-02-09T12:20:04.687Z] LGMD:Answer, cmd: 0x3A, size: 16
[2020-02-09T12:20:04.691Z] Version, hwrev: 1, major: 1, minor: 4, band: 1
[2020-02-09T12:20:04.694Z] Serial: 4C-47-38-35-30-31-36-30-31-37-38-32
[2020-02-09T12:20:04.811Z] LGMD:Command, cmd: 0x34, sie: 1
[2020-02-09T12:20:04.814Z] <0x00>LGMD:Answer, cmd: 0x34, size: 1
[2020-02-09T12:20:04.938Z] LGMD:Command, cmd: 0x34, sie: 1
[2020-02-09T12:20:04.941Z] <0x00>LGMD:Answer, cmd: 0x34, size: 1
[2020-02-09T12:20:05.064Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.068Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.191Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.194Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.317Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.320Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.443Z] LGMD:Command, cmd: 0x35, size: 7
[2020-02-09T12:20:05.450Z] LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.575Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.578Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.701Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.705Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.828Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.831Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:05.954Z] LGMD:Command, cmd: 0x35, sie: 1
[2020-02-09T12:20:05.958Z] <0x00>LGMD:Answer, cmd: 0x35, size: 1
[2020-02-09T12:20:06.081Z] LGMD:Command, cmd: 0x36, sie: 1
[2020-02-09T12:20:06.084Z] <0x00>LGMD:Answer, cmd: 0x36, size: 1
[2020-02-09T12:20:06.212Z] LGMD:Command, cmd: 0x37, sie: 1
[2020-02-09T12:20:06.215Z] <0x00>
[2020-02-09T12:20:06.217Z] LGMD:Answer, cmd: 0x37, size: 1
[2020-02-09T12:20:06.333Z] LGMD:Command, cmd:0x40, size: 1
[2020-02-09T12:20:06.337Z] <0x00>LGMD:Answer, cmd: 0x40, size: 1
[2020-02-09T12:20:06.460Z] LGMD:Command, cmd:0x31, size: 1
[2020-02-09T12:20:06.464Z] <0x00>LGMD:Answer, cmd: 0x31, size: 1
[2020-02-09T12:20:06.586Z] LGMD:Command, cmd: 0x30, size: 0
[2020-02-09T12:20:06.690Z] MON: SYS Stack size: 2833
[2020-02-09T12:20:06.691Z] MON: TCPIP Stack size: 3806
[2020-02-09T12:20:06.694Z] MON: APP Stack size: 3292
[2020-02-09T12:20:06.696Z] MON: LoRa Stack size: 3861
[2020-02-09T12:20:06.699Z] MON: heap usage: 189KB (274KB), free: 150KB
[2020-02-09T12:20:07.838Z] LGMD:Timeout on cmd: 0x30
[2020-02-09T12:20:07.842Z] LORA: configLora OK
[2020-02-09T12:20:07.845Z] LORA: Configuration succeeded
[2020-02-09T12:20:07.853Z] LORA: Starting operation
[2020-02-09T12:20:07.855Z] LORA: Changing state from 3 to 4
[2020-02-09T12:20:12.579Z] LGMD:Receiving unknown data
[2020-02-09T12:20:14.846Z] LORA: Changing state from 4 to 5
[2020-02-09T12:20:14.848Z] 
[2020-02-09T12:20:14.851Z] CNFG: Load online user config state change to 9
[2020-02-09T12:20:14.852Z] 
[2020-02-09T12:20:14.854Z] MAIN: Leaving state 3
[2020-02-09T12:20:14.857Z] MAIN: Entering state 4
[2020-02-09T12:20:14.859Z] FLASH: Loading FOTA Data
[2020-02-09T12:20:14.862Z] FIRM: Requesting key ...
[2020-02-09T12:20:14.877Z] HTTP: Starting connection
[2020-02-09T12:20:14.891Z] HTTPS: Connection Opened: Starting TLS Negotiation
[2020-02-09T12:20:14.894Z] HTTP: Wait for TLS Connect
[2020-02-09T12:20:15.456Z] HTTP: TLS Connection Opened: Starting Clear Text Communication
[2020-02-09T12:20:15.533Z] HTTP: Got 515 bytes
[2020-02-09T12:20:16.698Z] MON: SYS Stack size: 2833
[2020-02-09T12:20:16.700Z] MON: TCPIP Stack size: 3806
[2020-02-09T12:20:16.703Z] MON: APP Stack size: 3292
[2020-02-09T12:20:16.705Z] MON: LoRa Stack size: 3861
[2020-02-09T12:20:16.709Z] MON: heap usage: 274KB (280KB), free: 63KB
[2020-02-09T12:20:17.537Z] HTTP: Connection Closed
[2020-02-09T12:20:17.539Z] HTTP: Close active socket 1
[2020-02-09T12:20:17.542Z] FIRM: Starting download
[2020-02-09T12:20:17.545Z] FIRM: available bytes: 79
[2020-02-09T12:20:17.554Z] FIRM: (Downloaded FOTA key) F7 4B 6E FA 9E 91 AE E4 2C 62 8E D2 50 1B 43 3C C0 69 36 41 AA 52 86 F7 67 0F 44 7A 6E FD 25 F2 
[2020-02-09T12:20:17.565Z] FIRM: (Stored FOTA key) F7 4B 6E FA 9E 91 AE E4 2C 62 8E D2 50 1B 43 3C C0 69 36 41 AA 52 86 F7 67 0F 44 7A 6E FD 25 F2 
[2020-02-09T12:20:17.568Z] FIRM: Firmware is already downloaded
[2020-02-09T12:20:17.571Z] MAIN: No new firmware available
[2020-02-09T12:20:17.572Z] 
[2020-02-09T12:20:17.574Z] MAIN: Leaving state 4
[2020-02-09T12:20:17.575Z] MAIN: Entering state 5
[2020-02-09T12:20:17.578Z] MQTT: GOT IP: 52.169.76.203
[2020-02-09T12:20:17.580Z] Connecting to: 52.169.76.203
[2020-02-09T12:20:18.557Z] MQTT: Opening socket timed out, restarting
[2020-02-09T12:20:18.560Z] MQTT: GOT IP: 52.169.76.203
[2020-02-09T12:20:18.563Z] Connecting to: 52.169.76.203
[2020-02-09T12:20:18.587Z] MQTT: Connection Opened: Starting TLS Negotiation
[2020-02-09T12:20:18.589Z] MQTT: Wait for SSL Connect
[2020-02-09T12:20:19.239Z] MQTT: TLS ready: Connect MQTT
[2020-02-09T12:20:19.338Z] RQMQTT: Connected
[2020-02-09T12:20:19.343Z] 
[2020-02-09T12:20:19.347Z] *************************
[2020-02-09T12:20:19.349Z] MAIN: Gateway bridging
[2020-02-09T12:20:19.354Z] *************************
[2020-02-09T12:20:19.356Z] 
[2020-02-09T12:20:19.367Z] MQTT: Sending status packet
[2020-02-09T12:20:19.369Z] MQTT: Report reboot error: 0110
[2020-02-09T12:20:19.375Z] MQTT: Sending status succeeded: 0
1 Like

Great! Lots of good info in that reply! II’ll drop by the school to pick up the router in a few days and continue from there. I have 4 or 5 serial adapters at home, so one of them have to work :wink:

So, was the WiFi on the school network too? Then the same network limitations might apply?

If the WiFi was not at school, then I’d guess that indeed the school network blocks “weird” ports such as 8882 (which you would not run into at home). In that case it would be great if they could open up a lot of ports, as apparently TTN can change the used ports when they change the remote configuration…

As long as you don’t connect the TX part, I’d assume that 5 volts would not harm anything. But if you do, it might brake…? For RX, I’d assume that a 5 volt serial adapter might still show some output.