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

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 01-11-2013, 07:23 AM   #1
ichrispa
Enthusiast
ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.
 
Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
KT Wlan connection recognition using shttpd

Hi everyone,

I made some spare time to fix a little something I wanted to do for a long time. I love my KT - especially the fact that it is wifi capable. I use it in the university to download lecture notes.

What really annoyed me was the fact that the KT was so keen on "phoning home" to kobo and google when it get's a connection. That was easily fixed by modifying /etc/hosts.

What I had not found in the web so far was the fact that the KT verifies that it's wifi connection is running by loading "www.apple.com/library/test/success.html" every time the wifi is started. I really do not see why I should inform apple about where and when I start my kobo!

Unfortunately fixing this is not as easy as just blocking it. If the KT cannot load it's test page, it says there was a connection error and wants me to choose a new access point.


The idea is to server the success.html page from an KT internal webserver, thus enabling it to always find the Wifi up and running I did this by compiling shttpd (http://garr.dl.sourceforge.net/proje...pd-1.42.tar.gz) for my ARMv7 KT. Mongoose and thttpd would also do, but they can't be started using inetd. Thumbs up for mongoose by the way - I use it in a couple of other projects and am really happy with it.

I suppose you already might have the ftp and telnetd running here. If not, there are tons of ressource about how to do that on the web and in this forum.

Now, after compiling shttpd I placed it in /mnt/onboard/.local/bin (it's where all my binaries end up). Compiling it requires Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux. But other than that, there where no real tweaks. Next, I modified /etc/inetd.conf as follows:

Code:
21 stream tcp nowait root /bin/busybox ftpd -w -S  /mnt/onboard
23 stream tcp nowait root /bin/busybox telnetd -i
80 stream tcp nowait root /mnt/onboard/.local/bin/shttpd shttpd -inetd 1 -root /mnt/onboard/.local/srv/www -ports 80
Obviously, this starts the shttpd via inetd the second someone calls a tcp service on port 80 of the KT. My Web Root is /mnt/onboard/.local/srv/www, containing library/test/success.html.

We now point apple to localhost in /etc/hosts:

Code:
127.0.0.1 host localhost.localdomain localhost localhost localhost.localdomain
127.0.0.1 kobo.com www.kobo.com ecimages.kobobooks.com download.kobobooks.com
127.0.0.1 mobile.kobobooks.com services.kobobooks.com social.kobobooks.com
127.0.0.1 webstore2.kobobooks.com webstore1.kobobooks.com webstore.kobobooks.com
127.0.0.1 www.google-analytics.com
127.0.0.1 kobo.de www.kobo.de ecimages.kobobooks.de download.kobobooks.de
127.0.0.1 mobile.kobobooks.de services.kobobooks.de social.kobobooks.de
127.0.0.1 webstore2.kobobooks.de webstore1.kobobooks.de webstore.kobobooks.de
127.0.0.1 www.google-analytics.de
127.0.0.1 www.apple.com www.apple.de apple.com apple.de
Next point: 127.0.0.1 should be the loopback device... but my KT does not create this device at boot. Either in your local bootscript called from /etc/init.d/rcS or in the file itself append the following to create the loopback device at boot:

Code:
# Create lo device
ifconfig lo 127.0.0.1
Reboot... and voila. No more phoning home to apple for connection checks Hope this helps someone.


By the way this gave me a nice idea. Since the KT plugin structure is no longer maintained, it makes it kind of hard to start you own programs while nickel holds control over the KT. Since mongoose, shttpd and thttpd have cgi support, one could in theory create a local webpage using php (after getting it compiled...) which kills nickel on demand and starts the application of your choice. In my eyes this is easier then compiling QT embedded plugins...

Might give that a try some day.
ichrispa is offline   Reply With Quote
Old 01-11-2013, 10:20 AM   #2
ichrispa
Enthusiast
ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.
 
Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
Addendum: I made some more spare time (and am feeling really bad about it) to try the php idea. I needed to crosscompile libz and libxml2 for this point, but it is obviously running ^^



I will work on getting sqlite support on the KT. I believe that in connection with the Kobo_Reader.sqlite database that manages the Kobo's UI Functions this might open up some neet possibilities (ie. reclassifying stuff as newspapers without a sync/computer).

If anyone but me is interested in this stuff, I can of course make the crosscompiled binaries/libs for zlib, libxml2, php and shttpd available.
ichrispa is offline   Reply With Quote
 
Enthusiast
Old 01-11-2013, 05:04 PM   #3
bob451
Member
bob451 began at the beginning.
 
Posts: 10
Karma: 28
Join Date: Aug 2010
Device: kobo
Quote:
KT verifies that it's wifi connection is running by loading
"www.apple.com/library/test/success.html" every time the wifi is started.

If the KT cannot load it's test page, it says there was a connection error and wants me to choose a new access point.
So that may explain why the KT sometimes throws away the passphrase for an access point when trying to connect to Wifi: the access point connects but no response comes back from http://www.apple.com/library/test/success.html within the required time.

Having details of the KT http client blithely handed off to Apple is bad enough, but having on occasion to re-enter the WPA2 passphrase again is highly annoying.

Is there no way to redirect the request from www.apple.com/library/test/success.html to another http server, for example a local network server, to return a "success.html"? That would avoid the need to hack the KT with an http webserver.
bob451 is offline   Reply With Quote
Old 01-11-2013, 07:51 PM   #4
ichrispa
Enthusiast
ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.
 
Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
I have configured my local dns server to redirect the request to my own web server (http://prospero.homelinux.net/library/test/success.html), but it requires you to have a dns and web server running. Which in my eyes might be more demanding than hacking the KT.

Plus it only works in you local own network...
ichrispa is offline   Reply With Quote
Old 01-12-2013, 03:19 PM   #5
bob451
Member
bob451 began at the beginning.
 
Posts: 10
Karma: 28
Join Date: Aug 2010
Device: kobo
For the KT, I am only interested in the local network, on which a web server is already running (among other things, it serves up sideloaded epubs to the KT).

It sounds as though the solution to redirecting www.apple.com/library/test/success.html (and anything else to be bypassed) is to add a DNS server to the local network.

By the by, I wonder how many of the problems described at the current forum topic Kobo Touch Wi-Fi connection issues are related to the response required from www.apple.com/library/test/success.html.
bob451 is offline   Reply With Quote
Old 01-13-2013, 08:01 AM   #6
ichrispa
Enthusiast
ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.ichrispa shines like a glazed doughnut.
 
Posts: 40
Karma: 8604
Join Date: Dec 2012
Location: Germany
Device: Kobo Touch
Hi bob451,

Quote:
Originally Posted by bob451 View Post
For the KT, I am only interested in the local network, on which a web server is already running (among other things, it serves up sideloaded epubs to the KT).

It sounds as though the solution to redirecting www.apple.com/library/test/success.html (and anything else to be bypassed) is to add a DNS server to the local network.
yes, that is absolutely correct. That was my first setup as well, but of course it only worked in my own local network which was not enough for me.

Here's how:
  • You need a webserver (anything will do, even shttpd, mongoose, thttpd or go big with lighttpd, apache, etc.). Even a own hosted site with you provider will do.
  • Create a path /library/test on you webroot and copy the page www.apple.com/library/test/success.htm into that folder. You should now be able to call http://<yourhost>/library/test/success.htm from any browser in your local subnet.
  • Next you need an intercepting dns server in your local subnet. I use dnsmasq, but again, any other will do too. Point www.apple.com to the IP of you webserver.
  • When you start the kobo WiFi in your local subnet, you should see a call to your success,htm page in the logs of the webserver.
ichrispa is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PB 903 WLAN Kyriako PocketBook 17 12-25-2012 04:19 AM
How do I download my Kindle books on to WLAN-only Kindle - have no access to WLAN rglk Amazon Kindle 10 11-05-2011 03:10 PM
Wireless internet connection frustrating IDS connection Socrates iRex 8 10-21-2009 12:46 PM
Please try this procedure for recognition Robertb Astak EZReader 5 09-22-2009 09:58 AM
2.9.5 killed my WLAN chrisv5 iRex 10 04-27-2007 07:33 AM


All times are GMT -4. The time now is 03:21 PM.


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