Run script when gpio line changes (Archer c7 v2)

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
yanko
DD-WRT Novice


Joined: 14 Oct 2013
Posts: 17

PostPosted: Fri May 14, 2021 23:55    Post subject: Run script when gpio line changes (Archer c7 v2) Reply with quote
Hello,
The Archer c7 router has a switch in the back for turning radio on/off. I want to run a script when the switch is turned on or off. I have confirmed it is mapped to gpio 23.
Evidently it is not considered an "SES button", since creating a script with .sesbutton extension did not run.
So is there a different way to set up the execution of a script when a gpio line changes? I thought about repeatedly using "gpio poll 23" every second in a startup script but the command does not seem to return and requires ^C to exit so this didn't work.
Thanks for your help!
Yanko

TP-Link Archer C7 V2
Firmware: DD-WRT v3.0-r46640 std (05/13/21)
Sponsor
yanko
DD-WRT Novice


Joined: 14 Oct 2013
Posts: 17

PostPosted: Sun May 16, 2021 14:50    Post subject: Figured out a solution Reply with quote
I found a way to do it. Use the /proc/gpio system, instead of the gpio command. For example, use
cat /proc/gpio/23_in
to get current status and put this in a loop to periodically check the status of the button.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum