REPORT AN ISSUE

Raspberry Pi Zero W keeps losing connection to the server

3 people are following

First off, excellent app, works really well and is going to look ace when the screen is installed into the power supply cut out of my case :D

Got a bit of an issue tho - it keeps losing connection to the server after its been on for a few hours and you've got to reboot the Pi to get it to reconnect. I've been using the dubbadhar theme which is working well on the Pi Zero W, no glitches or anything once its running, but it does take some time to get there! I can live with that tho :) 

I've been keeping an eye on the temps and it is around 50 degrees C so should be fine at that, it's got a heat sink on and does get warm, I saw in another post how to get the log, so I've included it below. I can still SSH into the Pi, so I know it's connected to the network, and clearly the PC is OK too! Not sure if the server is the problem or the Pi to be fair, hopefully someone can advise. 
Thanks in advance :)

https://1drv.ms/t/s!AiYKV6Ix_ZcPkiTNJYWV1MQmM_yR?e=ryHoXS link to the log on my OneDrive

Replies 1 - 12 (12)

I think your temps might be a bit hot. Mine is also running dubbadhar and overclocked and with my heat sink and fan. It only gets to about 38 C. You could try lowering your temps to see if that fixes it. Other wise there seems to be lots of people with similar issues scatter over the internet just no one has a definitive answer to the problem. You could try looking into those and see if there fixes would work. i have not run the wifi for extended periods of time (days) but for a couple hours it was fine. 

Hi @Tom 

Thanks for adding the log, I just had a look at it. 
From what i can tell the service lost connection to the PC once and then automatically reconnected about 3 minutes later.

But I can't really tell why there was a disconnect. Maybe the Wifi connection was gone for a few seconds or some other network related error caused the check to fail.

If you have it running anyways maybe you can keep an eye on it. Would be interesting to know if this keeps happening on a regular basis.

@EnDeR WiGGiN Ah, that's interesting, to be fair the Pi Zero is only double sided taped to the back of the screen as a temporary measure for testing. It does have a passive heat sink on tho so does have some kind of cooling. When I move it into my proper case, I can mount the Pi Zero near the front intake fans, which should help keep it cool.

@Seraksab  Ah OK, it's been on since 9 this morning and I just checked the log as I've been out of the room for a bit and it seems it disconnected again. It did reconnect on its own this time though. I'll link it below again, but seems it was the same as the last few times. It could well be the WiFi connection even if there's an extender right by it, as I'm not convinced that its not still connecting to the router in the living room… When I set the extender up I gave it the same name as the main router, I'm going to change it to another name I think as that could be causing issues. 
Edited to add - Just checked the extender and the Pie is definitely connected to it and not to the main router, but I'll keep an eye on it.

https://1drv.ms/t/s!AiYKV6Ix_ZcPkiWyPOR4q_0CcUYy?e=kYltKt

I'll let you know the outcome, thanks for the help.

So it's been on all day today, it lost connection at lunchtime or thereabouts and then wouldn't reconnect at all, log is below again.

Even though the log was saying that the host was reachable in the afternoon, it didn't show anything on the screen or a connection on the server, you can tell because the temp is less than 50 degrees (temp when the dubbadhar theme is running). I've been in online meetings today, so have been keeping an eye on it… it's been alternately showing black screen, searching for, app found, then back to can't reach host all afternoon. It's definitely a bit odd, as there shouldn't be any reason to lose connection? 

https://1drv.ms/t/s!AiYKV6Ix_ZcPkia__f53RZR5VgfR?e=RFQzTL

I'm tempted to stick the SD card in my Pi4B I've got here to see if that works any better?

Edited to add

Just tried to SSH into the Pi to reboot it and i get this message at the command prompt - ssh_dispatch_run_fatal: Connection to 192.168.1.202 port 22: Connection timed out

But when navigating to the IP in chrome the log works fine and the setup loads straight away?

@Tom So you said that you are using the dubbadhar theme. 
Could you try to switch to the default theme for a day just to see if it happens on that one as well?

The dubbadhar theme contains lots of animated graphs/charts and is therefore pretty CPU intensive on the Pi.
On the Pi Zero this pretty much pins the CPU to 100% usage all the time.
So it might be that due to that CPU load some of the requests in the background to check whether the PC is still reachable are not completed in time and thus resulting in the connection loss. It could also be that this is the cause of the ‘Connection timed out’ you got when you tried to SSH into it.

I already updated the code to not instantly switch to ‘connection lost’ if the background check fails but to try a few times. Just to make sure it's not just one bad request.

However I haven't built a new image just for that change.
But if you SSH into your Pi you can apply the update yourself by replacing the content of the file under '/home/modbros/mobro-raspberrypi/service/mobro.sh' with the updated one here:

https://github.com/ModBros/mobro-raspberrypi/blob/master/service/mobro.sh

Hi, thanks for getting back to me.

Last night I swapped back to the standard theme, and have updated mobros.sh. Was working OK all morning, but has lost connection again this afternoon unfortunately, seems the same as before? Not sure, but the log is below again. It starts at 13:00 as I updated my PC at lunch time and rebooted everything, but was OK during the morning.

https://1drv.ms/t/s!AiYKV6Ix_ZcPkinjwGC_NedwJ3TL?e=fCWXo5

Edit to add

Lost connection again this afternoon, but this time it managed to come back and reconnect briefly, but is now saying ‘Mobro not connected’ in the bottom right. Log below which shows that the server is still reachable?

https://1drv.ms/t/s!AiYKV6Ix_ZcPkirmoI6JZL0iSO4-?e=qLKdVz

Really hope we can get this sorted as I really like the software! If I have to buy an RPi4 then I can, but when the Zero works, its absolutely fine?

 

Thanks for updating and posting the log again.

So there's an occasion in the log where the first request did indeed fail, but the next one succeeded and therefore the Pi didn't switch to ‘connection lost’.
So i guess we made at least some progress, although it's still a bit weird.

I now increased the connection timeout and spaced the requests out a bit more.
So it would be great if you could update the mobro.sh file again (the one that i linked in the last post) to see if that helps.

Do you normally experience any other wifi issues like short connection losses or similar on other devices?

@Seraksab Have updated the mobro.sh file this morning, thanks.

When I'm sat at my computer my phone is also connected to the same wifi extender and doesn't seem to have any issues? I will keep an eye on it today tho, and see what happens if it drops connection again. I can check on the extender and see if it has a connection still.

Perhaps I'm reading it wrong but looking at the last entry on the log I sent, it does have connection to the server tho? At this point the screen was just black?

22.06.20 15:57:36 | 46.0'C : [background_check] MoBro on 192.168.1.101 still reachable

yes the server was definitely reachable at that point

but connection was lost a few minutes earlier here:


22.06.20 15:52:54 | 43.3'C : [background_check] MoBro on 192.168.1.101 no longer reachable. starting discovery

and then re-connected here:


22.06.20 15:53:09 | 44.4'C : [service_discovery] MoBro application found on IP 192.168.1.101

what happens here is:
the theme needs a browser to be displayed and therefore chromium is running
if the connection is lost, this chromium instance is stopped and the pi switches to the ‘connection lost’ screen that you see
after it reconnects to the PC, chromium is started again to show the theme

the pi zero is pretty weak from a performance standpoint. so chromium needs some time to start and it's completely normal for the screen to be black for some time

but it shouldn't take 4 minutes
so maybe chromium doesn't successfully start the 2nd time or something else happens. i don't really understand whats going wrong there at the moment

however, the connection shouldn't be lost in the first place. if we can fix that, the browser won't have to be restarted

Ah that all makes sense :) 

So I've had it running most of the day today again, and as you can see it's lost connection multiple times. Each time it has managed to restart chromium and show the default monitor theme. Each time it was quite slow, but it did get there. 

I'm tempted to put it out by the actual router tomorrow for the day and see how that goes? As that should rule out this wifi extender then, other than that I'm out of ideas!

Any other thoughts what might be causing it?

https://1drv.ms/t/s!AiYKV6Ix_ZcPkjgQ2quENPJn7Hux?e=R4vOgo

To be honest I'm currently out of ideas.

At the place you currently put the Pi, would it be possible to connect it via ethernet cable?
I know it's not the ideal solution but it would definitely fix the problem with disconnects.

I've had it plugged in in the kitchen for a few days, nearer the router, so not using the extender and it's stayed connected all day. I can only assume that for some reason the Pi Zero won't keep a stable connection to this extender?
Thanks again for your help, once this lockdown calms down a bit I'm meant to be moving to a new place, so hopefully I won't need an extender. If I do then I might change to an RPi4 anyway for ethernet and a more powerful option. 

I'll let you know how things go, but hopefully it'll all be fine. Thanks for a great app tho, I'll send some pictures when I get it installed in the new build ?

Login to comment

Login
Like most websites, we also use cookies. But don't worry, we only use them for your login and statistics.