Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot when node can not connect to AP #2338

Closed
melwinek opened this issue Feb 19, 2019 · 13 comments · Fixed by #2559
Closed

Reboot when node can not connect to AP #2338

melwinek opened this issue Feb 19, 2019 · 13 comments · Fixed by #2559
Labels
Type: Question Question about how something works with concrete answers

Comments

@melwinek
Copy link

In one room I have a weak wifi coverage.
Is there any function in the code that triggers a reset on connection problems?

@TD-er
Copy link
Member

TD-er commented Feb 19, 2019

In the advanced settings you can change a few things.

For example you may set the WiFi to B/G mode, which will make the connection more stable when you have poor wifi reception.
Also there is this option:

  • Connection Failure Threshold

This allows to perform a reboot after the set number of failed connection attempts. (default 0 = disable this feature)

@TD-er TD-er added the Type: Question Question about how something works with concrete answers label Feb 19, 2019
@melwinek
Copy link
Author

melwinek commented Feb 19, 2019

Connection Failure Threshold is set to 0.
Since I uploaded mega-20190216 I have reboot every few minutes.
Uploading ESPEasy_mega-20190106, which previously worked well does not help.
B / G also does not help.
I temporarily connected the repeater.
I think only clearing the flash will help.
...
When RSSI is -50 and not -82 there are no resets.

@TD-er
Copy link
Member

TD-er commented Feb 19, 2019

What core version do you use?
core 2.5.0 beta (and 2.6.0 alpha) are known to have some issues with wifi, or at least more than core 2.4.2

Also if possible, you can also try to rotate the ESP to maybe improve WiFi reception.
The antenna used on the ESP has quite a strong orientation preference.
On top of that, it matters if the orientation of the antenna in the access point matches that of the ESP.

For the PCB trace antenna, it is mainly sensitive in the direction where the trace points to. (starting at the 2 lines next to eachother)
For the "chip antenna" (rectangular ceramic antenna), it is mainly sensitive in a 'donut shape' around the antenna. So the antenna bar is like the center axis of the 'donut'.

Also reception may improve when not positioned on the ground and try to move a bit away from metal.

@melwinek
Copy link
Author

melwinek commented Feb 19, 2019

img_20180329_220536
I use 2.4.2. My esp is in junction box glued to plexiglass

@TD-er
Copy link
Member

TD-er commented Feb 19, 2019

Well, after trying to rotate your house and settling with the neighbors, you can always try the wifi extender ;)

@melwinek
Copy link
Author

:) But it's bad that if you lose WIFI coverage, the node resets. It should normally work offline from time to time trying to connect to WIFI.

@jimmys01
Copy link
Contributor

This rule will reboot the ESP after 2 minutes that the MQTT is not reachable.

On System#Boot do
timerSet,2,120
endon

On MQTT#Connected do
timerSet,2,0
endon

On MQTT#Disconnected do
timerSet,2,120
endon

On Rules#Timer=2 do
Reboot
endon

@melwinek
Copy link
Author

melwinek commented Feb 20, 2019

@TD-er
I do not understand anything.
After cleaning and re-uploading, the mega-20190216 works like a charm.
RSSI: -85 dB
Uptime: 0 days 15 hours 23 minutes
Connected: 7 m 35 s
Last Disconnect Reason: (200) Beacon timeout
Number reconnects: 54
Yesterday, with so many disconnections, it would restart every moment.
What is going on?

Maybe something can be done to make the whole flash clean with OTA flash?

@TD-er
Copy link
Member

TD-er commented Feb 20, 2019

Sometimes I get the impression some left-over settings which are out of our reach, may affect wifi performance.
And the node I have mounted in my car (so rather flaky WiFi to say the least) has an uptime of over 4 days, so bad wifi is no guarantee for crashes.

Unit: 118
Local Time: 2019-02-20 19:11:51
Uptime: 4 days 3 hours 47 minutes
Load: 60.10% (LC=975)
Free Mem: 6384 (2192 - duringDataTX)
Free Stack: 3616 (1088 - LoadTaskSettings)
Boot: Manual reboot (5)
Reset Reason: Hardware Watchdog
Wifi: 802.11G (RSSI -84 dB)
IP config: DHCP
IP / subnet: 192.168.1.118 / 255.255.255.0
GW: 192.168.1.1
Client IP: 192.168.1.70
DNS: 192.168.1.1 / (IP unset)
Allowed IP Range: 192.168.1.0 - 192.168.1.255
STA MAC: B4:E6:2D:53:1A:B8
AP MAC: B6:E6:2D:53:1A:B8
SSID: Lurch3 (CC:CE:1E:13:B7:58)
Channel: 6
Connected: 24 m 38 s
Last Disconnect Reason: (200) Beacon timeout
Number reconnects: 22
Build:⋄ 20103 - Mega
Libraries:⋄ ESP82xx Core 2.6.0-dev, NONOS SDK 3.0.0-dev(c0f7b44), LWIP: 2.1.2 PUYA support
GIT version:⋄  
Plugins:⋄ 76 [Normal] [Testing]
Build Md5: 1e7908fce79fc2f65c5d18b6ce5920
Md5 check: passed.
Build time:⋄ Feb 13 2019 18:22:58
Binary filename:⋄ ESP_Easy_mega-20190212-73-PR_2235_test_core_260_alpha_ESP8266_40

@melwinek
Copy link
Author

Only in my case the version is the same, the physical conditions are the same. The difference is in cleaning the flash.

@TD-er
Copy link
Member

TD-er commented Feb 20, 2019

Yep, clearing the flash is a good one (I just suggested to do the same on another issue)

@melwinek
Copy link
Author

I do not see any problem to clear flash with every update. But only if I can do it through OTG without removing the ESP from the wall.

@TD-er
Copy link
Member

TD-er commented Feb 21, 2019

Clearing the flash will also clear the configuration (SPIFFS filesystem) so then you have to redefine the wifi settings for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Question about how something works with concrete answers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants