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

Once 'Failed to exit', never able to get in commandMode again #12

Open
ricdijk opened this issue Aug 27, 2012 · 3 comments
Open

Once 'Failed to exit', never able to get in commandMode again #12

ricdijk opened this issue Aug 27, 2012 · 3 comments

Comments

@ricdijk
Copy link

ricdijk commented Aug 27, 2012

I'm using the library for a temperature sensor of my solar boiler system, it works great, thanks for the good work!

When WiFly::exitCommandMode() does not get 'EXIT\r\n' from the wifly it raises an error (correct) and leaves the variable inCommandMode as it is (= true).
Most probably the wifly did not return 'EXIT\r\n' because it somehow already left command mode.

WiFly::startCommand() first checks 'inCommandmode == true', thinks the wifly is still in commandmode and does not execute a '$$$' command. Because WiFly will not get in command mode, WiFly::exitCommandMode() will never get an 'EXIT\r\n' and doesn't change anything. Even a WiFly::reboot() won't work (because it uses WiFly::startCommand()). The way it is working right now, to me it seems impossible to get out of this situation.

A solution for this might be to assume the wifly is not in command mode when WiFly::exitCommandMode() doesn't get an 'EXIT\r\n'. In that situation still raise an error, but set inCommandMode false anyway.

@harlequin-tech
Copy link
Owner

Great that its mostly working for you.

The exit problem sounds like a symptom of a comms problem. If you make the change you've suggested, does your WiFly respond to further commands (i.e. does the next enterCommandMode() work?).

@ricdijk
Copy link
Author

ricdijk commented Aug 27, 2012

Yes, I made the change in my own local library and since then the wifly continues working after a ‘Failed to exit’. The Wifly gets into command mode again and any command that is send after the ‘Failed to Exit’ is processed OK.

@marcosmoura91
Copy link

What changes have you made ???

Sometimes mine also fails and i keep getting failed to get prompt and failed to echo something

And it just keeps reporting those failures.

i edited the exitCommand so it sets the inCommandMode to false everytime even if it finds the 'EXIT\r\n' or not.
I hope it works.

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

No branches or pull requests

3 participants