in Cudy TR3000 , toggle switch seem not work if kmod-button-hotplug not installed , after install it show as BTN_0 , can we change it to rfkill ? , i found some of my device rfkill can work without install kmod-button-hotplug.
I found Wiki to be unclear/confusing regarding the installation of kmod-button-hotplug to discover procd buttons and their actions. Unless I misunderstand, it then proceeds to direct the user to make UCI System configurations. These configurations did not work for me. Following only the procd section of the Wiki (after knowing the name of the button and positions), I had success with only the following steps:
Without installing kmod-button-hotplug:
- Create
/etc/rc.button/BTN_0- here's a sample script to log the button's activity:
#!/bin/sh
if [ "$ACTION" = "pressed" ] && [ "$BUTTON" = "BTN_0" ]; then
logger "button BTN_0 was pressed"
fi
if [ "$ACTION" = "released" ] && [ "$BUTTON" = "BTN_0" ]; then
logger "button BTN_0 was released"
fi
~ Reference: this thread
- Make the script executable:
chmod +x /etc/rc.button/BTN_0 - Test button
- checking with logread - Alter the
loggerlines to run your desired command, script, etc. - Include
/etc/rc.button/BTN_0file to be backed up in/etc/sysupgrade.conf
The TR3000's BTN_0 is:
- Pressed when the slider is toward the dotted marked position/front/lighted end of the router
- Released when the slider is toward the not dotted position/rear/connector side of the router
You should be able to copy rfkill script into that of BTN_0.
cp /etc/rc.button/rfkill /etc/rc.button/BTN_0
i currenyly use it hotplug + kmod-button-hotplug.
it would be great if someone update map BTN_0 to rfkill in .dts
Why?
- The factory functionality was a VPN switch
- It's a customizable button in OpenWrt
- meaning you can do it yourself as I described above
I use it as a VPN switch and it would have 0 practical use to for me (and others, I'm sure given it's a travel router) as an rfkill switch.
Are you saying that the UCI commands in the Wiki work for you?
As i test , without kmod-button-hotplug it with show as ““ not “BTN_0” , i fail to use /etc/rc.button/BTN_0 not sure why. after install kmod-button-hotplug hotplug sh script work fine, that how i use it now.
?
To be clear, where is this script?
It seems you're describing something different than the Wiki.
file locate at /etc/hotplug.d/button/00-custom-rfkill and ““ mean variable return blank data not “BTN_0”
This post helped me a lot to get the switch button BTN_0 to work on a GL.Inet GL MT3000. Maybe a good idea to add this to the wiki for hardware buttons?