Arduino Forum

Using Arduino => Networking, Protocols, and Devices => Topic started by: domiflichi on Jul 06, 2012, 11:27 pm

Title: Sudden unreliability with my network-enabled Arduino project [SOLVED]
Post by: domiflichi on Jul 06, 2012, 11:27 pm
Hello,

I've created a prototype device that opens/closes my garage door and gives me the status of it (open/closed). I installed it a few months back and it worked perfectly up until last month when we had a really hot week (the hottest since I installed it). Now it's unreliable. I can 'connect' to it (Android client app I wrote) over the internet/network every time I try just fine, but when I try to send a command (again, with the Android app after it initiates a connection) to close/open the garage door, it doesn't always work.

First, here's a link to pastebin for the Arduino code:

http://pastebin.com/P86C7ifZ
 (http://pastebin.com/P86C7ifZ)

And here's a photo of the prototype installed near my garage door opener (near the ceiling):

(http://domiflichi.hopto.org/images/AAGDOpenerProtoInstalled-1.jpg)

And here's the Fritzing image:

(http://domiflichi.hopto.org/images/AAGDOpenerFritzing-1.jpg)

So basically what's happening is that sometimes after I connect I will push the appropriate button on my Android app to send a command to either close or open the garage door, and it won't do anything. Sometimes it will after the 2nd try though. Sometimes it won't. I don't understand because like I said, it worked perfectly for a couple months, and nothing that I can think of has changed. Did the heat damage something? (I live in the Bay Area, California, USA...it  got to the upper 90s (Fahrenheit) outside, and so it would've been several degrees hotter in my garage) Or is it just coincidence? What would be the most likely component(s) to be damaged if the heat did in fact damage something? I'm so new at this still I don't know what to do or where to begin troubleshooting.

My only idea is to take it down and install a resistor and LED on another pin of the Arduino and modify the Arduino code a little to turn off/on the LED when the garage door has been opened/closed by the Arduino and if that works but it doesn't actually open/close it, then I can rule out the Ethernet Shield being damaged and I'll know that the problem is with the Arduino pin, or the transistor/relay part of the circuit.

Sorry if I have too little information (or the wrong information) on here, I didn't want to put up too much, so I just put up the basics. I can post the Android code too, but I already have a lot of stuff on this post it seems like.

Oh, one strange thing though that's probably worth mentioning - regardless of whether it responds to my commands or not sent from the Android phone, it will always send the correct status of the garage door upon initial connection, and it does change as it should if the garage door's status changes (via the 'old-fashioned' push button in my garage), so it almost makes me think that it's not the Ethernet Shield. But then I think, well maybe it is the Ethernet Shield still as the garage door status commands are being sent from the Arduino to the Android, whereas my problem is sending from the Android to Arduino...I don't know. I'm a little overwhelmed.

Thanks,
jamie
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: zoomkat on Jul 07, 2012, 02:09 am
I'd suspect the relay beginning to stick or relay contacts wearing out.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 07, 2012, 05:32 am
But the relay was brand-new...but I'll check into it...could the heat have made it prematurely wear out?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: zoomkat on Jul 07, 2012, 06:44 am

But the relay was brand-new...but I'll check into it...could the heat have made it prematurely wear out?


Is the relay rated for the garage door current requirements? Looks kind of small.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 07, 2012, 07:46 am
Ohhhhh. Didn't think of that. I'll check into that too. Thanks!
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 07, 2012, 04:12 pm
Well, i just looked at my garage door opener and it says 5 Amps. And this is the relay I'm using:

http://www.digikey.com/product-search/en?x=0&y=0&lang=en&site=us&KeyWords=pb874 (http://www.digikey.com/product-search/en?x=0&y=0&lang=en&site=us&KeyWords=pb874)

I assume that it's the contact rating (5A) that I care about? As opposed to the coil current (91mA)? If this is the case, is it still too small because it's exactly 5A and should have room for play...like 6 or 7 amps or something?

I have yet to replace it still and see if that 'fixes' it as that will take me a little more time, but I definitely want to try it today.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: PaulS on Jul 07, 2012, 04:36 pm
Quote
As opposed to the coil current (91mA)?

91mA is far too high to be driving directly from the Arduino. Are you using a transistor in between?

What is that blue stuff just above the Arduino? Looks like tape. Check all joints to make sure that they are securely soldered. Heat can cause them to work loose.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 07, 2012, 04:42 pm
Yes there is a transistor in between (the little silver-colored circular thing directly below the relay shown in the photo). The blue stuff is like a sticky putty...don't remember what you call it. It's keeping the gray, black, and red wires inserted in the Ethernet Shield because the board is mounted horizontally, so I didn't want the wires to work themselves out or fall out. I'll check solder joints too then. Thanks.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 09, 2012, 03:23 am
Ok, well I finally disconnected my device that is shown in the picture and brought it in to my room to test and look further. Strangely after I removed it from the wood backer and separated the shield, and put it all back together it seemed to work just fine all day long (in my room) (this was Friday). But even though it was working fine, I still added an LED/resistor to one of the pins on the Arduino and updated the code in the sketch to turn on and off that LED whenever it received a garage door open or close command. It all seemed to work fine (including the relay happily clicking away when it should) still in my room also with it happily turning on/off that LED whenever it received a close/open command from my Android. So I installed it back up in my garage near the opener and hooked it all up, and seemed to work all day (this was yesterday).

Then this morning it worked once, then it didn't work anymore. :( And what I dreaded may happen happened - the LED never turned on/off when I would send the open or close command. According to my 'deductive skills', this means that nothing is wrong with the relay/transistor or that pin on my Arduino, correct?. Which, in turn, means that I've got something else going on such as a problem with the Ethernet Shield maybe? Now I am very overwhelmed. I don't really know how/what to troubleshoot something as complex as that shield. :(

Any help/advice would be greatly appreciated...but please remember, I'm a noob, so the more detail, the better.

Thanks
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: PaulS on Jul 09, 2012, 04:43 pm
Quote
But even though it was working fine, I still added an LED/resistor to one of the pins on the Arduino and updated the code in the sketch to turn on and off that LED whenever it received a garage door open or close command.


Quote
but please remember, I'm a noob, so the more detail, the better.


That works both ways. "one of the pins" is not a lot of detail, I think you'll agree.

If if works on the bench, and not in the garage, then I would suspect a wiring issue.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 10, 2012, 06:39 am
Touche. You got me there. I just didn't think that it would be relevant, so I didn't mention that I put the new LED on Aruino pin 8 (so ATMega pin 14).

You know, it's funny. Shortly before you replied about the possible wiring issue, I remembered that I've been having another issue with another device. I purchased the parts for an OpenSprinkler device and put it all together last year, and have had problems with it ever since - from time to time it would just 'lock up' and i couldn't ping it or anything. It's driven me nuts for a long time and have not been able to figure it out...I just figured that it's something that I did (like something I broke while soldering everything in place). And I have an VoIP IP (PoE) phone that locks up from time to time. I just chalked the phone's problem to being cheap. But what I recently realized is that all 3 of these devices (the 3rd is my problem device that I'm most currently troubleshooting) are on the same switch - a NetGear 8-port (w/4 PoE ports) switch. So I'm wondering if this switch is bad.

What I did a few minutes ago is take that switch off of my network and moved things around to plug those devices into my other switches. So far, my garage door opener device is working great. (But that's how it usually starts off)

But we'll see, and I'll definitely be posting any updates (good or bad)...
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 11, 2012, 06:50 am
Well that sure didn't last very long. Today my device was having the same problem, right off the bat in the morning so it wasn't even that warm yet. So when I got home from work I tested the cable and it tested fine. I used an STM-8 (http://www.siemon.com/e-catalog/ECAT_GI_page.aspx?GI_ID=tt_stm-8 (http://www.siemon.com/e-catalog/ECAT_GI_page.aspx?GI_ID=tt_stm-8)) cable tester. All 8 conductors came back fine with continuity, and no wires were crossed or anything.

The only thing I can think of I can do next is 'modify' my circuit/device even further and wire up an FT232R breakout board (http://www.sparkfun.com/products/718 (http://www.sparkfun.com/products/718)) so that I can hook it up to my laptop in the garage via USB and start outputting to the serial monitor what it's receiving when I attempt to send command to open/close the door from my Android app.

Even if I do this, I wouldn't know what to do next regardless of what I find - if I find that for some reason that characters/packets/whatever are getting dropped, I wouldn't know what to do, or if it appears everything is coming through fine, wouldn't know what to do.

Am I going in the next logical direction though as far as the best thing to do to troubleshoot my problem? Or should I try something else / look elsewhere?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 12, 2012, 03:22 pm
I brought my device into my room, am powering it with  the same power supply (9V purchased from Sparkfun) and I have it on my desk vertically, just like when it's mounted/installed in the garage. (When I did all my testing in my room prior to originally installing into my garage I had it laying flat/horizontally). Should that even matter?

It seemed to work last night flawlessly (of course this was only over the span of a few hours), but I have a feeling it's not going to give me a problem in my room. Are there any other 'variables' that I should be looking out for?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jul 12, 2012, 03:38 pm
I don't know where you are, or the environment in the garage, but how hot is it in the garage where it is mounted?

Is there a specific time of day it starts to fail?

Just a thought...
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 12, 2012, 03:50 pm
I thought the same thing because I didn't start having the problem (had it installed, running successfully with no problems for a couple of months) until we had a really hot week upper 90s Fahrenheit. And I'm sure it's even hotter in my  garage.
(I live in the Bar Area, CA, USA)

However, it gives me trouble in the mornings sometimes too when it is not hot at all - maybe like around the 70s.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jul 12, 2012, 04:00 pm
Considering the location, how is the humidity in the garage?

How about the mains power in the garage? Any chance that could cause a problem? Like big power-eaters closeby? A/C or the like that would cause voltage spikes or sags?

How about the garage door opener motor? Is that closeby? Maybe a shielded box might help?

There has to be something different if it does ok inside and not in the garage.

Just another few thoughts...

edit: How about the CAT5 cable? Is that run into the house? If the connection breaks, that could cause the ethernet shield code to lock up if not written correctly. Maybe a timeout routine on the connection?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 12, 2012, 04:55 pm
I don't know the humidity in the garage...I think I'm going to stop by and by a thermostat on the way home and install it in the garage.

I'm pretty sure all the big guys - AC, Heater, Furnace are all on separate circuits. The furnace/heater/blower is inside the garage, but I'm pretty sure on a separate circuit. I do have a medium sized freezer inside the garage, but that might be on a different circuit, but I can check when I get home if you think that might be a problem.

I do have a lot of network/phone/security devices running on the same circuit inside the garage however. Would this cause a problem?

Yes, the garage door opener itself (the main unit with motor I guess) is pretty close by, yes. So this could cause a problem even if the motor is not 'spinning'? If so, maybe that's it! How far away does it need to be? When my device is mounted in the garage, it's probably within 12" or less of the actual opener/motor.

No, the CAT5 cable is running to my network equipment within the garage, and I tested it already - tested ok.

Maybe you could elaborate more or send me somewhere that would have more information on the proper code procedure to handle a possible broken connection?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jul 12, 2012, 05:45 pm
I haven't seen your code, but here is mine.

The first downloads Google home page every 10 seconds, but has no timeout.
http://arduino.cc/forum/index.php/topic,99629.msg754629.html#msg754629

Here is the timeout code for the Google code above:
http://arduino.cc/forum/index.php/topic,102879.msg778413.html#msg778413

You must put them together. Shouldn't be that difficult. I did it.  ;)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 12, 2012, 06:35 pm
Thanks for the code links...

Any thoughts on my replies to your questions? Particularly the proximity of my device to the actual garage door opener?

Thanks.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jul 12, 2012, 06:51 pm
It would be best for you to post your code. This is your project, and I don't know how you are doing things. If I can take a look, maybe I can help.

I would test it a piece at a time. Try it in the garage not connected to the motor. Does it still fail? It isn't connected to the motor in the house, is it?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 12, 2012, 07:19 pm
A link to my code on pastebin is in my first posting, but here it is:

http://pastebin.com/P86C7ifZ (http://pastebin.com/P86C7ifZ)

Ok, I see...thanks. I will install it back into my garage this evening, but not hook up the wires that connect to the actual opener.

You're right - when it's in my house, no it's not connected to the opener.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 20, 2012, 06:21 pm
Well, it seemed to have worked well back in the garage without the 2 wires connected to the garage door opener for several days, but it stopped working again. :(

So should I physically move the device further away from the actual opener?

Would being plugged into the same power strip/outlet pose a problem?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 26, 2012, 03:24 pm
Shortly after my last posting (the one on the 20th of July), I decided just to try and move the power cords around to see if that would help (but still keeping the wires that goes from my device to the actual garage door opener disconnected). The existing setup was as follows:

I have an electrical outlet on the ceiling of my garage. I have a power strip/surge protector plugged into one of the 2 'plugs' of that outlet. I have my actual garage door opener plugged into that power strip/surge protector, and my 'device' plugged into the same power strip.

My change that I made on the 20th:
What I did was unplug the actual garage door opener from the power strip/surge protector and plug it into the 2nd 'plug' of the outlet on the ceiling (so no longer on the power strip/surge protector), leaving my device plugged into the power strip/surge protector all by itself.

5 days later (yesterday), I started experiencing the same problem as I described in my very first posting of this thread, so my change did not seem to help. :(

I guess my next test would be to move my device physically further away from the actual garage door opener as hinted at by SurferTim...I will do this this evening.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jul 28, 2012, 12:33 am
Well that didn't really help (moving the device physically further away from the garage door). Now I'm going to run an extension cord from my device to another outlet in the garage, and we'll see how that goes.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Aug 02, 2012, 06:46 am
Messed up again last night. :( So I unplugged the two wires that are leading to the magnetic/reed switch...we'll see how that goes.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: dee3 on Aug 06, 2012, 02:59 pm
Hi Domiflichi,
Seems like to me you spent so much time troubleshooting the circuit, perhaps it would take lesser time to build a new circuit  :) parts are cheap and arduino is reusable, might just work that way (and maybe enclose it in a protective casing?) and you get to keep the old one as a relic.
Ps, sent a message  in your pm.
Cheers
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Aug 07, 2012, 05:46 am
Well, I am almost down to nothing else to test. It messed up yesterday. What I did when I got home from work this evening is I ran an extension cord (actually I have to have 2 in order to reach) from my device (still in the garage) to inside my house, in my room where I was testing it. I actually plugged it into the same exact power strip that it was plugged into when it was working inside my room.

So if it fails again, the only thing I have left that I can do is run a network cable from the device in the garage to my room and plug it in the switch that it was plugged into when it was in the room working.

(Just thought I'd give another update)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: ScottG on Aug 08, 2012, 03:12 am
Wow, you've done a lot of debugging so far.  You mentioned humidity as a potential problem. This is probably a long shot, but maybe the wood is absorbing moisture and causing a problem.  Do you have plastic stand-offs you could use to keep the circuit board from touching anything.  Another thing you might try is heat things up with a blow dryer - not too hot though - and see if things start failing.  You could also plug it into a UPS to make sure you have nice clean power.
Any chance the problem is with the garage door and not your circuit?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Aug 08, 2012, 09:30 pm
Tell me about it, I just wish this thing was figured out and working.

I'm sure I can find some sort of plastic standoffs for the board to be away from the wood.

If I do the blow dryer thing, won't that only tell me if heat is an issue? I don't think that's the problem anymore as my device has problems in the (cool) mornings sometimes, not just the (hot) afternoon/evenings (although it seems like the problem rears its ugly head more in the late afternoon/evening).

That UPS thing is a good idea...I purchased an OpenSprinkler device from Rayshobby.net (actually I sourced all the parts online from Digikey and Mouser and just bought the circuit board from his site), soldered it all together and have had problems with it locking up and other weird things every 1-3 weeks. Ever since I put it on a UPS, I haven't had any problems with it. Or  maybe it was after moving the ethernet cable off of the PoE switch, I can't remember.

The garage door can't be the problem as my device has been messing up even when it's not connected to the garage door.

If my 'current' test fails, and my 'last' test fails, I will try one or more of your suggestions.

Thank you for the new ideas.

And thank everyone for all their help so far. This is a great forum.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Aug 27, 2012, 03:28 pm
Nothing really new to report yet as I keep having to pull the power to my device for various reasons...although I haven't had to do it because of it misbehaving, so maybe the power in my garage could be the problem...don't know yet.

In the interim, I wanted to post a few pictures that may give more insight into my garage and my project.

First, here is the back of my board...I don't know if the way I made all those connections to +5V and GND are good practice (see the top area...I left a little bit of insulation on my +5V and GND bars to tell me which one is which):
(http://domiflichi.hopto.org/images/AAGDOpenerBackOfBoard-1.jpg)
(Note the length of the 2 bare wires...is that bad?)

Next, I noticed that around the solder joints/points of the Ethernet Shield seem to be 'dirty':
(http://domiflichi.hopto.org/images/AAGDOpenerBackOfEthernetShield-1.jpg)
(Would that cause a problem?)

This is a small (or maybe medium) sized freezer I have plugged into the garage:
(http://domiflichi.hopto.org/images/AAGDOpenerSmallFreezer-1.jpg)
(Not that big, but could it be a problem?)

Lastly, this is my wall of network, telephone, security equipment (and there are 2 'servers' that you cannot see that I have plugged into the same outlet):
(http://domiflichi.hopto.org/images/AAGDOpenerNetworkPhoneSecurityStuff-1.jpg)
All that stuff is all plugged into that 1 electrical outlet just below my electrical panel.

I don't know if the garage door opener (and my device) are actually on the same circuit as all that stuff (or the freezer), but it might be. (It seems like it would be since it's all in the garage, but I'm not going to make any assumptions)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Aug 27, 2012, 03:50 pm
Are you still using the 9v wall wart from Sparkfun? It is regulated (switching) to 9V output as long as the input is greater than 100vac. Is it possible the refrigerator and/or some other device (A/C?) is causing the line voltage to sag below 100v long enough to shut down the regulator momentarily?

An o-scope would be really helpful at this point.

add: I noticed you even moved the power to your room where it worked, and it fails in the garage. Just out of curiosity, do you have a memory card in the microSD slot? You had mentioned in your code posted that you had planned to use the SD card to log stuff.

Your code appears to have no timeout function if the connection breaks (not closed). That could cause it to fail.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Aug 27, 2012, 05:27 pm
Hi SurferTim,

Yes, I'm still using the same 9V wall wart from Sparkfun...that has not changed. Maybe the refrigerator, I don't know. I don't think it's the A/C because the problem started happening way before we started turning on the A/C this summer.

I don't have an oscilloscope, nor do I know how to use one. :(

Correct - moving the power to my bedroom is the latest thing I've done, and haven't had a problem since (although I've had to pull the power a couple times as I mentioned, so this 'test' hasn't actually ran for much more than a week a time). No card in the SD slot.

Yeah, I remember ?you? or someone mentioning that about my code. I'll have to look more into that.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: wolfgang42 on Aug 27, 2012, 05:44 pm
One thing that nobody else has suggested--is it possible that the orientation of the circuitry is affecting the connections? I notice that the board is upside-down on your ceiling, but I presume that when you take it down to test it, you're putting it right-side up on your workbench. Perhaps a connection is coming loose when it's upside-down but falls back into place when it's rightside-up?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Aug 27, 2012, 05:46 pm
Actually the board is vertical in the garage. But I tried it vertical in my room, and never had the problem, and tried it horizontal in the garage, and still had the problem. I did actually think of that one too.

Thanks for the idea!
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Nov 17, 2012, 08:43 pm
Could fluorescent lighting (I have 3 separate fluorescent lights) cause the problem?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: wolfgang42 on Nov 17, 2012, 09:43 pm
I think fluorescents (or their ballasts) create RF interference, but I don't know whether it would be enough to disrupt an Arduino. Are you using servos or other libraries which use hardware timers?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Nov 17, 2012, 11:07 pm
I don't think so - I'm using the 'Ethernet' and 'SPI' libraries.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: wolfgang42 on Nov 17, 2012, 11:25 pm
Fluorescent lights might cause trouble anyway, I don't know. I'm asking because I had some trouble with a project which wouldn't run on mains power, but ran on a battery or from USB. Other projects (such as the blink project) ran fine on mains power. I eventually discovered that the transformer I was using wasn't filtered and it was introducing just enough noise to break some, but not all, parts of the chip.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Nov 18, 2012, 12:15 am
So was the transformer that you are referring to powering your Arduino? How do you know it wasn't filtered? How did you filter it? Or did you buy a new known filtered one? If so, which one specifically?

Thanks
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: wolfgang42 on Nov 18, 2012, 12:27 am
Yes, the transformer was powering the Arduino. I hooked it up to a speaker and got some humming--if it's filtered you shouldn't be able to hear anything. I believe you can filter power supplies by using a capacitor, but in my case I just left it hooked up to my computer or ran it off of a 9V battery. (It wasn't a project meant for long-term unattended use.)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: dswan75 on Nov 19, 2012, 02:30 am
Florescent lights do emit a RF signal that could possibly be harmful. Does your networking cable run near these lights? I am a amateur radio operator and i know that the ballast in those lights can cause audible noise on certain frequencies.... but will also create unwanted "noise" in data cables.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: Hugepedlar on Nov 19, 2012, 08:25 am
Definitely run it off a battery, assuming you have one that will last several days. Clean power is important.

I haven't looked at your code but have you checked for memory leaks? If you use the String functions you might be leaking memory. There are sample code snippets out there that you can drop in to report free memory. That might help with debugging.

Connect it up to a serial monitor (eg laptop) and get it to send you diag info regularly. Make it print out the value of one of your variables at regular time intervals. Note what happens when you send it a failed command. Does the output pause? Does the value of that variable make sense?

Checking for humidity: if you can't measure humidity easily, package your board up into a plastic box, sealed as best you can, and put a packet of Do Not Eat in there to absorb as much moisture as possible.

Since you have apparently had it working in the garage for up to five days, the fact it seemed to work fine in your room is not to be trusted. The fault is so intermittent that you'd need to run it for several weeks before you can be reasonably sure it is ok.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Nov 22, 2012, 09:59 pm
Shown below is my device, installed in my permanent location, and circled in red. Also notice the 3 fluorescent lights, which I believe is on the same circuit.
(http://domiflichi.hopto.org/images/GDCInstalled-1.jpg)

This image shows where the Ethernet cable crosses the electrical cable for the lights. I've always understood that as long as they cross like this (are perpendicular), it's ok...you just never want to have them running in parallel.
(http://domiflichi.hopto.org/images/GDCInstalled-2.jpg)


I currently have it connected to an extension cord (orange, hanging down) which as I mentioned in a previous post, goes to inside my house, and it works fine when connected like this. However, when I have it plugged into the black power strip (where I want it to be plugged in long-term/permanently), I have the problem previously mentioned.

Anyway, in answer to your question, dswan75, the ethernet cable does run within a couple of feet of the middle lights, but I don't know if it's an 'air'/'airwave' problem...it seems to be inside the actual electrical lines themselves that's going into the power of my device wouldn't it? Because again, that ethernet cable never moves through my testing.

@Hugepedlar - I don't know if I have a battery that could power it for very long...a 9V wouldn't last very long, would it?

I don't know how to check for memory leaks yet. I still tend to think it's a hardware issue, but I will look into it. Yeah, I've been thinking of hooking it up to the Arduino serial monitor, but have been putting it off as I will have to modify the circuit in order to be able to do that I think.

I'll see if I can find something like that to put the project in.

Well when I had it in my room, it did work for weeks if I remember right. And when I have the device in the garage, and the power running to inside the house (in my room specifically), it worked for weeks also.

Thanks everyone so far...maybe the pictures will reveal something I'm missing...
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: wolfgang42 on Dec 09, 2012, 05:20 am
See http://makeprojects.com/Project/Instant+AC+Power+Filtering/2922/1 (http://makeprojects.com/Project/Instant+AC+Power+Filtering/2922/1) for a quick way to filter your power supply. If it's a power problem, that should fix it.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: Build_it_Bob on Dec 12, 2012, 01:44 am
Looking at the picture the screw heads that you used may be shorting traces on the circuit board. This would have taken time to wear through the silk screen . remove the screws and use a wire tie ( or plastic stand offs ) to hold the board and re-test. if it works reliably , you can use plastic standoffs to fasten the board securely. I use #4-40 standoffs with a small #4 lock washer and the screw heads don't touch any traces on the board.

Hope this helps !
Build_it_Bob 
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Dec 23, 2012, 09:11 pm
@wolfgang:
I followed your advice on using another capacitor - I bought one of these 1.0µF capacitors from digikey (http://www.digikey.com/product-search/en/capacitors/aluminum-capacitors/131081?k=P1196), and soldered it in near my other 2 caps and voltage regulator:

Back side, soldered in, before clipping leads:
(http://domiflichi.hopto.org/images/GDCNewCapCircledRear-1sm.jpg)


And front:
(http://domiflichi.hopto.org/images/GDCNewCapCircledFront-1sm.jpg)

(So I'm not sure if this is the right place to have put the new capacitor, but that's where it is)



When done, I put my device back in the garage, and hooked everything up and plugged it into the power outlet in the garage that I originally had it in, and so far no problems. But it's also colder now (still don't know if the weather matters), and it's only been about a week or week and a half at most, so I don't know if my problem has been resolved or not, but I sure hope so! I will definitely keep you all updated.



@Build_it_Bob:
Thank you for the suggestions...I think someone else suggested I do the same, but haven't yet as it doesn't seem like it would cause the problem I'm having (and on my board, the screws are nowhere near any electrical connections)...especially since my problem has been seeming to be a power problem. But I will definitely keep your suggestion in mind for future reference and implementation.

Thank you all so far.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jan 09, 2013, 03:26 pm
Well after a few weeks of successfully running, I had the same problem again. :( It did seem to run longer than usual without messing up, but I did power cycle again, and let it run again, just to see if it was a fluke, and it happened again. Then again. So I don't know if it lasted longer because of the newly added cap and/or just because it's been colder, but that didn't fix it.

Trying to collect my thoughts and figure out what to do next...any more suggestions welcome. :)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jan 09, 2013, 05:57 pm
Have you considered isolating the power supplies and using opto-isolators on the interface to the proto board? You could drop the common ground, which could be causing your problem.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jan 09, 2013, 06:26 pm
Whoa that was way over my head...could you maybe dumb that down a bit for me? ;)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jan 09, 2013, 06:37 pm
No problem!  :)

Sometimes electric stuff is really noisy on the ground connection. That is where all this spike and sag stuff is being sent from those caps you just installed. You can power the Arduino with one wall wart, and the proto board with another wall wart. The grounds for each system can be separate.

Here is a datasheet for a standard optoisolator (optocoupler).
http://www.vishay.com/docs/81587/vom452t.pdf
Note the grounds are separate.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jan 10, 2013, 09:20 pm
Actually my Arduino is my proto board...if you look at the top photo of my very first, original posting (on page 1) of this thread, you'll see that the proto board is basically my Arduino. The professional board to the right is just an Ethernet Shield which is receiving power from the 'Arduino/proto board'.
So with that, are you saying that I should power the Ethernet Shield separately somehow?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Jan 10, 2013, 10:14 pm
What is this doing? What are the red and black wires in the screw connectors? What do they do? What is the blue cube in the upper right corner? What does it do? It isn't a relay or anything inductive like that, right?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Jan 11, 2013, 05:34 am
My device (as I call it...which consists of the circuit on the proto board and the ethernet shield) allows me to open/close my garage door remotely via my Android phone.

The top pair (heavier gauge of red/black) of wires go to a reed/magnetic switch. (This and a magnet on the actual garage door, allow me to see the status of the garage door via my app - open/closed).

The bottom pair (lighter gauge of red/black) of wires run to my automatic garage door opener (specifically, they're connected to the same 2 terminals that the 'hard button' is connected to. You know, the button that you usually have near the door that leads from your house into your garage).

So the ethernet shield on the right obviously allows me to connect to the Arduino remotely (whether via my internal network or the internet), and open/close the door (and to check the status of the door).

The 'blue cube' in the upper right corner - it does happen to be a relay, yes. The relay is electrically connected to that 2nd blue screw connector where the thinner pair of red/black wires are leading out of. Which in turn, is connected to the automatic garage door opener that I just mentioned. So this does the actual opening/closing of the garage door.

I'm not 100% sure of where you're going here, but remember this strange thing:
It seems that I can have my device plugged into any power outlet in the garage and I'll have the same problem (eventually) (The reason I started this thread). However, as I mentioned in an earlier post, I learned that if I run an extension cord from the garage into a bedroom in my house and plug my device's power into that, I never seem to have the problem (at least after several weeks of testing).
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Mar 04, 2013, 03:56 pm
Hello all,

I have a possible interesting update on my project. On February 3rd, I put my device onto UPS power instead of just a cheap surge protector. It's an APC Back-UPS 650. And I haven't had one problem with my device since.

Maybe it's too soon as it's only been a month, but it sure is looking good so far...

(What does this suggest? What could I add as far as more active/passive components to my device so that it does not have to be on a UPS, if this is in fact solves my problem?)

Thanks. :)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Mar 04, 2013, 04:11 pm
That suggests you need good power. I would have answered sooner, but I just now explained to the property manager of one of the condos I service that had a wireless fail this morning, that even a $300 router needs to be plugged in to work correctly.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Mar 04, 2013, 06:11 pm
So  there's nothing I can do/change on my device (i.e. add more caps or something) to make it more 'stable'? (Easy/cheap route?)

What kinds of things can I do to improve my home/garage power? (Difficult/dangerous/expensive route?)

Wait - so the router wasn't even plugged in? That's crazy!

(Thanks for the reply)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Mar 04, 2013, 06:46 pm
Skinware (humans) is unpredictable. The maid comes in to vacuum, and needs power. The plug available (controlled by a wall switch) was off, so the maid moved the router's cord to the switched plug so she could vacuum.  :(
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Mar 04, 2013, 07:03 pm
Yikes!
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Apr 01, 2013, 03:11 am
Still so far so good...it's been 8 weeks that I've had my device connected to a UPS and not a single problem.
(See my reply #53)
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Apr 01, 2013, 03:41 am
Thanks for the info. It is good to hear that fixed it for you. That may help someone else.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on Apr 18, 2013, 03:39 pm
Well, I guess I spoke too soon. I had to power-cycle my device again last Friday (April 12th). :(

I don't know what's going on in my garage, but it must be pretty bad. I think I mentioned it before, but I've had to power cycle some of my other electronic devices in the past. For instance, I have a network-enabled sprinkler system controller that I bought from rayshobby.net that I was always power-cycling, but after I put it on a UPS, I only have to power-cycle it only every couple of months. And come to think of it I have to power cycle my router and my network switches once in a while too.

This is really making me think that there's nothing really wrong with my device and that it's purely the power in my garage. Is there anything I can do to correct the power in my garage/house?
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: SurferTim on Apr 18, 2013, 03:46 pm
Your timing is good. I found a problem with the server code we were using. Here is a thread that covers a lot of this without having to duplicate all that.
http://arduino.cc/forum/index.php/topic,160048.msg1200379.html#msg1200379
and
http://arduino.cc/forum/index.php?topic=160912.msg1206332#msg1206332

Here is the server code with the timeout applied.
http://playground.arduino.cc/Code/WebServerST

Maybe that will take care of that pesky crash.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: Sprocketq on Jun 17, 2013, 03:53 am

Well, I guess I spoke too soon. I had to power-cycle my device again last Friday (April 12th). :(

I don't know what's going on in my garage, but it must be pretty bad. I think I mentioned it before, but I've had to power cycle some of my other electronic devices in the past. For instance, I have a network-enabled sprinkler system controller that I bought from rayshobby.net that I was always power-cycling, but after I put it on a UPS, I only have to power-cycle it only every couple of months. And come to think of it I have to power cycle my router and my network switches once in a while too.

This is really making me think that there's nothing really wrong with my device and that it's purely the power in my garage. Is there anything I can do to correct the power in my garage/house?



In south west Florida they have really dirty power. I have customers with routers not on UPSs loose their configs all the time. For areas with bad power like that, I always recommend higher end APC UPS like Back-UPS Pro that has power conditioning, not only power loss support (corrects for over voltages and under voltages). That would of been one of my first steps after you stated that you have to reset network gear every so often.

I would also use a packet sniffer (wireshark) to confirm everything is working on the network side of the app.
Title: Re: Sudden unreliability with my network-enabled Arduino project
Post by: domiflichi on May 09, 2015, 07:50 am
Well after almost 2 years, I've found the problem of my issue!

The culprit(s)?:

(http://domiflichi.hopto.org/images/AccessPointResizedSm.jpg)

and/or

(http://domiflichi.hopto.org/images/ApplianceLincResizedSm.jpg)

(These are a couple Insteon smarthome Devices)


I don't know why I didn't think to try it sooner, but a few months ago, I just decided to pull the above 2 devices (sorry I don't know which one of the 2 is actually the cause of the problem, but once I do, I'll try to report back if anyone is interested) out of commission in my garage to see if anything improved. Sure enough, I had no problems with it after I removed them.

I created a post on my blog (http://jamienerd.blogspot.com/2015/05/source-of-electronics-woes-in-my-garage.html) that talks about this a little more, but that was it! I just thought that everyone who helped me out with this deserves to know, and anyone who may have the same 'setup' as me may benefit from knowing this too.

Thank you very much to all who generously helped me out in troubleshooting this long-standing problem!