Wifidisconnect command

Moderators: BertB, rtenklooster, Voyager, Stuntteam, Martinus

Post Reply
Message
Author
Strider336
Normal user
Posts: 6
Joined: 13 Jan 2018, 11:51

Wifidisconnect command

#1 Post by Strider336 » 11 Aug 2018, 20:13

I'm trying to see if I can turn off the WiFi to reduce power usage at night time, using the following:

On System#Boot do
gpio,12,0
WifiConnect
endon

on Clock#Time=All,06:00 do
reboot
endon

On wifioff do
delay 8000
WifiDisconnect
endon

on Clock#Time=All,17:50 do
WifiConnect
endon

on Clock#Time=All,22:00 do
WifiDisconnect
endon

This is on a NodeMCU v3, which i've just installed in my car to trigger an alarm siren (either by WiFi or by proximity sensor) to deter young children playing near it, throwing things at it, scraping bike pedals down the side of it. I plan to add more functionality later.......

It's taking 35-40mA and i'm hoping that WiFi off will save a few more mA.

BUT, what is happening is I turn the WiFi off by the above (direct command or a timer), it disconnects as it should, but then 60s later it's back on again.

Any idea about this problem?

TD-er
Normal user
Posts: 940
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Wifidisconnect command

#2 Post by TD-er » 12 Aug 2018, 12:35

There is a wifi check function to perform a reconnect (and wifi reset).
This function should be made aware the wifi is off intentional.
So this is currently not possible to achieve, without change in software.
Can you make an issue for this on Github?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests