Gateway showing disconnected, packets are rec'd by application

are you sure your gateway is offline?

"id":"bnn-ttn-1","clusterID":"ttn-v2-legacy-eu","updatedAt":"2023-08-02T19:48:58.143369Z","online":true
"bnn-ttn-1":{"network":"ttnv2","id":"bnn-ttn-1","online":true,"last_seen":"2023-08-02T19:57:40.088398Z"}

i don’t always believe what I read in the console, yesterday i bought a node online, i can see the new uplinks in the console (with in the last min), but the last seen message just under the node name say the node were last seen 4 hours back

Thanks for that. However, the gw console log also shows no traffic nor any gw status messages. The gateway is actually working, ie forwarding my device packets, but I just can’t see any traffic to aid fault finding on the work I’ m currently doing.

like this?

image

but a uplink occurred a min back

I know my gateway is sending uplinks. The info page shows occasional uplinks, but not from my test device, coz its turned off. I get uplinks from my test device when I power it up and I see the traffic in my app/device log but I dont get any traffic at all in the gateway console log. My gw debug output tells me it is sending status messages ok, but nothing appears in the gw console log.

It’ll wait till I setup another gw on friday.

maybe clear your cache as well, seems the console are not too reliable at the moment concerning live data

busy testing and configuring new nodes and applications, looking at live data on console, nothing, looking at the data in my application, it is there

seems like console not updating reliably

Perhaps. I’ll do that tomoz. Cheers.

Cache clearing is not a thing. I’m not experiencing any issues on my systems or any clients with the console.

If you have a “variable” internet connection it will tend to disconnect. I’m surprised that @Piet_Pillay isn’t using a web hook to capture all the traffic. :wink:

PS, found a Kickstarter gateway on the shelf, so I can do a setup if you have no joy with your substitute one from the council.

@descartes many thanks. The council have quite a few spares. Apparently. I will advise when I have setup the new gw.

I’m not aware of any flakyness re my wifi. Its KCOM 200 down and 50+ up unlimited data. Very rarely gives trouble.

no intermitting internet here, just more convenient sometimes to see the uplinks in the console, either gateway or application

use both webhooks and mqtt, data in my db available, but not until i reloaded the webpage and clear the cache that the console becomes responsive, wait you will see more report surfacing of inconsistent console

That’s generally not the pattern given the number of TTN & TTI users overall who generally report very quickly but I’ll happily leave a few machines with a few console sessions open to see what gives.

But in reverse, you should check to see if anything is different at your end.

Ok, I’m still having problems here. I was hoping adding the new gateway would be straightforward but no.

I have gotten a spare kickstarter gw from Hull City Council and added a new gateway bnn-ttn-1a in the gateway console. Created the api key with these rights :-

image

Gone through setting up the gateway (Wifi and Ethernet connected) with account server set to https://eu1.cloud.thethings.network and adding the API key but the new gateway, I am assured was working, will not activate.

Looking at the debug output from the gateway itself I can see two things:-

1 the device firmware appears to be 1.05 - even after trying to update it using an sd card using instructions from gateway/firmware at develop · TheThingsProducts/gateway · GitHub and selecting the top stable release. However, once the gateway works this should update OTA.

2 More importantly the device fails TLS negotiation ( see near the end of this debug output).


**************************
*   The Things Network   *
*      G A T E W A Y     *
**************************
Firmware name: AmazingAckermann, type: 0, version: 1.0.5, commit: fa89b993, timestamp: 1531815112
Bootloader revision: 1, commit: 7167873a, timestamp: 1496411298
Build time: Jul 17 2018 08:12:51
Reboot reason: 0x40
BOOT: (persisted info) 6F 72 72 65 01 03 90 F2 11 18 2A 63 BB F0 6F D2 




WIFI: Entering state 0
WIFI: Entering SCAN state 0

MAIN: Initialisation complete
LORA: Changing state from 0 to 0

MAIN: Leaving state 0
MAIN: Entering state 1
FLASH: Magic bytes found: wifi config present
FLASH: Magic bytes found: activation data present
FLASH: Magic bytes not found: no stored FOTA data present
FLASH: Loading Firmware Data
CNFG: (Firmware HASH (sha256)) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
FLASH: Loading WiFi Data
CNFG: WiFi SSID:      TNCAPF2219D
CNFG: WiFi key:       ***
CNFG: WiFi conn_type: 1
CNFG: WiFi sec_type:  4
FLASH: Loading Activation Data
CNFG: Gateway ID:         bnn-ttn-1a
CNFG: Gateway Key:        ***
CNFG: Account Server URL: https://account.thethingsnetwork.org/
CNFG: Locked:             false
CNFG: Locked first time:  true

MAIN: Leaving state 1
MAIN: Entering state 2
INET: State change to 0
LORA: Initialisation complete
LORA: Changing state from 0 to 1
WIFI: Entering state 1
ETH: IP Address: 0.0.0.0 
WIFI: Entering state 2
WIFI: Disabling modules
Head magic match void: trying to free an already freed block, ignore
WIFI: Entering state 3
WIFI: Enabling modules for client
WIFI: Entering state 6


>WIFI: IP Address: 0.0.0.0 
SNTP: State change from 0 to 1
INET: Gateway has Ethernet
INET: State change to 2
INET: Connected to a network, waiting for DHCP lease, checking validity with ping
CB: SNTP: State change from 1 to 2
ETH: IP Address: 192.168.1.180 
WIFI: IP Address: 192.168.1.173 
INET: State change to 3
INET: Ping probe
INET: Ping response from MRF24WN, set as default
INET: State change to 4
LORA: Wait init complete, waiting for application.
LORA: Changing state from 1 to 2
SNTP: State change from 2 to 3
SNTP: State change from 3 to 4
MON: SYS Stack size: 3959
MON: TCPIP Stack size: 3785
MON: APP Stack size: 7987
MON: LoRa Stack size: 3911
MON: heap usage: 180KB (188KB), free: 160KB
SNTP: State change from 4 to 5
SNTP: State change from 5 to 6
SNTP: State change from 6 to 7
INET: State change to 5

MAIN: Leaving state 2
MAIN: Entering state 3

CNFG: Load online user config state change to 4
HTTP: Close active socket 0
HTTP: Starting connection
HTTPS: Connection Opened: Starting TLS Negotiation
HTTP: Wait for TLS Connect
HTTP: TLS Connection Negotiation Failed - Aborting
HTTP: Close active socket 1
CONF: ERROR REQUEST

CNFG: Downloading gateway configuration failed

CNFG: Load online user config state change to 8

CNFG: Communication ERROR

The debug output, near the bottom, shows a connection was opened then TLS negotiation failed.

I have double checked the Gateway Key in the gateway activation/settings dialog is complete with no extras.

NNSXS.W4S3I4........CU3PQ

Does the TLS negotiation failed suggest an API key issue?

Any ideas on how to progress?

Many thanks for your time and patience.

No, TLS negotiation is all about the firmware talking https instead of http to the servers.

I think the first thing to do is get the firmware updated - the instructions say that you have to use 1.0.8 or above.

I was just about to add that I found the firmware is wrong for V3 at 1.05.
I have downloaded firmware.hex and checksums and made an SD card as per instructions (Power cycle with card in) but, on reboot, it always says 1.05.

I used the stable Firmware release from here:-

I assumed that was 1.09 as that’s what is in my bnn-ttn-1 gateway.

I’ll try again.

To be sure, this is the release zip:

Ironically, it references an issue with TLS …

No, it suggests the gateway doesn’t know the Root CA used for the connection. That is why 1.0.8 is the minimum required version.

@kersing thanks. I’m trying to update the gateway using sd card but that doesnt work for me.

The gateway debug messages show the sd card is mounted but the version does not change after a reboot. I followed the installation instructions and used the stable firmware.

Is that with the sdcard still inserted? Because the gateway will not transfer the image from the card to flash but instead run the firmware from the card (iirc). You need to keep the card inserted until the unit has been flashed with a newer firmware.

The instructions are not clear on that point. I’ll try again tomorrow. Cheers.

@kersing

Last night I switched the gateway off then inserted the SD Card and powered it up and left it over night - it was still stuck trying to activate this morning.

I again power cycled the gw with the SD card still inserted - same again…

When the gateway is power cycled I see led 2 flashing furiously followed by all leds lit. That I assume indicates the loading of the firmware. I’ll look through the source to see if I can find out. Then it returns to led 1, led 2 and led 3 flashing (trying to activate)

Below is the gateway debug output when I reboot with the SD card in. It shows the card has been mounted followed by loading firmware data. I am concerned the firmware hash is all 0xff’s

I have read that some gateways were problematic till the Microchip unit was re-seated. It’s not my gateway to break and I find that releasing the Microchip card is difficult anyway.

It’s likely that Hull City Council (HCC) will have problems updating their 4 or 5 unused spares, if ever they get around to handing them to willing folks like me. I’ll ask if I can get another to see if the behaviour is the same. That’ll be a couple of days if HCC agree to let me have an unused device and may pin down the cause of the failure to update.

**************************
*   The Things Network   *
*      G A T E W A Y     *
**************************
Firmware name: AmazingAckermann, type: 0, version: 1.0.5, commit: fa89b993, timestamp: 1531815112
Bootloader revision: 1, commit: 7167873a, timestamp: 1496411298
Build time: Jul 17 2018 08:12:51
Reboot reason: 0x03
BOOT: (persisted info) 6F 72 72 65 01 03 90 F6 10 38 2A 63 B3 D0 6F D3 

WIFI: Entering state 0
WIFI: Entering SCAN state 0

MAIN: Initialisation complete
LORA: Changing state from 0 to 0

MAIN: Leaving state 0
MAIN: Entering state 1
SDCARD: Mounted disk
FLASH: Magic bytes found: wifi config present
FLASH: Magic bytes found: activation data present
FLASH: Magic bytes not found: no stored FOTA data present
FLASH: Loading Firmware Data
CNFG: (Firmware HASH (sha256)) FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
FLASH: Loading WiFi Data
CNFG: WiFi SSID:      TNCAPF2219D
CNFG: WiFi key:       ***
CNFG: WiFi conn_type: 1
CNFG: WiFi sec_type:  4
FLASH: Loading Activation Data
CNFG: Gateway ID:         bnn-ttn-1a
CNFG: Gateway Key:        ***
CNFG: Account Server URL: https://eu1.cloud.thethings.network
CNFG: Locked:             false
CNFG: Locked first time:  true

My contact has another V2 TTKG at his home - I’ll pick that up later this morning. :crossed_fingers: