Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing to reboot on 'Wifly has crashed and will reboot...' #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

duhovny
Copy link

@duhovny duhovny commented Apr 8, 2016

'while (1)' didn't reboot on some Arduino models, replaced with more reliable solution.

…quin-tech#37

'while (1)' didn't reboot on some Arduino models, replaced with more reliable solution.
(Although rebooting Arduino when failed to get prompt is definitely a hack)
@duhovny duhovny changed the title Fix failing to reboot on 'Wifly has crashed and will reboot...' #37 Fix failing to reboot on 'Wifly has crashed and will reboot...' Apr 8, 2016
@chrwei
Copy link
Contributor

chrwei commented Apr 8, 2016

the while(1) will only reboot the microcontroller if there's a watchdog configured, and this usually isn't the case in Arduino stuff.

it's also not necessary to reboot the microcontroller when the WiFly reboots since it'll usually auto-reconnect and keep most of the same config, especially for use cases where you use open(). in my branch I have replaced the while(1) with a delay(2000) and return false. this gives a little time for the reconnect and lets the calling code decide what to do next.

additionally, the jmp 0 may not work on non-AVR platforms. the library is otherwise microcontroller agnostic and it would be nice to keep it that way.

@harlequin-tech
Copy link
Owner

The reboot (reset) was actually being triggered by the XBee carrier connected back to the Arduino when the WiFly rebooted. Not all of the carrier boards do this, so yes this is not a general solution.

@harlequin-tech
Copy link
Owner

Also, I would think the firmware bug in the WiFly that was causing the it to reboot is fixed by now? Haven't been testing new firmware for quite a while...

@chrwei
Copy link
Contributor

chrwei commented Apr 8, 2016

I think I managed to trigger this code, but it wasn't a firmware bug, it was something else doing the wrong thing and getting to that getprompt when it should have backed out earlier, or something. I don't recall now, I've actually fixed a ton of things recently in my branch, pull req coming soon.

@duhovny
Copy link
Author

duhovny commented Apr 11, 2016

@chrwei I agree, there should be a proper fix — I just fixed existing hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants