Does anybody know if you can disable flight-mode and enable WIFI programmatically? From pbterm or bash script etc? (Ideally on PB632)
I've tried running "/ebrmain/cramfs/bin/netagent connect"
This command seems to be accepted, but it has no effect on either flight-mode or WIFI.
EDIT - managed to work out the commands:
Flight mode on: "/ebrmain/cramfs/bin/netagent flightmode on"
Flight Mode off: "/ebrmain/cramfs/bin/netagent flightmode off"
Flight mode status: "/ebrmain/cramfs/bin/netagent flightmode status"
Bluetooth on: "/ebrmain/cramfs/bin/netagent bt on"
Bluetooth off: "/ebrmain/cramfs/bin/netagent bt off"
Bluetooth status: "/ebrmain/cramfs/bin/netagent bt status"
WIFI on: "/ebrmain/cramfs/bin/netagent net on"
WIFI off: "/ebrmain/cramfs/bin/netagent net off"
"/ebrmain/cramfs/bin/netagent net status" does not work, gives null response
However, you can test WIFI status using:
The eth0 directory will not exist if WIFI is off.
You can also test if you have access to the internet using:
The carrier value will be 0 for no internet.
No further action needed - leaving thread alive in case others find it useful.
I've tried running "/ebrmain/cramfs/bin/netagent connect"
This command seems to be accepted, but it has no effect on either flight-mode or WIFI.
EDIT - managed to work out the commands:
Flight mode on: "/ebrmain/cramfs/bin/netagent flightmode on"
Flight Mode off: "/ebrmain/cramfs/bin/netagent flightmode off"
Flight mode status: "/ebrmain/cramfs/bin/netagent flightmode status"
Bluetooth on: "/ebrmain/cramfs/bin/netagent bt on"
Bluetooth off: "/ebrmain/cramfs/bin/netagent bt off"
Bluetooth status: "/ebrmain/cramfs/bin/netagent bt status"
WIFI on: "/ebrmain/cramfs/bin/netagent net on"
WIFI off: "/ebrmain/cramfs/bin/netagent net off"
"/ebrmain/cramfs/bin/netagent net status" does not work, gives null response
However, you can test WIFI status using:
Code:
if [ -d "/sys/class/net/eth0" ]; then echo "WIFI on"; fi
You can also test if you have access to the internet using:
Code:
if [[ $(cat /sys/class/net/eth0/carrier) == 1 ]]; then echo "Connected to internet"; fi
No further action needed - leaving thread alive in case others find it useful.