SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 2:14 am

Hi all,
After a year of programming fun I am using my Raspberry Pi as a central heating controller but have suffered from terrible unreliability. I have tried several Model A and B Pis and they all have the same problem. They simply will not stay connected to the internet. The controller is supposed to report in every hour but when I check, guess what? After a few hours it's gone offline again! The program is still running happily controlling the heating but cannot report its status to me or download any parameter changes etc.. I have spent hours and hours trying to solve this problem but nothing I have done has made much difference. It reboots itself every morning at 0705 which sometimes brings it back but often it does not. Sometimes if I physically switch it off then on it recovers but often it does not and I have to get it back on the bench to diagnose the fault. It seems to be that it goes into an endless cycle of connecting and disconnecting every couple of seconds. I'm at the end of the line with these devices with my plans in tatters unless someone out there can help me to solve this bizarre connecting/disconnecting cycle!
Has anyone else had this problem?
I am using a PiHut wifi dongle and have also tried Edimax. I have BT Infinity and the pi is just a few feet from the router. I have tried different power supplies and USB hubs too.
Thanks for any help you can give...
David

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 3:14 am

If you have tried several Pis (and you still have them) can you set up another one on your home network with the identical software (but not attached to the boiler control hardware)? See how long it remains connected to the net. Maybe it's your router or your ISP?

If it's the Pi, maybe you are getting spikes from a relay clicking in and out, or electrical interference from the boiler when it turns on.

That's all I can think of for now.

klricks
Posts: 6590
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 4:34 am

Since you router is only a few feet from the RPi, why not try a wired connection?
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 10:28 am

> If it's the Pi, maybe you are getting spikes from a relay clicking in and out, or electrical interference from the boiler when it turns on.

That could be causing it. I have just ordered a solid state relay to try. Thanks.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 10:32 am

You blame the Pi for your problems but have you considered the possibility that your Wifi dongle or even the power supply could be unreliable too??

Does your Wifi dongle support power saving mode?? did you remember to disable this so it doesn't go to sleep??

As already suggested why not use a wired connection this is much more stable than Wifi and less prone to radio interference.

Richard S.

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 10:10 pm

That's an interesting idea. How do you disable the wifi dongle's sleep mode?
I bought my dongle from the PiHut and my power supply is a 2 amp one which came in the Maplin kit.

User avatar
DougieLawson
Posts: 36128
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Feb 06, 2014 11:03 pm

SuperDave156 wrote:How do you disable the wifi dongle's sleep mode?
It depends on the dongle and the driver it uses.
lsusb
should reveal which chipset is in your dongle.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
DavidXN
Posts: 54
Joined: Sat Sep 14, 2013 7:14 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Fri Feb 07, 2014 1:59 pm

Wi-fi sleep definitely confounded me when I first started with the Pi - if your chipset matches, here's something to try: http://www.raspberrypi.org/phpBB3/viewt ... 9&p=421643

klricks
Posts: 6590
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Frustrating internet unreliability from my Raspberry Pi

Fri Feb 07, 2014 2:40 pm

Here is how to disable power save mode for RaLink RT5370 chipsets
http://www.raspberrypi.org/phpBB3/viewt ... 45&t=46569
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Tue Feb 11, 2014 2:34 pm

Thanks guys,

I have applied all your suggestions except the 1 minute ping because my program polls the server every minute so I should have that covered. I have the Ralink 5370 wifi dongle from The Pi Hut.
I came back to the Pi after a break and was alarmed to find that it had no connection. No programs were running at the time.
The wpa_gui had empty fields; no adapter and no network, so I tried the /etc/init.d/networking restart command expecting it to come back on. No such luck! I rebooted and it came back. It's been ok for a couple of hours or so but I need 24/7/365 reliability.
I suppose it's a bit much to expect from a cheap machine.
Forgive my cynicism but it's starting to look familiar... Brilliant British idea but not quite right. Just waiting for the Americans/Japanese/Koreans/Chinese (take your pick) to copy and perfect then sell by the million.
What do you think???

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23674
Joined: Sat Jul 30, 2011 7:41 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Tue Feb 11, 2014 3:09 pm

SuperDave156 wrote:Thanks guys,

I have applied all your suggestions except the 1 minute ping because my program polls the server every minute so I should have that covered. I have the Ralink 5370 wifi dongle from The Pi Hut.
I came back to the Pi after a break and was alarmed to find that it had no connection. No programs were running at the time.
The wpa_gui had empty fields; no adapter and no network, so I tried the /etc/init.d/networking restart command expecting it to come back on. No such luck! I rebooted and it came back. It's been ok for a couple of hours or so but I need 24/7/365 reliability.
I suppose it's a bit much to expect from a cheap machine.
Forgive my cynicism but it's starting to look familiar... Brilliant British idea but not quite right. Just waiting for the Americans/Japanese/Koreans/Chinese (take your pick) to copy and perfect then sell by the million.
What do you think???
What do I think? I think you are wrong. Remember, the Raspberry Pi is a HW platform. This is more than likely a software problem, and may even be a SW problem in Linux itself! That problem software may even have been written OUTSIDE THE UK - SHOCKER. So to blame British engineering is quite an insult don't you think? Take a look at the bug lists for the Beaglebone, or any other SBC. They are not empty.

If you want 24/7/365 reliability, then perhaps the Raspi really isn't for you. Perhaps you need to spend a lot more money on custom HW if you want to be certain. And custom software as well (see above), because who knows what bugs are in the code out there.

The point being - do you know of any machines that can provide 24/7/365 perfect reliability? The only way you can be sure is to build one yourself, make it multiply redundant (ie if a part fails something else takes over), do the very thorough testing required, and then hope you don't have a HW failure that you didn't predict. This is what people like NASA do for very high reliability.

With regard to your particular issue. Have you tried different dongles? Or wired connection? Do they suffer the same problem? Have you tested your power supply and cable? I had a problem with Ethernet dropping out due to power problems.

I have had no problems at all with my Raspi running OpenELEC with cheapo Wifi dongle. Been sitting behind the TV upstairs for months working away. Not had any problems AFICR.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
RaTTuS
Posts: 10458
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Frustrating internet unreliability from my Raspberry Pi

Tue Feb 11, 2014 3:18 pm

1) power
2) power lead
3) power

ditch the wi-fi use it wired directly
measure the power from tp1 / tp2

if you are still having an issue add a watchdog to reboot your RPi

but my guess is going to be power


p.s.
did I mention measuring the power from tp1 / tp2
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Frustrating internet unreliability from my Raspberry Pi

Tue Feb 11, 2014 4:11 pm

I have experienced exactly the same problems as the OP with numerous Wifi adapters, I eventually gave up on wireless, bit the bullet, ran a cable and have never looked back. There is no comparison between the reliability now and back then.

Linux and Wifi are happy bedfellows away from the Pi in my experience.

This isn't one Pi, its several, several power supplies, and several different WiFi adapters and I lost count of the number of upgrades and scripts to monitor the connection I tried with varying degrees of success. Not just a voltmeter but a 'scope across the test points.........

I've always stuck with Raspdian, which may have a bearing. (Better the Devil you know, Its Debian under the bonnet).
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Sat Feb 15, 2014 12:42 pm

I hear what you say guys.
I have bought 13 Pii (what is the plural? "Pis" doesn't seem right somehow). 1 B from Maplin and the others As from RS so, 2 have been Bs and 11 As. I like the designation A and B because I have a BBC Model B with twin 200k floppies, sideways ROMS with spreadsheet and word processing and a Microvitec Cub monitor in my loft - so that shows how far I go back!
Of the 11 As, 4 where not working correctly on arrival, 3 locked up after a few minutes and the other had no response at all from the USB port. I baked them in the oven at 240C for 10 minutes and miraculously they all now work!! I even had to shout in alarm to the missus "Don't open that door! I've got Pis in the oven!"
I have 7 Pii in the field controlling the heating in student houses and two more in test on the bench. These save about 30% gas while maintaining the house at a nice temperature. I have one in my own house too. The internet is BT Infinity in all houses. In my house and one other, due to the router being two floors down, the Pi runs off a TP-Link wifi extender placed close to the Pi.
My "Shield" has a mechanical relay to do the switching but on the newest build I am using a solid state relay which is working well (switching a 40W desk lamp). I am a qualified electrician so everything is done with safety in mind. I use PiHut Wifi dongles and each Pi has a heatsink on the processor. Power supplies are 1A phone chargers and my test/development rig has the 2A power supply from the Maplin starter kit. a red LED shows whether or not the heating is on and a green LED indicates the internet connection status and flickers to show file transfers. A history file is uploaded and a file of settings is downloaded every minute which ought to be enough to keep the connection up. The Pii reboot themselves at 07:05 and 18:05 if they have lost connection. Sometimes it resolves the problem and sometimes it does not.
I have spent a year of quite hard work developing this thing and everything is great except for this internet connection reliability problem.
The problem can occur in the field and also on the bench with my 2A supply so I don't think the supply is the problem.
I am suspicious of the wifi dongles because I have 5 here that do not work at all. 2 (expensive) TP-Links and 3 that are just marked 802.11 with a red and black case. One is these is also marked ThePiHut and is the only PiHut one I have had that doesn't work.
The main problem is that the Pi can get into a state where it goes through a rapid connection/disconnection cycle. It does this whether or not any of my Python programs are running and you can see it happening on the wpa_gui and in the CPU usage tray icon.
The only way to escape from this is by removing the power source and restarting. Letting it reboot itself doesn't seem to work. It's very inconvenient.
That's where I'm coming from...

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Frustrating internet unreliability from my Raspberry Pi

Sat Feb 15, 2014 1:10 pm

It sounds an awful lot like you're doing something similar to what I was planning and selling a household monitoring/control system. I abandoned the idea after 12 months, I just couldn't make wifi reliable enough, found exactly the same when rebooting the Pi, sometime it brought the adapter back up, sometimes it didn't. It generally needed a cold reset to bring it back. I have my own system running with an ethernet connection now which is reliable but I didn't consider that to be a commercial practicality. I blame the Pi's USB subsystem, software has improved it no end, since I started, but it still has issues with many USB devices, especially in the long term.

This is mine :

http://www.pluggy.me.uk/homeserver

Much of the measuring and control is done with an arduino, but the Pi does the connection, web interface and pretty graph drawing.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Sat Feb 15, 2014 7:50 pm

How far are your dongles from the pi's themselves? (That may sound like a personal question... ;-) ) Try a good, short USB extension cable ( maybe a foot or two) and/or a metal case for the pi. That and a bunch of the other "home remedies" like good power supplies, disabling power saving, etc. work wonders for me....
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Mon Feb 17, 2014 8:55 pm

Hey that's worth a try Max. Thanks!
Pluggy, you've taken this to another level! I love the graphs. I haven't got past text based output yet on the pi.
Here's what I've found with gas heating.
I started off with a Dallas measuring the internal temperature of the house then interrupted the brown wire into the Honeywell motorised valve with a relay when the Dallas reached the desired temperature. This, in effect, provides an upper limit to the conventional thermostat which is invariably on 30 - these are rental houses with all bills included. The problem with this was that the Dallas was subject to undesired variables such as the sun shining through the window onto it and that in some houses the motorised valve is on the ground floor while others have it on the top floor.
I took a step back and concluded that my objective is to reduce gas consumption and not to directly control the temperature of the houses.
I did some experiments in my own house and found that a boiler run of 3 minutes every 15 minutes kept the house nice and warm despite the temperature outside being wintery. However, when the temperature outside rose a few degrees it got a bit too warm. So now I read the weather feed from yahoo and adjust the amount of time the boiler can run depending on the outside temperature. Each hour also has a maximum time so from 6am to 7 it can run for a maximum of 30 minutes but at 2pm it can only run for 9. It works really well and I have had no complaints despite the gas consumption being 30% less.
The Pi and shield are enclosed in a Maplins power supply box screwed to the wall in the airing cupboard. It's neat and doesn't look home made. I have 40 houses to equip so the annual savings will run into many £1000s. Internet reliability is important because I need to get the ambient temperature from yahoo as well as for sending adjustments and receiving data etc.
I remain optimistic...

goldberg
Posts: 14
Joined: Thu Mar 06, 2014 5:27 pm
Location: Cambridge, UK

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Mar 06, 2014 11:12 pm

Like others posting to this forum, I’ve also experienced problems while trying to get WiFi to work reliably with the Raspberry Pi.

I’ve tried many of the solutions proposed on the raspberrypi.org forums and also on many other internet forums.
For example:
- using the 5.2v/1.1amp port on a PiHub to supply adequate power to the RPi
- using the /etc/modprobe.d/modprobe.conf disable power management option as recommend on brewpi.com and elsewhere
- using crontab to ping out to the router to keep alive the WiFi connection - also recommended on brewpi.com,
all without success.

My setup is a follows:
Model B Raspberry Pi with latest 2014-01-07-wheezy-raspbian.img
Internet router - Billion 7800N with 24 hour DHCP lease time
WiFi hardware - I have tried the following three dongles
- WiPi dongle from Farnell - RALINK RT5370 chipset
- PiHut dongle - RALINK RT5370 chipset
- Edimax EW7811Un dongle - RTL8188CUS chipset
Have tried running a WiFi configuration with and without the use of the wpa_supplicant.conf file

Each of these dongles gives the following symptom in use:
After a fresh reboot of RPi the Wifi connection appears to work fine, usually for an hour or so.
After a while, but still well within the DHCP lease expiry time of the router, the WiFi on the Raspberry Pi
no longer responds when PING’ed or SSH’ed from a PC, despite the fact that the activity LED on the dongle is still continuing to flash.

One interesting observation: when the WiFi dongle’s IP-address can no longer be reached by PING, if the RPi’s ethernet port is then patched directly to the router, the PINGs to the WiFi dongle immediately resume successfully, and the WiFi dongle can then be reached by SSH, for a further hour or so. This behaviour is repeatable.

There appears to be an interaction between the ethernet port and the WiFi dongle’s USB port.

Trying a different ADSL router (Draytek 2710VN with 72 hour DHCP lease time) appears to make no difference.

And yet, there are folks posting on various RPi forums who appear to have WiFi up and running for days if not weeks at a time without a problem.
My investigations continue, but meanwhile several of my RPi projects requiring Wifi remain on hold….

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Sat Mar 08, 2014 7:04 pm

Thanks for your useful test results goldberg. Of my 7 pii in the field and 2 on test, after applying all the recommended fixes, I only get regular problems with the ones in my own house and the one at "Number 3". Interestingly, these are connected through a TP-Link powerline extender so use the mains wiring to facilitate internet connection. In the near future I will modify the setup in my house to hardwire the ethernet port to the powerline. If the problem persists then it goes someway to rule out the wifi and put the blame on the mains transmission. Anyone else using powerline extenders?
Dave

ebswifty
Posts: 26
Joined: Mon Jul 16, 2012 10:35 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Wed Jun 04, 2014 10:45 pm

This is something that has been plaguing me too, I've implemented every trick in the book. What seems to have worked though (still need more time to test, but so far no dropouts) is moving to wicd as the network manager.

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Wed Jun 04, 2014 11:02 pm

Thanks ebswifty. Something new to try! I have been running a test Pi connected to the ethernet port of a power line extender for some weeks now with no dropouts. When I get a chance I will install wicd and give that a go.
Thanks again for taking to time to post your suggestion.
David

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Jun 05, 2014 12:02 am

No promises, but take a look at this site for more things to try:

http://kmkeen.com/linux-wifi/
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23674
Joined: Sat Jul 30, 2011 7:41 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Thu Jun 05, 2014 8:00 am

Are you using the very latest firmware with all the USB fixes?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

ebswifty
Posts: 26
Joined: Mon Jul 16, 2012 10:35 pm

Re: Frustrating internet unreliability from my Raspberry Pi

Fri Jun 06, 2014 6:05 am

Checking back in, 3 out of 3 units are still online and I think they'll stay that way now. My /etc/network/interfaces looks simply like this now:

auto lo
iface lo inet loopback

This is where I got the info to setup the connection on our domain, you may be able to use one of the default templates:

http://blog.lanaddict.com/2010/12/using ... v2-to.html

If removing network-manager says it isn't installed, ignore that, I didn't bother searching further and everything is still good. Another thing I've noticed is previously when I was having issues, trying to ssh to the remote raspi was infuriating, I had to use 'screen' to keep track of my session because it would drop after every 15-20 keystrokes. Imagine how hard it is to code something up with a connection doing that... Yes it did work fine on ethernet but connecting from home back to work was the issue. Anyway, that problem has gone away, ssh sessions do not drop.

The attachment shows the 3 units that are online, the other 3 are switched off and don't have the current configuration. I've got the parts to build another 6, I was sweating on fixing the wifi reliability problem. I'll do an update on the g+ raspberry pi community.
2014-06-06 16_00_35-ip.png
2014-06-06 16_00_35-ip.png (17.79 KiB) Viewed 5385 times

User avatar
Cancelor
Posts: 757
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Frustrating internet unreliability from my Raspberry Pi

Fri Jun 06, 2014 6:57 am

So, what made the difference in the end?
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

Return to “Troubleshooting”