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

wifi.setmode(wifi.NULLMODE) does not turn off WiFi #1473

Closed
joysfera opened this issue Aug 24, 2016 · 3 comments
Closed

wifi.setmode(wifi.NULLMODE) does not turn off WiFi #1473

joysfera opened this issue Aug 24, 2016 · 3 comments

Comments

@joysfera
Copy link
Contributor

Expected behavior

With WiFi turned off the ESP8266 should require less power (12 mA instead of 70 mA).

Actual behavior

The measured current stays the same (still 70 mA) after calling wifi.setmode(wifi.NULLMODE). I suspect the WiFi was not turned off.

Test code

wifi.setmode(wifi.NULLMODE)

NodeMCU version

Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)

Hardware

Plain ESP8266.

BTW

There's a workaround for turning off WiFi by falling into dsleep(): node.dsleep(1, 4)
This is rather inconvenient, though, as it requires GPIO16 to be wired to RST and it also resets the whole chip so your Lua program gets interrupted and starts again. It would be better if the wifi.setmode() actually worked as advertised and turned off WiFi without rebooting the whole chip.
Please note that this could be a limitation of SDK or even the hardware itself. I have yet to check that.

@dnc40085
Copy link
Contributor

dnc40085 commented Aug 24, 2016

This is not a bug. Auto sleep in null mode is not default SDK functionality, PR #1231 will add this functionality once I can work out the kinks, which is soon I hope.

@joysfera
Copy link
Contributor Author

@dnc40085 thank you, looking forward for PR #1231

@dnc40085
Copy link
Contributor

@joysfera @marcelstoer Here is a PR to add this functionality

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