Arduino running for more than 2 years, Will it hang?

Dear community, I am developing a sensor system with arduino. It will be working for at least 2 years. What are the possibilities it will hang while operating? How can I make sure the system will be always working properly? I read that with a second arduino can be possible to monitor the status of a first one to make a reset, or perhaps using a watch dog timer. What is your thought on it? How was your personal experience working with an arduino for so long? Thank you very much, Luis

It mostly depends on having a good power supply, but there's no reason it won't run that long (it's not doing anything after a year that it didn't do in the first ten seconds).

The AVR chips have a watchdog timer that can automatically reset them if they crash but I think the Arduino bootloader can't handle the reset properly (it didn't when I last tried it). If you want to use the watchdog you might have to get rid of the bootloader and program via the little six-pin connector instead.

(Or use a second Arduino...they can watch/reset each other, although whatever causes one to crash might crash the other one as well :) )

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Your other, almost identical, post deleted.

  • Moderator

LuisArduino: I read that with a second arduino can be possible to monitor the status of a first one to make a reset, or perhaps using a watch dog timer.

Yes but what if the monitoring Arduino fails rather than the real one?

As for time, I have my Arduino RFID home-security system working for a number of years now. It failed once during a brown-out, which I hadn't allowed for (too lazy).

[quote author=Nick Gammon link=topic=180311.msg1336594#msg1336594 date=1375265109] Yes but what if the monitoring Arduino fails rather than the real one? [/quote]

Who watches the watchers...?

(Add a third one - just in case!)

It's probably not difficult to add a capacitor or something to reset the chip if you don't keep pulsing it in your main loop.

But... better to use the built-in watchdog. That's what it's for.

(PS: Anybody know it the latest bootloaders still crash on a watchdog reset? It's a bit of a problem...)

Hi Nick, Thanks for your message. However my other question (erased) wasnt answered. How do you monitor the first arduino with a second one? with the Atiny? Have you done it? Can you explain how if so? What about when the time is longer than 8 s for the reset. Lets say 30 seconds? Thank you, Luis

LuisArduino: Thanks for your message. However my other question (erased) wasnt answered. How do you monitor the first arduino with a second one? with the Atiny? Have you done it? Can you explain how if so?

This question?

How can I use the Attiny to reset the arduino? can you please give me more ideas? how would it work?

No I haven't done that. Well, not exactly.

Something as simple as sending pin low or high to signal an issue? (and visa versa to confirm?) or softwareSerial will do the job at 5v without an external crystal on the attiny85

LuisArduino: Hi Nick, Thanks for your message. However my other question (erased) wasnt answered. How do you monitor the first arduino with a second one? with the Atiny? Have you done it? Can you explain how if so?

The first one has to output a regular signal on a pin to show the main loop is running. The second one watches that signal.

(This is called "patting the dog" - watchdogs need regular patting)

LuisArduino: What about when the time is longer than 8 s for the reset. Lets say 30 seconds? Thank you, Luis

Why would you want that? A crash is a crash.

fungus: Who watches the watchers...?

A point of some particular interest at present. :)

[quote author=Nick Gammon link=topic=180311.msg1336594#msg1336594 date=1375265109]

LuisArduino: I read that with a second arduino can be possible to monitor the status of a first one to make a reset, or perhaps using a watch dog timer.

Yes but what if the monitoring Arduino fails rather than the real one?

As for time, I have my Arduino RFID home-security system working for a number of years now. It failed once during a brown-out, which I hadn't allowed for (too lazy). [/quote]

Hi Nick, Thanks for the information. So in your RFID home security system you never used a WDT or something similar? Thank you again, Luis

fungus:

LuisArduino: Hi Nick, Thanks for your message. However my other question (erased) wasnt answered. How do you monitor the first arduino with a second one? with the Atiny? Have you done it? Can you explain how if so?

The first one has to output a regular signal on a pin to show the main loop is running. The second one watches that signal.

(This is called "patting the dog" - watchdogs need regular patting)

LuisArduino: What about when the time is longer than 8 s for the reset. Lets say 30 seconds? Thank you, Luis

Why would you want that? A crash is a crash.

Hi Fungus,

I thought 30 seconds because the arduino is taking measurements as a shortest interval at 30 seconds. So if I know that after 30 seconds no measurement was taken, it will reset the arduino. will still work? Thanks, Luis

LuisArduino: I thought 30 seconds because the arduino is taking measurements as a shortest interval at 30 seconds. So if I know that after 30 seconds no measurement was taken, it will reset the arduino. will still work?

That depends on what "it" is.

all it takes is a small memory bug which may only occur every now and then to build up over months... your code maybe flawless but are all the libraries imported the same?

otherwise yeah it could crash...

cjdelphi: all it takes is a small memory bug which may only occur every now and then to build up over months...

Oh, yeah. Don't use malloc() or "String".

Is using a second arduino, better than using a 555 ic ?

fungus: But... better to use the built-in watchdog. That's what it's for.

(PS: Anybody know it the latest bootloaders still crash on a watchdog reset? It's a bit of a problem...)

Not sure about the bootloader, but if there's any question, I'd probably use the watchdog and eliminate the bootloader. I might just do that anyway even if there wasn't a question.

[quote author=Jack Christensen link=topic=180311.msg1337162#msg1337162 date=1375292220]

fungus: But... better to use the built-in watchdog. That's what it's for.

(PS: Anybody know it the latest bootloaders still crash on a watchdog reset? It's a bit of a problem...)

Not sure about the bootloader, but if there's any question, I'd probably use the watchdog and eliminate the bootloader. I might just do that anyway even if there wasn't a question. [/quote]

Me too.

(In fact I already suggested it)

fungus: [quote author=Jack Christensen link=topic=180311.msg1337162#msg1337162 date=1375292220]

fungus: But... better to use the built-in watchdog. That's what it's for.

(PS: Anybody know it the latest bootloaders still crash on a watchdog reset? It's a bit of a problem...)

Not sure about the bootloader, but if there's any question, I'd probably use the watchdog and eliminate the bootloader. I might just do that anyway even if there wasn't a question.

Me too.

(In fact I already suggested it)

[/quote]

my bad. :blush: