07-27-2019, 02:46 PM | #1 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jul 2019
Device: KOBO Glo HD
|
Enable Wifi by script?
Dear community
I've a Kobo Glo HD with XCsoar (https://xcsoar.org/) installed, everything works fine and it's overall a great device. Unfortunately, since a few weeks ago, the upper part of my display (~1 inch) isn't working anymore. (Doesn't react on touch inputs). Because of this, I'm no longer able to switch on and off the Wi-Fi. Is there a possibility to activate / deactivate the Wi-Fi by script? |
07-27-2019, 08:16 PM | #2 |
BLAM!
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
|
On a stock Kobo, sure (although it's not necessarily entirely trivial).
In XCSoar though, you'd have to ask the XCSoar guys. |
08-05-2019, 05:25 PM | #3 |
Connoisseur
Posts: 63
Karma: 18290
Join Date: Jul 2016
Location: France
Device: Kobo H2O (broken), Kobo H2O Edition 2 v1 (stolen), Kobo Clara 2E
|
I am just having the same issue, so I will use this thread instead of creating a new one ;-)
I would like to toggle Wifi on and off by executing a script for my app (a homemade dashboard launched through KFmon) for battery-saving purposes I can easily disable Wifi with a script. It looks like I can enable it. But it does not seem to connect to the available know wifi network. (Actually, what my log says is that the script is correctly executed, but the IP Adress remains 127.0.0.1) I am using these scripts borrowed from koreader's sources: wifidown.sh Spoiler:
wifiup.sh Spoiler:
I would like the wifiup.sh script to automatically connect to a wifi network, so that after its execution I can make my API calls with my app ;-) Can anyone help me out ? (Oh and I may have the same question with a script that would turn up and down brightness, if anyone has that, I can't find much documentation - I am new to progamming things which almost directly communicates with the hardware) |
08-05-2019, 05:55 PM | #4 |
BLAM!
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
|
You're missing the bits from acquire-ip.sh (i.e., dhcp).
FL control is via ioctl (except on Mk. 7 when there's also a sysfs entry), so, that'd need a C helper if you want to cover all current devices. |
08-06-2019, 06:53 AM | #5 | |
Connoisseur
Posts: 63
Karma: 18290
Join Date: Jul 2016
Location: France
Device: Kobo H2O (broken), Kobo H2O Edition 2 v1 (stolen), Kobo Clara 2E
|
Quote:
As for wifi. Disabling seems to work, but connecting to the network doesn't: I copied the whole sources from koreader in a folder called 'files' in my app. It is coded in Python (of course). After a click on a button, it launches a function which among other things, executes these lines of code: Code:
os.system("sh ./files/enable-wifi.sh") time.sleep(5) os.system("sh ./files/obtain-ip.sh") print("Wifi enabled") Am I missing something ? I also have another unexpected issue : the "Wifi enabled" message is being printed multiple times... Can it be due to the problem I am having (or cause it?). I really don't know why it would be executed multiple times in my code. Thank you for your help ! |
|
08-07-2019, 04:48 AM | #6 | |
Guru
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
Quote:
Code:
eval "$(xargs -n 1 -0 <"/proc/$(pidof nickel)/environ" | grep -e DBUS_SESSION_BUS_ADDRESS -e NICKEL_HOME -e WIFI_MODULE -e LANG -e WIFI_MODULE_PATH -e INTERFACE 2>/dev/null)" export DBUS_SESSION_BUS_ADDRESS NICKEL_HOME WIFI_MODULE LANG WIFI_MODULE_PATH INTERFACE Note, the Wifi stuff in that file may look a little familiar. I took a lot of "inspiration" from koreader for the Wifi stuff. |
|
08-07-2019, 10:10 AM | #7 |
Connoisseur
Posts: 63
Karma: 18290
Join Date: Jul 2016
Location: France
Device: Kobo H2O (broken), Kobo H2O Edition 2 v1 (stolen), Kobo Clara 2E
|
Thank you so much ! My problem is solved !
I did absolutely not know of the details of exported variables within bash scripts. My initialization script did not export all the variables required (it did not export WIFI_MODULE_PATH for instance). I still had some issues, until I found that the $PLATFORM variable was not defined. For now I hardcoded the path to the wifi driver: Code:
lsmod | grep -q sdio_wifi_pwr || insmod "/drivers/mx50-ntx/wifi/sdio_wifi_pwr.ko" Code:
lsmod | grep -q sdio_wifi_pwr || insmod "/drivers/${PLATFORM}/wifi/sdio_wifi_pwr.ko" |
Tags |
script, wi-fi |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Koreader WIFI enable after start: Possible? | anki | KOReader | 5 | 09-07-2017 10:12 AM |
Kindle Touch 5.1.0, How to turn on/off wifi in a script? | wisecrick | Kindle Developer's Corner | 3 | 12-08-2013 05:31 AM |
Kindle 3: run script when turning wifi on? | theblop | Kindle Developer's Corner | 1 | 11-09-2010 10:25 AM |
Request Enable access to adhoc wifi networks | devseev | enTourage Archive | 7 | 11-05-2010 11:01 AM |
run script on wifi connect | sinisterguy | Kindle Developer's Corner | 1 | 10-18-2010 03:46 PM |