Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-25-2019, 02:05 AM   #1
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
query wifi status

Hi,
Wondering what the easiest way to determine if you have an active wifi connection from the command line? I am currently grepping for an ip address in the output from ifconfig. Maybe there is an easier way?
Thanks!
handyguy is offline   Reply With Quote
Old 12-25-2019, 10:32 AM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Lipc is your new best friend.

c.f., https://github.com/koreader/koreader...device.lua#L24
NiLuJe is offline   Reply With Quote
Old 12-28-2019, 03:40 PM   #3
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
python code to turn wifi on and wait until connected

I found this code to work well - turn wifi on, wait until connected, allow a timeout:
Code:
sp = subprocess.Popen(['lipc-set-prop', 'com.lab126.cmd', 'wirelessEnable', '1'], stdout=subprocess.PIPE)
wifi = 'OFF'
loop = 0
while loop < 40:
sp = subprocess.Popen(['lipc-get-prop', 'com.lab126.wifid', 'cmState'], stdout=subprocess.PIPE)
response, _ = sp.communicate()
if response.find("CONNECTED") > -1:
wifi = 'ON'
break
else:
loop +=1
sleep(1.5)

Last edited by handyguy; 12-31-2019 at 12:41 PM.
handyguy is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email to Kindle only works on work wifi but not on home wifi? nat_l Calibre 5 08-16-2019 02:23 PM
kobo aura one - cannot connect to wifi (mobile wifi works fine as hotspot) wakkaday Kobo Reader 3 09-28-2016 12:44 PM
Kindle 3 wifi keeps deleting Developer Keystore every time wifi is turned on. fireether Kindle Developer's Corner 4 04-18-2013 12:56 PM
Hello and query MPDuke Introduce Yourself 8 12-13-2011 10:27 AM
Classic Unrooting my Nook Wifi lost Wifi connection: unable to save the hotspot SnerdlyBosco Nook Developer's Corner 2 03-08-2011 08:17 AM


All times are GMT -4. The time now is 12:00 PM.


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