BrewPiLess icon indicating copy to clipboard operation
BrewPiLess copied to clipboard

4.0r1 still loosing wifi

Open Naesstrom opened this issue 4 years ago • 29 comments

The wifi issues from 4.0 that it looses the wifi settings seems to be fixed but it's loosing connection to the wifi intermittently. After rebooting it pops up on the network again. You can see the straight purple line that shows SG when it looses connection 12th May and last night until now image

Naesstrom avatar May 13 '20 09:05 Naesstrom

I do copy that. Today after 5 to 6 days my little D1 lost again the wifi connection - Version 4.0r1.

daCo11 avatar May 13 '20 15:05 daCo11

Not sure if this is relevant for some reason but the wifi loss seems to happen at regular intervals May 12th: 03:00:51 May 13th: 02:53:19 May 15th: 02:54:56 Time is GMT+2 (CET) image

Naesstrom avatar May 15 '20 20:05 Naesstrom

@Naesstrom does your BPL recover by itself? Mine just falls back to the address of the AP mode and stays there. I'm not sure if this is just a coincidence or in fact related. My problems with the wifi connection started soon after I enabled remote logging to ubidots on the BPL. As a next step I'll disable the logging again and see what happens.

daCo11 avatar May 15 '20 22:05 daCo11

What is your WiFi signal strength like?

vitotai avatar May 16 '20 04:05 vitotai

What is your WiFi signal strength like?

According to the cmd output rssi -75. Could be better I know ...

daCo11 avatar May 16 '20 05:05 daCo11

-75db is not very good. It's similar to mine, which ranges from -80 to -73. Moreover, there are doors and windows between my fermenter and my AP, if I close all the doors and windows, my controller would lose network. You might have similar issues with mine.

Let me explain the design and the problems. Spoiler: I might not be able to help you. As the framework of Arduino/ESP8266 upgrades, the implementation of underlying WiFi changes. We don't have access to the WiFi implementation underlying. In the begging, I have to code to recover the network when lost. Then, after some version, there is a new function setAutoReconnect() that seems to do recovering from the underlying part of code. I changed to use that function. Unfortunately, the behavior changed after a few upgrades. I found ESP8266 will use all its resource to recover network if setAutoReconnect() is true and the network is lost, which results in issues of connection under AP mode. My solution is to try to recover for a while, say 10 seconds, and then wait for a period, say 5 or 10 minutes, to enable AP connection. It's not a very good solution, but is the only solution I can think of. The latest framework seems to introduce another problem, which the last update addresses. In previous version, the WiFi credentials is saved by the underlying WiFi library, but it seems that saved WiFi data would be lost for some unknown reason. Therefore, the latest modification try to save the network information, SSID and password, "manually".

If your BPL connects back to AP after some time, it means the new modification works as expected. Your lost of WiFi can't be solved by any software. Please be aware of it. When BPL loses WiFi connection, it will try to recover for a while. When recovering, AP connection is usually unavailable. If your iSpindel connects to BPL via AP mode, it would have trouble. If your iSpindel connects to the same WiFi network BPL connects to, still BPL is not connected when it loses the WiFi connection. That explains the blank period of iSpindel data.

vitotai avatar May 16 '20 09:05 vitotai

Many thanks for your explanation. That explains a lot. My fridge is outside in garage at the moment and there are at least two walls in between to the AP. That explains of course the weak signal and the fact it cannot recover as you described. I was just surprised that it stopped working after a couple of days without any problem. Maybe I just had luck.

daCo11 avatar May 16 '20 10:05 daCo11

@Naesstrom does your BPL recover by itself? Mine just falls back to the address of the AP mode and stays there.

No mine just stays as an AP to until reboot!

What is your WiFi signal strength like?

Is that included somwhere in this?

12:38:5 ↑ output rssi
12:38:5 ↓ D:{"logType":"W","logID":1,"V":[111]}
12:38:5 ↓ D:{"logType":"W","logID":1,"V":[117]}
12:38:5 ↓ T:{"BeerTemp": 25.36,"BeerSet": 30.00,"BeerAnn":null,"FridgeTemp": 30.19,"FridgeSet": 30.00,"FridgeAnn":null,"State":0}
12:38:5 ↓ D:{"logType":"W","logID":1,"V":[112]}
12:38:5 ↓ D:{"logType":"W","logID":1,"V":[117]}
12:38:5 ↓ T:{"BeerTemp": 25.36,"BeerSet": 30.00,"BeerAnn":null,"FridgeTemp": 30.19,"FridgeSet": 30.00,"FridgeAnn":null,"State":0}
12:38:5 ↓ D:{"logType":"W","logID":1,"V":[114]}
12:38:5 ↓ S:{"mode":"p","beerSet": 30.00,"fridgeSet": 30.00,"heatEst": 0.000,"coolEst": 3.453}

Should be good, have a unifi outdoot AP just a few meters away and not much blocking the signal!

Naesstrom avatar May 16 '20 10:05 Naesstrom

@vitotai maybe one more question. I don't use the local AP mode for the time being. What happens if I config the BPL for just station mode and the wifi signal gets too weak? Does the BPL just keep trying to reconnect?

daCo11 avatar May 16 '20 12:05 daCo11

We can use a board with better WIFI antenna like Wemos D1 mini Pro if WIFI signal is weak

stefschin avatar May 16 '20 14:05 stefschin

We can use a board with better WIFI antenna like Wemos D1 mini Pro if WIFI signal is weak

Many thanks for your hint. I was just about to google in how to improve the wifi reception of a D1 :-)

daCo11 avatar May 16 '20 15:05 daCo11

@vitotai maybe one more question. I don't use the local AP mode for the time being. What happens if I config the BPL for just station mode and the wifi signal gets too weak? Does the BPL just keep trying to reconnect?

Entering AP mode when failed to recover is intentional, so that we have access to the controller. In latest version, the controller should keep recovering network.

vitotai avatar May 16 '20 15:05 vitotai

Instead of a D1 you can use a ESP07 with external antena

El sáb., 16 de mayo de 2020 12:48, vitotai [email protected] escribió:

@vitotai https://github.com/vitotai maybe one more question. I don't use the local AP mode for the time being. What happens if I config the BPL for just station mode and the wifi signal gets too weak? Does the BPL just keep trying to reconnect?

Entering AP mode when failed to recover is intentional, so that we have access to the controller. In latest version, the controller should keep recovering network.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vitotai/BrewPiLess/issues/235#issuecomment-629665995, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXBW4OF26QI5IY7AS3JOWLRR2YUJANCNFSM4M7SXFNA .

lalo-uy avatar May 16 '20 19:05 lalo-uy

@lalo-uy thanks for the hint. Next time that could be really an alternative. For my actual situation the D1 pro would be the better solution cause that one is pin compatible and I can just swap the modules.

daCo11 avatar May 16 '20 19:05 daCo11

I'm curious to know what signal level would prevent the disconnects? I've flashed my two brewpiless controllers back to 3.5.1, because I found 4.0r1 too unstable (would disconnect at least once per day, sometimes several times per day, and not recover). When my controllers are connected, they are showing signal levels between -58 and -63.

ericyanush avatar May 25 '20 18:05 ericyanush

-58 ~ -68 should be relative good. I am now considering roll back to old framework, which seems to behavior better.

vitotai avatar May 26 '20 00:05 vitotai

I'm curious to know what signal level would prevent the disconnects? I've flashed my two brewpiless controllers back to 3.5.1, because I found 4.0r1 too unstable (would disconnect at least once per day, sometimes several times per day, and not recover). When my controllers are connected, they are showing signal levels between -58 and -63.

Sounds like what I've been experiencing, atleast once a day it disconnects and WiFi shouldn't be an issue! I'm ready to test a 4.0r2 @vitotai if you change the framework!

Naesstrom avatar May 27 '20 15:05 Naesstrom

The whole story is strange. I went back to 3.6 something for a short period and now I'm running 4.0r1 again. This one is stable since a couple of days with a short interrupt yesterday where it recovered automatically. RSSI levels are alway above -72 in my case which is bad as we know ...

daCo11 avatar May 27 '20 16:05 daCo11

I actually can't find the way to store wifi credentials. Everything is good until router or BPL reboots. Only AP mode and entering new options works...

grga12345 avatar Jun 15 '20 09:06 grga12345

here is what I get

http://postimg.cc/ft7DsKfr http://postimg.cc/Z9dJ7ZBZ

grga12345 avatar Jun 15 '20 09:06 grga12345

uploaded a trial version, which I am trying. You might try if interested. It takes time to verify this issue. (Mine lost after over 10 days for 4.0r1)

vitotai avatar Jul 01 '20 04:07 vitotai

I will try, of course. Unfortunately, only v2.6 works great for me.

On Wed, Jul 1, 2020, 06:02 vitotai [email protected] wrote:

uploaded a trial version, which I am trying. You might try if interested. It takes time to verify this issue. (Mine lost after over 10 days for 4.0r1)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vitotai/BrewPiLess/issues/235#issuecomment-652175777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6SPK43EEELWNMOEHWPR4LRZKYNNANCNFSM4M7SXFNA .

grga12345 avatar Jul 01 '20 07:07 grga12345

This is what is happening after I try to save wifi credentials. Will see how long it works and let you know.

Screenshot_2020-07-01-19-59-18 Screenshot_2020-07-01-19-59-23

grga12345 avatar Jul 01 '20 18:07 grga12345

Or, to try something else? How can I wipe device memory, totally? I tried something with some empty bin files according to one post from your forum's thread but I'm not completely sure it worked.

grga12345 avatar Jul 01 '20 18:07 grga12345

One more thing could be noticed, too. Only when I use v2.6 BPL shows itself as "brewpiless", otherwise as on screenshot below.

screenshot-7 1

grga12345 avatar Jul 01 '20 22:07 grga12345

Some news from me... it seems that newest version remembers wifi setting. I lost wifi and internet for half an hour at least and BPL connected successfully after fixing. But (always but) there is another issue now, time and temperature difference on graph, and left and right side of screen. Screenshot below.

screenshot-8 1

grga12345 avatar Jul 02 '20 22:07 grga12345

The chart data is logged every MINUTES, while the data shown on left is updated every 5 or 6 seconds. It's normal to have different values.

Regarding the time, we don't have RTC on board and relying on time server for correct time. SNTP seems to fail after some version, I will need to check this.

You might try start a log, and then stop to see if the time synchronizes.

vitotai avatar Jul 03 '20 01:07 vitotai

Some more news from here. It seems that BPL actually "remembers" wifi data but can't reconnect if wifi signal is lost, router rebooted or whatever reason. After restart it connects automatically and I don't have to enter wifi data again in system config.

I'll have to use some kind of smart socket for it so I'll be able to reboot it remotely.

EDIT: have you guys tried to use other port than 80? 80 is "taken" by router and I can't change access management settings on it.

grga12345 avatar Jul 08 '20 18:07 grga12345

@Naesstrom does your BPL recover by itself? Mine just falls back to the address of the AP mode and stays there. I'm not sure if this is just a coincidence or in fact related. My problems with the wifi connection started soon after I enabled remote logging to ubidots on the BPL. As a next step I'll disable the logging again and see what happens.

Mine reboot in loop after activating log to thingspeaks.com :(

jo73250 avatar Jan 06 '21 21:01 jo73250