Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-12-2023, 12:55 AM   #1
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,112
Karma: 10057265
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
Solved - Disable flight mode, enable WIFI - programmatically?

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're connected to a network using:
Code:
if [[ $(cat /sys/class/net/eth0/carrier) == 1 ]]; then echo "Connected to network"; fi
The carrier value will be 0 when not connected to a network.

And I use this to test for access to the internet:
Code:
test="$(curl -Is  http://www.google.com | head -n 1)"
if [ "${test:13:2}" == "OK" ]; then echo "Connected to internet"; fi
No further action needed - leaving post alive in case others find it useful.

Last edited by neil_swann80; 04-15-2023 at 04:05 AM.
neil_swann80 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sleep Disable/Enable KUAL+ extensions j.p.s Kindle Developer's Corner 14 07-12-2023 05:17 AM
Is there a way to enable text selection/Highlight on one book and disable on another? ldmobi KOReader 1 01-15-2022 02:18 PM
How to disable/enable (not hide) a custom column? timediver Library Management 5 10-16-2017 04:45 AM
Enable/disable search highlighting katiez Library Management 2 12-05-2013 02:42 PM
Store chooser / enable, disable dialog user_none Calibre 8 05-20-2011 07:27 AM


All times are GMT -4. The time now is 10:46 PM.


MobileRead.com is a privately owned, operated and funded community.