Closed gifter77 closed 1 year ago
Another solution would be to use ifdown wlan0
and ifup wlan0
rather than ifconfig
. ifconfig wlan0 up
does not set up IP addresses, whereas ifup wlan0
does.
Please provide a sonar.log in debug settings and a dmesg output, when error happends.
Under normal conditions ifconfig and ifup/down do the same thing...
Regards Kwad
Sure I'll wait for this to happen again. It might take a while though.
I want to keep an Eye on, could you reproduce it recently?
I am thinking about a more "elegant" solution.
I've just reproduced today actually.
Note that my network didn't have any issue. I don't have persistent dmesg unfortunately.
Ok so I managed to debug this a bit further. It seems this is the wifi driver erroring out and not being able to scan for network anymore. Unloading and reloading the wifi driver doesn't even fix it.
I have same issue, Rpi4 mainsail OS, will end with never ending loop.
[12/23/22 13:10:29] sonar: Reached 8.8.8.8, Triptime: min/avg/max/mdev = 3.934/6.861/12.411/3.926 ms [12/23/22 13:11:41] sonar: Connection lost, 8.8.8.8 not reachable! [12/23/22 13:11:41] sonar: Restarting network in 10 seconds. [12/23/22 13:12:17] sonar: Waiting 10 seconds to re-establish connection. [12/23/22 13:13:27] sonar: Connection lost, 8.8.8.8 not reachable! [12/23/22 13:13:27] sonar: Restarting network in 10 seconds.
@radek6ak looks like a too bad wifi signal and the rpi lost the connection complete
The main problem here is I cant reproduce it, because my router is 3m away from my "dev pi". So, I never have issues with disconnects.
But, please do not use IPs out side of your network! The target might react allergic to pings. Use hosts in your home network that are reachable like your router or a server in your home lab.
@gifter77 I read through your log and there are part where I am concerned about. Most of the tim the trip times where ~ 1ms, but they are spiking around 7h later. I can not tell what might the reason for that. Maybe some traffic to the pi or from the pi.
@meteyou I dont think this is related wifi signal, I am gettind stable signal between -50 and -60 dBm, other instances on same pi like fluidd.pi or octopi working without issues.
@KwadFan I have tried google DNS just for try, there was same behaviour with pinging default gateway
I didnt mean the reaction of sonar, sonar gives a F... on it who is the ping target. I meant the reaction of the pinged target.
Well if fluiddpi and octopi work, simply disable sonar. Then they are all the same, all three are built on top of raspberrypi os, even the used build framework is the same.
@KwadFan see ful log file, sonar.log if help
After viewing your log, there some things, that pull up some questions.
Pinging your router spikes every 3 minutes.
Same is to see if you ping Google DNS, not that high trip times but they are there.
The restart doesnt function as expected, do not know exactly why, but it wont reconnect. Do you use networkmanager or klipperScreen?
@KwadFan This is just Mainsail installed by Rpi imager, no extras, web cam and printer only connected, maybe this issue is not problem by Sonar itself.
I geeting the conection drop outs (no connection possible by browser and SSH as well) therefore I activated sonar and found that this will not resolve the problem because sonar is not able recover the connection.
Anyway, after my first post, I have tried Fluiddpi and from that time no conection problems. With Mainsail OS I had the problem after short time of connection. Just one note have to point out, on the PI is installed Tailscale VPN, but I use local network while the problem happen.
@KwadFan This is just Mainsail installed by Rpi imager, no extras, web cam and printer only connected, maybe this issue is not problem by Sonar itself.
Well, sonar is developed on MainsailOS buster. Maybe I need to review that whole damn thing for bullseye.
How familiar are you with git? Especcialy changing branches and thing like that?
I would prepare a branch with a bit more brute forcing of reconnection.
FIY: The latest mainsailOS implements disable of Wifi Powersave through dbus. If you use an external Wifi I dont know if that will fit it.
I have tried wifi power save ON/OFF, and this will make no change, just build in WIFI, I have no external adapter in my hands.
Just basic experience with software, no expert skills, I am more HW oriented, but I can try some developer build to test after new year, I will be off next few days.
Anyway, after my first post, I have tried Fluiddpi and from that time no conection problems. With Mainsail OS I had the problem after short time of connection.
then pls explain me the difference... fluiddpi is/was a fork from mainsailOS. it uses the same base image and the same framework to install the rest.
@meteyou Sorry I have no idea. I still keep mainsail SD card as well as fluid, if you need some more log or diagnostic data please feel free to ask because there is no problem to simulate connection drop on my side.
I think the best way would be then, try patch by your own.
Remove that line https://github.com/mainsail-crew/sonar/blob/0ce6c6fc93780ef776fbc45c216336be03c8d907/libs/core.sh#L177
Edit https://github.com/mainsail-crew/sonar/blob/0ce6c6fc93780ef776fbc45c216336be03c8d907/libs/core.sh#L179 and replace with
wpa_cli -i wlan0 reconfigure
Maybe that works a bit better.
@KwadFan Thank you, I made the changes, will let you know the result after some time of checking.
@KwadFan Finally I did not get any working configuration, but after new fresh installation of latest mainsailOS no wifi issue anymore. It looks as some corrupted installation or something else. The issue can be closed from my side.
I will close this issue for now.
I have to review the code in general, as soon I have some spare time. Thinking about giving an option to set the "Wifi Restart" command.
Regards Kwad
What happened
When the keepalive function is run, wifi does not reconnect.
What did you expect to happen
Wifi should reconnect.
How to reproduce
Not sure this is easily reproducible cause it could be due to my router setup, etc. An easy fix is to add the following command after
ifconfig wlan0 up
:dhclient wlan0
Additional information
No response