Single Channel Gateway part 3


(Fmeylink) #85

Got a singe channel gatway based on the lorago dock up and running.
wanted to use the internal sensors to display some data.
got not get that working :frowning_face:
The is data send to ttn i see payload dont know what to do with it and dont know what it is,

anybody got some experience with that ?


(Ud Lo Ra) #86

Since some day, my ESp8266+RFM95, previously working well, no more connects to my WiFi. I am getting mad because nothing changed. Furthermore, it connects to the hotspot of my iPhone if enabled (and configured). But home wifi, nothing, either from WiFiManager and by setting it in wpa[]. Any hint? Thanks.

A WlanStatus:: DISCONNECTED, IP=0.0.0.0

(by the way: I get better SNR with ESP8266+RFM95 than with Heltec Lora32…).


(Sandgroper) #87

Did you power cycle the router?


(Ud Lo Ra) #88

Yes, in fact in the last days I had some instability on the ADSL line, so I had to switch off a couple of times, and I also found a post elsewhere that mentions some vaguely similar issue. However, phones, tablets and computer at home connect without issues now. The final post about 5GHz seems not valid for me, since the router is a somewhat old D-Link DSL 2640b, 2.4GHz only.
I can add some info: I tried to reformat SPIFF (by setting _SPIFF_FORMAT 1), and when reformatting, it apparently connects to WiFi. But then resets automatically and if I set back to _SPIFF_FORMAT 0 , everything is as before.

Of course this is not a TTN related issue, but I mention this for other singlechannelers (and I will mention the solution, if any).


(Sandgroper) #89

I have seen exactly this behaviour with the ESP8266+RFM95 in my case it is a Netgear router. I did not find the root cause but resetting the router enabled the ESP8266 to reconnect. I do have a couple of theories which are related to DHCP. When a client, such as the ESP8266 acquires a DHCP request, it actually proposes its previous (or current) IP address in the DHCP request. In theory, if a router has that address available, it should return that address in the response. If however the address has already been leased to another end point the router will respond with a new address. When an end point receives a DHCP address from the router, it is then supposed to do a reverse ARP using that address and listening for any reply. If the end point receives a reply to the reverse ARP, meaning another device is already using the address, it is supposed to reject the address and restart the DHCP address request.

I suspect it is the corner cases that the ESP8266 is getting hung up on, which could be not accepting the alternative address, failing on the reverse ARP and requesting again the same address, or simply failing to continue the DHCP process when it does not have a valid DHCP address.


(Ud Lo Ra) #90

Thanks - I was leaning towards something similar, though not so clear and precise. I had a DHCP address reserved for the gateway, to simplify access through the web interface; after the first times, I changed it to another address, thinking at it remaining busy, and lately simply removed the reservation, but nothing helped. By the way, I have also a long lease time that may give further complexity.

On the ESP8266 side, I expected that formatting SPIFF and reloading the sw would refresh everything, but maybe it is not. Now I could try to totally reset the router and see (not sure how it is different from switching off, but in this precise computer science we are used to these black magic rituals :slight_smile: ).


(Ud Lo Ra) #91

Update: the router reset did not help. However, in a IDE menu I never looked with attention I found a way to erase flash contents (Tools/Erase Flash), and this seemed to help, although at first it seemed not. In particular, after erasing, the node was still not able to directly connect to the network specified in the wpa[] array, but was indeed able through WiFiManager (fair enough for me). I tried WiFiManager only after Erase all flash content, but it could function also after Erase Sketch + WiFi settings (I saw it was not connecting directly, so I went for erasing all).
This will not help in future events: the gateway was under the roof, and ideally I would avoid solutions where you have to physically access it. I will try to use an ESP32 + external LoRa chip (not a complete platform, since the Heltec I have seems less sensible than Esp8266 + RFM95).


(Mid Walesha) #92

Learnt the hard way with a single channel gateway! Pain in the ass as the nodes rotate their frequency = missing data


(Somsak) #93

You can use you mobile phone to share wifi hot spot. Test your ESP8266 with mobile hotspot.

We use Dlink pocket wifi to provide Internet Access for my Single gateway.
My gateway is running on battery and Solar power.
It is working 7/24 for several month now.

Somsak


(Ud Lo Ra) #94

@mid-walesha: I know, the issue here was different.
@Somsak: as I also wrote in the first post, I did test it with the hotspot and was running. The issue was with the specific network to which I wanted it to connect, and at the end I solved by erasing flash (likely something remained set too permanently).
From time to time the gw disappears, likely loosing connection due to distance from wifi AP, but it seems able to recover.
I may also add that I have also an ESP32 in the same setting that never lost connection (although with worst Lora performance).
In my mailbox today there were a Wemos and a pure ESP32 platform (no LoRa), I will try with these too to find a reliable and efficient combination.


(Sandgroper) #95

The nodes will only rotate their frequency if that is how you have setup the nodes. The problem is not only related to single channel gateways. What if you have nodes that are configured to operate with a 16 channel gateway, such as a Cisco gateway, but the only gateways in range of the nodes support 1, 2, 4, or 8 channels? Messages will be lost.

You could say, what if as part of the initial registration process, the node is told the number of channels supported by the gateway that is forwarding the registration replies from the LoRa Server to the node? The challenge is that such a mechanism only works if the specific gateway does not fail. If the gateway fails and the other gateways in range of the node do not support the channels used by the node, then messages will be lost.


(Mid Walesha) #96

I believe in the UK setting a node to a static frequency is technically illegal. All the commercial nodes we have prevent this. But I understand for home experiments the cost savings etc. All multi-channel gateways on TTN should follow their rules configuration wise - 8 channels / correct frequency. The nodes we use allow switching from 16 to 8 channels. I just ensure everything complies with the TTN rules.


(Qsk) #97

Hi , I use TTGO Lora32 V1 board and things4u ESP-1ch-Gateway-v5.0 sofware.
First problem in compiling: WARNING: library ESP32WebServer claims to run on (ESP32) architecture(s) and may be incompatible with your current board which runs on (esp32) architecture(s).
After compiling cannot acces webserver.
Here is serial monitor:
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310
ESP32 defined, freq=868100000 EU868
ARDUINO_ARCH_ESP32 defined
SPIFFS init success
Assert=Do Asserts
debug=1
readConfig:: Starting
.SSID= qsk
.PASS= silneheslo
.CH= 0
.SF= 7
.FCNT= 0
.DEBUG= 1
.PDEBUG=64
.CAD=1
.HOP=0
.NODE= 0
.BOOTS= 3
.RESETS= 0
.WIFIS= 3
.VIEWS= 0
.REFR= 0
.REENTS= 0
.NTPETIM= 0
.NTPERR= 0
.NTPS= 0
.FILEREC= 0
.FILENO= 0
.FILENUM= 0
.EXPERT= 0

MAC: 3c:71:bf:88:b3:58, len=17
WlanConnect:: Init para 0
0:1:2. WiFi connect SSID=qsk, pass=
A WlanStatus:: CONNECTED to qsk
Host esp32-88b358 WiFi Connected to qsk on IP=192.168.86.21
Local UDP port=1700
Connection successful
Gateway ID: 3C71BXXXX88B358, Listening at SF7 on 868.10 Mhz.
setupOta:: Started
Ready
IP address: 192.168.86.21

Gateway cannot connect to ttn.

What is wrong? Thanks.