Arduino controller

danlu_gt

ReeFi Lab
How many of you have some kind of Arduino controller for your tank? I'm the process of programming the Mega with TI CC3000 WiFi shield. Got it mostly working. Tonight after I added Kalk reactor to my ATO, my arduino decided to freeze during ATO mode and dump too much kalk into my tank.

How reliable is the arduino & WiFi shield. Anyone else experienced freeze? Is there a way to put an external reset if arduino becomes unresponsive?
 
I use Arduinos everywhere in my home, including my tank. However I do not use the WiFi shield. I would look at maybe you have something hanging in one of your loops that is causing the freeze, or could be just a bug. Post a copy of your code, and i'm sure others would be willing to help you out.
 
I use an arduino controller and have had it freeze twice. Both cases were programming issues and it's been stable ever since.

I haven't implemented the watchdog code yet, but I plan to do so on my next iteration.
 
I'm pretty sure my code is fine. I'm thinking it might be the power supply (300ma) not have enough current for all the sensors. But would really like to know if it's common for arduino to continuous running for months? Years?

The other suspect is the cc3000 WiFi shield. I'm running an UDP server to listen for commands. Since Arduino cannot multitask, I have server timeout if not response after sometime so it can run other tasks. In cc3000 docs, it mentioned to close connect or bad things can happen. Those of you using WiFi or Ethernet, how do you overcome server listening issues?
 
Could be a lot of things. If you're running motors through the arduino, you could be drawing too much current through the power supply causing problems.

Or it could be the code. Or it could be the shield. Or it could be a wire that's shorting things out. Or it could be a memory problem.

This is the problem with making your own controller - you have to be darned sure it is well designed and debugged, otherwise things like this can happen with disastrous consequences. There's a reason that commercial controllers (and everything else, for that matter) cost more than the sum of their parts.

One way to potentially reduce problems would be to actually run the pumps off a separate power supply with their own timer . Configure the timer to run for X seconds every time it gets a pulse from the arduino, then if arduino locks up, the pump will still stop. There are many other ways, too. The key is to have some redundancy and backups for the possible problems that may happen.
 
I guess I would like to get a survey of how many people who have been running Arduino continuously with freeze and for how long.

Also, I think I figure out one potential loop lock in the code. If it loose Wifi connection, then tries to re-start server, then it will be stuck in a loop lock. I caught this by accident when I noticed by laptop Wifi lost connect when my microwave was on. Hope this tip bit will help others using Wifi shield.
 
I guess I would like to get a survey of how many people who have been running Arduino continuously with freeze and for how long.

And Arduino is just like any other microprocessor/controller.. It will last for a LONG..LONG..LONG time..

It is NOT common for them to just "freeze".. Its more than likely a problem in your code.. especially if it does it at the same place each time. or the physical wiring or it could be noise related.. Does it always happen at the same time?
 
Unless you have a bad unit, it's not the Arduino itself - the Reef Angel controller is based on Arduino and plenty of people are very happy with it. I've never used it, but I've never heard of people needing to reboot it every week.

What you describe is a classic bug - the controller gets into a situation that you didn't anticipate with the code and then acts in a way you didn't expect.
 
I guess I would like to get a survey of how many people who have been running Arduino continuously with freeze and for how long.

Also, I think I figure out one potential loop lock in the code. If it loose Wifi connection, then tries to re-start server, then it will be stuck in a loop lock. I caught this by accident when I noticed by laptop Wifi lost connect when my microwave was on. Hope this tip bit will help others using Wifi shield.

Lots of folks using Arduino for long term projects. I had one running over a year on my old tank with no issues.

Freezes are almost always code issues. Hardware issues like pulling to hard on a regulator or a voltage spike or something like that will usually cause a reset or at worst some crazy activity. But a lockup is almost always code. And it sounds like you may have found the issue.
 
Thanks for the feedback...
In case anyone interested... Figured out what was going on.. There's a bug the TI CC3000 WiFi firmware that prevents it from setting IP from dhcp upon reconnect. Found solution on TI forum... Need to set static IP, submask, gateway, etc to all zeros to force DHCP mode. Now, I can reconnect after WiFi signal lost from using the microwave. :)
 
I was sort of worried about freezes/hanging/etc when I first started thinking about using my own Arduino controller.

I've been using one now for almost 1 year with no issues; using for top off and water change pumps and floats, temperature measurement, led dimming/control, and cooling fans.

I don't use the ethernet shield though, I'm using a simple bluetooth on Serial1 on the mega, all my UI is serial.

I've been watching the Yun, hoping the price goes down, then I'd switch to ethernet/wifi...
 
Unless you have a bad unit, it's not the Arduino itself - the Reef Angel controller is based on Arduino and plenty of people are very happy with it. I've never used it, but I've never heard of people needing to reboot it every week.

What you describe is a classic bug - the controller gets into a situation that you didn't anticipate with the code and then acts in a way you didn't expect.

I have one. I never have to reboot it.

Use it to dim via pwm, stop pumps to feed, two relays control wave movement, ph, and um, a weather timer in there that makes everything go ape sh!t at least once or twice a month (all power heads on, dim lighting).

Very good product.
 
Not sure if it helps for this particular issue, but you can add a function to report memory use:

int freeRam ()
{
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}

I watched this at first just to make sure it didn't change...
 
Back
Top