Skip to content

Calling wifi.scan() twice on ESP8266 board causes failure #688

New issue

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

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

Already on GitHub? # to your account

Closed
nkolban opened this issue Oct 31, 2015 · 2 comments
Closed

Calling wifi.scan() twice on ESP8266 board causes failure #688

nkolban opened this issue Oct 31, 2015 · 2 comments
Assignees
Labels
bug ESP8266 This is only a problem on ESP8266 devices

Comments

@nkolban
Copy link
Contributor

nkolban commented Oct 31, 2015

After calling wifi.scan(), calling it a second time causes an assertion crash.

@nkolban nkolban added bug ESP8266 This is only a problem on ESP8266 devices labels Oct 31, 2015
@nkolban nkolban self-assigned this Oct 31, 2015
@nkolban
Copy link
Contributor Author

nkolban commented Oct 31, 2015

The problem was easily recreated. It was tracked down to the logic which saves the callback function to be invoked when the scan for access points completes. The scan should invoke the callback function (which it does) and then it should unlock the JsVar which holds the callback function (which it does) ... however it then failed to NULL the JsVar. Later, when the wifi.scan() was called a second time, it saw that the previous save of the callback function (which is now unlocked) was not NULL and tried to UnLock it again ... which failed ... because it is already unlocked.

The correction was to NULL the JsVar after unlocking it after invoking the callback.

@nkolban
Copy link
Contributor Author

nkolban commented Oct 31, 2015

Changes made, committed and pushed.

@nkolban nkolban closed this as completed Oct 31, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug ESP8266 This is only a problem on ESP8266 devices
Projects
None yet
Development

No branches or pull requests

1 participant