Dragino Yun Shield Reboots After One Minute

I've got a Dragino Yun Shield on top of a Mega 2560. It's mostly working well. A major annoyance is that when I power it and the Mega on, the Mega starts right up, gets to Bridge.begin(), waits about 55 seconds, then continues on with the sketch. 20 seconds after that, the Mega resets.

I've searched long and hard in /etc/rc.d and elsewhere for what could be causing the reset. On the Arduino Yun, /etc/rc.local has a "reset-mcu" line to comment out if you want Linux to not reset Arduino when it's ready. Unfortunately the Dragino Yun Shield doesn't have anything in rc.local, so something else must be sending the reset signal. I did comment out the line in /etc/rc.d/S99iotd: "/usr/bin/reset-mcu"

Does anyone know what could be causing this, or a good workaround?

aswine: ::::SNIP:::: Unfortunately the Dragino Yun Shield doesn't have anything in rc.local, so something else must be sending the reset signal. I did comment out the line in /etc/rc.d/S99iotd: "/usr/bin/reset-mcu"

Does anyone know what could be causing this, or a good workaround?

@aswine,

I've documented the rcS process, you can find my notes at: http://codesnippets.altervista.org/documentation/yun/boot_process/rcS_process.html

There is NO /etc/rc.d/S99iotd. However, "/usr/bin/reset-mcu" appears to be what is resetting your Mega 2560. Also the Linux part of the system takes about one minute to full boot, which makes sense for what is happening.

If you are looking to stop the Mega from rebooting, I think you have done it by commenting out that line.

Just as a note, the reason this is done is because the Bridge to the Linux part of the system is not available until the Linux has fully booted. The reset is done to signal the Atmel that it can start to do what it needs to do.

You can see alternative methods for this at: How to improve reboot/reset stability http://playground.arduino.cc/Hardware/Yun#rebootStability

Do you need more information? Is this enough? Jesse

Thanks for the reply, Jesse.

jessemonroy650:
There is NO /etc/rc.d/S99iotd.

You must be thinking of the Arduino Yun’s software. The Dragino Yun Shield uses different software from the Arduino Yun. You can get it here.

jessemonroy650:
However, "/usr/bin/reset-mcu" appears to be what is resetting your Mega 2560. Also the Linux part of the system takes about one minute to full boot, which makes sense for what is happening.

If you are looking to stop the Mega from rebooting, I think you have done it by commenting out that line.

Maybe I wasn’t clear enough in my first post. I commented out that line and the Mega still reboots. I noticed no changes when the line was commented out versus when it was not.

jessemonroy650:
Just as a note, the reason this is done is because the Bridge to the Linux part of the system is not available until the Linux has fully booted. The reset is done to signal the Atmel that it can start to do what it needs to do.

I understand. My problem is that the Atmel starts its sketch before the Yun Shield is really ready. The Yun Shield says that it’s ready after a minute, then the Atmel continues past Bridge.begin(), then it resets after 20 seconds. I’m looking for a way for the Atmel to start only after the full minute and 20 seconds, so it doesn’t continue past Bridge.begin() and then reset. In other words, the Yun Shield tells the Atmel that the Yun Shield is ready 20 seconds too early. So I guess another way to look at it is that the Atmel resetting is fine, but not if the sketch progresses after Bridge.begin() before the full minute and 20 seconds has passed.

aswine: ::::SNIP::::

I understand. My problem is that the Atmel starts its sketch before the Yun Shield is really ready. The Yun Shield says that it's ready after a minute, then the Atmel continues past Bridge.begin(), then it resets after 20 seconds. I'm looking for a way for the Atmel to start only after the full minute and 20 seconds, so it doesn't continue past Bridge.begin() and then reset. In other words, the Yun Shield tells the Atmel that the Yun Shield is ready 20 seconds too early. So I guess another way to look at it is that the Atmel resetting is fine, but not if the sketch progresses after Bridge.begin() before the full minute and 20 seconds has passed.

@aswine,

Yep. I got that much. We have a similar problem with the Yun. The Yun has two (2) processors, one is an Atmel. The Atmel is always ready before the Linux part. So there are different methods to deal with this.

One method is: How to improve reboot/reset stability http://playground.arduino.cc/Hardware/Yun#rebootStability

Another method is to reboot the Atmel as soon at the Linux part is ready, but this has issues.

I need to stop now, as I've not reached that portion with my work. Other people have solved this problem, and I've seen at least 3 different methods - many posted on this forum, AND I expect those people to jump in now.

FWIW: I am documenting their solutions. I just have not had time to clean up the text.

Jesse

I recently moved my project from a Yun to a Mega plus a Yun Shield. When using an Arduino Yun, I did this to solve strange things that would happen if the Atmel started before Linux was ready: 1. Added a script to rc.d that did echo "1" > /root/ready 2. The Atmel would send this Process every second in setup(), just after Bridge.begin(): cat /root/ready 3. If it got a 0 back, it would go back to step 2 above. 4. If it got a 1 back, it would send this Process: echo "0" > /root/ready, then continue with the sketch That worked well. The Yun would not continue with the sketch unless Linux was ready, which would be a minute and 20 seconds after I started up the Yun.

The funny part is that when I moved to the Dragino Yun Shield, the behavior changed. I now get the 1 back from Linux as previously, and then it continues with the sketch, but then it restarts after that. I don't know what the difference is, but there's something.

@aswine,
good luck. May be next time I publish will help. Entitled:

[Arduino Yun] Reverse engineering UCI and /sbin/wifi

Jesse