-
Notifications
You must be signed in to change notification settings - Fork 117
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
Sound processing doesn't start when DISABLE_AUTO_SWITCH_TO_AP is not set and can't connect to AP #79
Comments
Just pinging @AEFeinstein for confirmation to double-check this... I don't know if we've ever tested the fallback to soft ap feature on the new branch. The code change looks a little strange to me. I believe @acoulson2000 is referring to commonservices.c:993 Also @acoulson2000 if printed_ip is set to 1 here, then, won't it just get unset in the lines immediately following? Could you chop out a little more before and after? |
Oop.. sorry, I should have mentioned it's in commonservices.c. Yes, pasting a bigger chunk, whcih seems to work for me, below. If I wasn't such a git neophyte, I could probably figure out a way to put it on a branch and do a pull request :-/
|
@cnlohr I did not test any of this in https://github.com/cnlohr/swadge2019 b/c it never uses station mode. @acoulson2000 nothing wrong with being a neophyte. GitHub does have some help when it comes to this sort of thing:
It does feel weird to call |
hhnnggg I won't be able to test this for almost two weeks :( If there is any way you can chase this down and make it a little cleaner maybe call the underlying functions? Or maybe we need a facility in esp82xx to say "enable/disable timing critical stuff"? |
@AEFeinstein I'm pretty sure that is the problem (although in the main branch, the function is @cnlohr The issue seems to be the reverse of what you mention - in the current code, if ( wifi_fail_connects > MAX_CONNECT_FAILURES_BEFORE_SOFTAP ), GoAP() gets called and printed_ip is set to 1, but then immediately afterward, printed_ip is set back to 0, so StartHPATimer() never gets called on the next tick of myTimer() |
And yeah, the use of the printed_ip flag to sort of reflect the state of whether the HPATimer needs to be start off in another are of code was kind of confusing and hard to track down (although my unfamiliarity with the code is the bigger problem :-) |
Not sure... does that mean all is well? |
I believe I found a bug that occurs when DISABLE_AUTO_SWITCH_TO_AP is NOT set - so we DO want to fall back to SOFT_AP mode if we can't connect to the configured AP. Since print_ip get's set to 0, sound processing and ws2812 control never starts.
//// This section:
////Needs to be before:
#ifndef DISABLE_AUTO_SWITCH_TO_AP
#define MAX_CONNECT_FAILURES_BEFORE_SOFTAP 2
#ifdef MAX_CONNECT_FAILURES_BEFORE_SOFTAP
if( wifi_fail_connects > MAX_CONNECT_FAILURES_BEFORE_SOFTAP )
{
GoAP( 0 ); // giving up on station so start ADC so need ExitCritical() which is done in GoAP
CSConnectionChange();
wifi_fail_connects = 0;
///// And printed_ip needs to be set:
printed_ip = 1;
}
#endif
#endif
The text was updated successfully, but these errors were encountered: