CLI for VirginMedia Hub 3 using SMNP
Create a .vmhubctl.yml config file based on the .vmhubctl.yml-template file.
- Show help:
vmhubctl --help - List some settings:
vmhubctl list - Disable WiFi:
vmhubctl disable wifi - Enable WiFi:
vmhubctl enable wifi
mkdir -p bin
GOBIN=$PWD/bin go get golang.org/x/tools/cmd/stringer
./bin/stringer -type=Name ./oids
go build -o vmhubctlNOTE: The stringer command needs to be re-ran after changing ./oids/name.go.
The idea is to run this on Raspberri Pi connected via a LAN cable to the Wifi router, so that it could turn on and off Wifi at certain times.
For Raspberry Pi:
env GOOS=linux GOARCH=arm GOARM=5 go build -o vmhubctl
scp .vmhubctl.yml pi@pihole:~/
scp vmhubctl pi@pihole:~/- Install CRON via
crontab -e:
# switch off wifi at 2300
0 23 * * * /home/pi/vmhubctl disable wifi --config /home/pi/.vmhubctl.yml
# switch on wifi at 0500
0 5 * * * /home/pi/vmhubctl enable wifi --config /home/pi/.vmhubctl.yml- Check if it was running:
grep CRON /var/log/syslog - Check logs:
cat ~/vmhubctl.log