Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-28-2013, 06:11 PM   #1
a3nm
Member
a3nm doesn't littera3nm doesn't littera3nm doesn't litter
 
Posts: 11
Karma: 204
Join Date: May 2013
Device: Kobo Glo
Running browser without Wifi connection

Hi,

I am using kiwix-serve to have a static copy of Wikipedia (on a SD card) to my Kobo. It works, but, as the dump is served using HTTP, I have to connect to localhost with a web browser to read it. However, the Kobo's built-in web browser refuses to work without an active Wifi connection, which is sad as the point is to read the dump offline...

Is there a way to bypass this check or fool nickel into believing that wpa_supplicant is connected to a network? I tried writing into /tmp/nickel-hardware-status following what is done by /etc/udhcpc.d/default.script, but this doesn't seem to change anything. I tried running an strace on nickel with and without a Wifi connection to see if I could identify how the check was performed, but I wasn't able to find anything. Any other ideas?

Thanks!
a3nm is offline   Reply With Quote
Old 05-28-2013, 07:06 PM   #2
BWinmill
Nameless Being
 
Try bringing the Wi-Fi interface up and assigning an IP address to it. (ifconfig <interface> <address> should do the job.)
  Reply With Quote
Advert
Old 05-28-2013, 08:15 PM   #3
a3nm
Member
a3nm doesn't littera3nm doesn't littera3nm doesn't litter
 
Posts: 11
Karma: 204
Join Date: May 2013
Device: Kobo Glo
Nice idea, but it doesn't work. Here is what I get when loading the appropriate Wifi modules to make the interface show up, setting it up, and assigning an address:

Code:
[root@(none) /root]# busybox insmod /drivers/ntx508/wifi/sdio_wifi_pwr.ko
[root@(none) /root]# busybox insmod /drivers/ntx508/wifi/dhd.ko
[root@(none) /root]# /sbin/ifconfig eth0 up
[root@(none) /root]# /sbin/ifconfig eth0 192.168.0.2
[root@(none) /root]# /sbin/ifconfig eth0 
eth0      Link encap:Ethernet  HWaddr 00:90:A2:BF:DB:53  
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
However, trying to run the web browser still triggers a "scanning for networks" dialog, so nickel must be checking something else. Thanks for the suggestion, still...
a3nm is offline   Reply With Quote
Old 05-29-2013, 08:06 AM   #4
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
It's a very good idea to have wikipedia on Kobo!

Probably it doesn't work because the browser tries to connect to Kobo site. How about installing another QT browser?
Lucas Malor is offline   Reply With Quote
Old 05-29-2013, 02:11 PM   #5
joris_
Junior Member
joris_ has a complete set of Star Wars action figures.joris_ has a complete set of Star Wars action figures.joris_ has a complete set of Star Wars action figures.joris_ has a complete set of Star Wars action figures.
 
Posts: 7
Karma: 364
Join Date: Apr 2013
Device: Kobo Glo
I'm guessing it doesn't work because "ip link show eth0" reports the device as being in an UNKNOWN state (which should be "UP"). Running "ip link set eth0 up" won't fix this, unfortunately..
joris_ is offline   Reply With Quote
Advert
Old 05-29-2013, 02:35 PM   #6
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Can't you pass url parameters (something like "file:///usr/share/wikipedia/index.html") to Kobo browser via command line?
Lucas Malor is offline   Reply With Quote
Old 05-29-2013, 02:42 PM   #7
BWinmill
Nameless Being
 
fickel seems to monitor the hardware status (and the source is available). I wonder if a solution can be found in there.

I don't know how hard this would be, but Aard is based upon PyQt. Maybe it would be possible to port PyQt and get that running?
  Reply With Quote
Old 05-29-2013, 02:50 PM   #8
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
I don't know Aard. Where's its homepage?
What about qtweb? http://qtweb.net/
Lucas Malor is offline   Reply With Quote
Old 05-29-2013, 03:17 PM   #9
BWinmill
Nameless Being
 
Aard is a dedicated dictionary. The wikipedia is available for it, among other things:

http://aarddict.org/
  Reply With Quote
Old 05-29-2013, 03:20 PM   #10
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Impressive.

I think those are binary packages for armel:
https://github.com/aarddict/aarddict...r/binary-armel
Lucas Malor is offline   Reply With Quote
Old 05-29-2013, 03:49 PM   #11
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Ah, about armel binaries and dependencies, read this thread:
https://www.mobileread.com/forums/sho...d.php?t=214309
Lucas Malor is offline   Reply With Quote
Old 05-29-2013, 06:38 PM   #12
a3nm
Member
a3nm doesn't littera3nm doesn't littera3nm doesn't litter
 
Posts: 11
Karma: 204
Join Date: May 2013
Device: Kobo Glo
Thanks for all your suggestions. I'm aware that I can run any browser (or aardict, or anything) outside of nickel, for instance in a Debian chroot. However, for convenience, I would like to be able to run my browser and access Wikipedia (which is an HTTP server running on localhost, this part of the setup works) from within nickel.

Thanks to BWinmill for pointing me to fickel. It's not hard to write a custom version of fickel which returns scan results and make the Kobo try to connect to a non-existant network. However, I'm still stuck. When the Kobo tries to connect to this fake network, it seems (from snooping on /tmp/nickel-hardware-status) that nickel expects the following messages:

Code:
network deconfig
network bound 192.168.100.48
However, writing those messages by hand if the network doesn't actually exist results in a "Something went wrong..." message from nickel. I tried setting the address of eth0 with ifconfig to match the fake value I write in /tmp/nickel-hardware-status, but the same error appears. However, writing the exact same messages by hand does not make nickel complain if the network actually exists. I tried stracing nickel to see what it does, but to no avail.

We're almost there; do you have any idea of what nickel may be checking when it is supposed to be connected? The error message is instant, so I very much doubt that it is anything really network-related (like pinging an address).

Thanks again for your answers!

Lucas Malor: Is there a way to call the Kobo web browser from the command line?

[Another idea: is it possible to run the Kobo web browser manually from Kobotweaks, bypassing nickel's check?]

Last edited by a3nm; 05-29-2013 at 06:41 PM. Reason: oops
a3nm is offline   Reply With Quote
Old 05-29-2013, 06:50 PM   #13
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Tweaks has a "Browser" entry, so you should find the command to execute the browser in the source code of Tweaks.
Lucas Malor is offline   Reply With Quote
Old 05-30-2013, 04:45 AM   #14
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
See also this post:
https://www.mobileread.com/forums/sho...49#post2528649
Lucas Malor is offline   Reply With Quote
Old 05-30-2013, 05:51 PM   #15
a3nm
Member
a3nm doesn't littera3nm doesn't littera3nm doesn't litter
 
Posts: 11
Karma: 204
Join Date: May 2013
Device: Kobo Glo
Lucas Malor: Tweaks is calling
Code:
WirelessWorkflowManager::openBrowser(QUrl())
defined in the shared library libnickel.so (where QUrl() is a function from QT). Using gdb taught me that the this invokes the function with mangled name _ZN18ExtrasPluginLoader11loadBrowserEv. From this, tracing through the assembly reveals that this invokes the function _ZN23WirelessWorkflowManager15connectWirelessEb, whether a connection exists or not. From a bit of stepping, it doesn't seem like there is a clear straightforward condition that is being checked and that could be disabled by editing the binary -- though I'm not an expert in this and probably am not using the right tools to locate the relevant test. (Relevant SO question I just asked: http://stackoverflow.com/q/16845187/414272)

There has to be some way to get this to work, though... it's so annoying to have this offline Wikipedia working except for this stupid check in nickel that prevents you from running the browser offline...

Last edited by a3nm; 05-30-2013 at 05:54 PM.
a3nm is offline   Reply With Quote
Reply

Tags
browser, glo, offline, web, wifi

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
silk browser running on kobo vox mr_nobody Kobo Tablets 4 01-06-2012 11:37 PM
wifi connection vienna enTourage eDGe 2 09-19-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
Wifi connection gone Kumabjorn Amazon Kindle 3 09-12-2010 01:49 PM
no 'real' connection between prs505 and calibre running on win pc 1streader Calibre 5 02-17-2009 03:13 PM


All times are GMT -4. The time now is 12:59 AM.


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