Add external button (physical) to enable/disable the wifi.

129 views
Skip to first unread message

Fox

unread,
Oct 6, 2022, 2:39:05 AM10/6/22
to motioneye
Good day every body,

To increase the energy autonomy (use of batteries), i want to use a external button (on GPIO) to enable the wifi and automatically disable after 30 min .

I search the way to disable and enable the wifi by commands lines.

The wifi must be done when the system start and shutdown after.
I prefer to avoid rebooting when the wifi turn on or turn off.

Context of my making :
With motionEyeOs, I built a standalone camera trap to study wilds birds at nest.
It use Wifi Access Point and Real Time Clock for date/time because it's in an isolated situation.
There is a success. And now, i try to decrease the consumption of energy.
That is wath, stop the wifi when I don't use it,  could be a way.

I wrotte a script for the button and the pilot led on GPIO. That's fine.

Do you think it's possible ?
Is somebody know the way ?

Thank you so much in advance,
Carl

StarbaseSSD

unread,
Oct 6, 2022, 7:25:10 AM10/6/22
to motioneye
This is a question best asked in the motionEyeOS github at https://github.com/motioneye-project/motioneyeos/issues
so the new developers can see the feature request.
Currently, I cannot think of a way to shut down the WiFi and still have the rest of the system work in motionEyeOS.
There are ways to disable WiFi, here are 7: https://www.ourpcb.com/raspberry-pi-disable-wi-fi.html
but all require a reboot.
rfkill will prevent usage and turn off the WiFi chip, but again, it requires a reboot.

Fox

unread,
Oct 6, 2022, 7:35:09 AM10/6/22
to motioneye
Thank you for your answer.
That's what I feared.

I will ask it in the MotionEyeOs Github.

StarbaseSSD

unread,
Oct 6, 2022, 7:47:57 AM10/6/22
to motioneye
The Watchdog function will have to be dealt with, too. It watches for various functions including WiFi and forces a reboot to recover (often seen as the boot loop when starting up and no network is found). For networking, it can be bypassed by using OS.conf file with os_networkless info in it.
This is simply not a use case considered when it was written, hence suggesting the move to github.

Fox

unread,
Oct 6, 2022, 8:43:21 AM10/6/22
to motioneye
Because i'm using Access Point, in /boot/OS.conf ,  the network is off : OS_NETWORKLESS="true"

Fox

unread,
Oct 6, 2022, 8:45:34 AM10/6/22
to motioneye
Just for my knowledge, why "OS_NETWORKLESS" stay "false" in /etc/OS.CONF ?

Fox

unread,
Oct 6, 2022, 8:47:57 AM10/6/22
to motioneye
This is what the web interface show :

MotionEyeOs view.PNG

StarbaseSSD

unread,
Oct 6, 2022, 8:52:39 AM10/6/22
to motioneye
Because it's only read at first boot and copied to /etc. I don't know I would have done it the same way, but it is 'ignored' when you do the full AP mode. It's mostly for when you don't have / want an Ethernet network or WiFi network connection. You could connect a keyboard & monitor & use a USB drive to store your videos and 'harvest' them that way, but again, your particular use case wasn't though of when designing the system, I don't believe.

StarbaseSSD

unread,
Oct 6, 2022, 8:54:49 AM10/6/22
to motioneye
I think you used one of my instruction sets to set it up. As I just stated, os.conf is only read once then when not needed (AP mode for example) is ignored.

Fox

unread,
Oct 6, 2022, 9:31:57 AM10/6/22
to motioneye
Yes, i'm using yours intrusctions since may. Thank you, I understand better now why this difference between the two files.

Fox

unread,
Oct 6, 2022, 9:32:11 AM10/6/22
to motioneye
I'm posting this new issue on github MotionEyeOS.
Reply all
Reply to author
Forward
0 new messages