Quantcast
Channel: MobileRead Forums - PocketBook
Viewing all articles
Browse latest Browse all 1245

Disable flight mode, enable WIFI - programmatically?

$
0
0
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:
Code:

if [ -d "/sys/class/net/eth0" ]; then echo "WIFI on"; fi
The eth0 directory will not exist if WIFI is off.

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
The carrier value will be 0 for no internet.

No further action needed - leaving thread alive in case others find it useful.

Viewing all articles
Browse latest Browse all 1245

Trending Articles