View Single Post
Old 08-07-2019, 04:48 AM   #6
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 875
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by Mavireck View Post
Yes thank you for your help, it is now working well on my H20 (mark5 - I am not going to try to make it work on a mark7 for now)

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")
But it still does not connect to the wifi network (IP remains local), while it does connect with Nickel.
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 !
enable-wifi.sh doesn't include the required Nickel environment variables. You want to look at lines 93-94 from koreader.sh. They are the lines that read:
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
You may like to also look at the shell scripts from my Kobo UNCaGED, project, more specifically scripts/nickel-usbms.sh, lines 69-71.

Note, the Wifi stuff in that file may look a little familiar. I took a lot of "inspiration" from koreader for the Wifi stuff.
sherman is offline   Reply With Quote