This is the hardware set-up at home,
Raspberry Pi GPIO -> Logic Level Converter -> Arduino -> Multiple Relays
enter image description here
I am running Raspbian and NodeJS on the Pi while the Arduino is loaded with StandardFirmata.
I connect NodeJS to the Arduino with the johnny-five
package and it works well after it's started. But after extended periods, a few hours? The Arduino stops responding. Whatever command that I send to the Arduino won't be acted on. It's as though as the Arduino hung.
Both the Raspberry Pi and Arduino are being powered indenpendently with a 1A Nokia USB Adapter.
Does anyone know why this is happening?
-
Also, please add links to all the products you are using. I don't know what "Johnny-Five" is aside from a robot from an 80s movie. Same with "StandardFirmata".Connor Wolf– Connor Wolf2014年12月24日 08:48:30 +00:00Commented Dec 24, 2014 at 8:48
-
Also, the details on the RPi code, as well as (ideally) pictures of how you have everything hooked up.Connor Wolf– Connor Wolf2014年12月24日 09:07:35 +00:00Commented Dec 24, 2014 at 9:07
-
3You might want to consider posting your code, otherwise every answer here will be a guess at bestOmer– Omer2014年12月24日 09:31:52 +00:00Commented Dec 24, 2014 at 9:31
-
Very often, if Arduino hangs, this is a memory problem (typically collision between the heap and the stack). It's gonna be hard to diagnose the actual issue without the source code of the program you downloaded to Arduino!jfpoilpret– jfpoilpret2014年12月24日 10:18:52 +00:00Commented Dec 24, 2014 at 10:18
-
Hav you check that your Arduino still works properly with usual programs (blink in particular). You first need to find out if it is a hardware issue (pin or MCU fried due to too much current switched through the relays) or software.jfpoilpret– jfpoilpret2014年12月24日 10:20:57 +00:00Commented Dec 24, 2014 at 10:20
1 Answer 1
If none of the code is yours, and all code from the Firmata library, then the most possible cause that comes to mind after reviewing the library code is memory leak, which makes the next allocation to fail and by thus breaking the code.
The Firmata library does perform dynamic memory allocation, checkout Firmata.c, so it is realistic - I would suggest to take it with the Library's author.
-
2Yeah. None of the code on the Arduino is mine. It's all Firmata's. So it's probably Firmata?Zane– Zane2014年12月24日 20:14:33 +00:00Commented Dec 24, 2014 at 20:14
-
1logically, it must be. Perhaps they didn't take into account running indefinitely.Omer– Omer2014年12月24日 22:24:17 +00:00Commented Dec 24, 2014 at 22:24