I'm trying to add a new device to OpenWRT, the ZyXel NBG6503.
I am close to having everything working, but WIFI on/off button is giving me some problems.
This button is a latching switch (when pressed it stays pressed even when you take your finger off the button, and when released it stays released).
When I look at /etc/rc.button/rfkill it only does something when ACTION=pressed.
Ideally I would enable wifi when ACTION=pressed, and disable wifi on ACITON=released.
What's the best way to implement this?
Also, can I get OpenWRT to check the status this button on boot (so wifi status matches the button)?
Does this require me to write my own /etc/rc.buttons/rfkill script?
If so, how do i make sure it gets added to the image I build for my device (and not for every device out there) ?
What's the best way to have the rfkill script run on boot ?
Same thing with the NBG6817. EV_SW is definitely the right thing to do, but it only solves half of the issue: e.g. if you enable / disable WiFi via WebGUI, the switch and actual state of WiFi are not in sync anymore. It's pretty much a hardware-limitation, but at the same time, I'd expect the WiFi to stay disabled, when the WiFi is disabled and the user pushes WiFi switch to "Disable WiFi" position.
It would be a trivial fix, if we had e.g. KEY_WIFI_DISABLE and KEY_WIFI_ENABLE, emitting seperately at switch ON / OFF positions. Instead, we have a toggle-style KEY_RFKILL.