Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-21-2014, 07:44 PM   #1
swamp thing
Enthusiast
swamp thing began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
Use smart phone to convert web page to epub and send to Kobo Touch over WIFI

A smart phone is good to browse your favourite stomping grounds on the web, and select what you want to read. An ebook reader is perhaps where you would like to actually chew the cud at leisure. (This harks back to the original cow-related meaning of 'to browse').

Dotepub.com provides a bookmarklet-based utility that .. "digests " .. web articles into epub files. So I have been looking for a good way to implement this route :
[web/html] --> [epub] --> [smart phone] --> [Kobo Touch].

In this post, I have pulled together a set of ideas and tips (none of them is my own, btw) that dovetail nicely to achieve the above goal.

[1] Installing the dotEpub bookmarklet on your smart phone:
DotEpub works through a bookmarklet that you install by drag-and-drop.
Opera, opera mini and chrome for Android (to name some examples) do not support drag and drop setup of a bookmarklet. You have to create one manually by pasting the bookmarklet's javascript code into the bookmark dialog's URL box.

[2] Running the bookmarklet while viewing the page you want:
The browsers named above do not run the bookmarklet within the current document's context if you go through Menu --> Bookmarks --> Click on bookmark. Therefore, nothing happens if you try this. There is a workaround that is good in Chrome. Let's say the bookmarklet is named "dot-epub". Just start typing d..o..t.. in the url box, and the browser will show a suggestion list that should have "dot-epub" right near the top. Click on this, and you will soon see the nice green banner from dotepub.com across the top of the page. You will be able to download the epub to your default download folder.

[3] Preparing the Kobo to receive the epub:
My device has been plagued by Wifi issues (and I believe I am not alone in this situation). So I wanted a solution that did not involve cloud/web access through the built-in toy browser and Nickel's nightmarish wifi setup experience.

I already had USBNET working - activated via the Launcher hack from this forum. I modified the USBNET script so that it would activate Wifi instead, and added the new script to my Launcher menu. This results in a 100% connection success rate, and it avoids the "success.html" problem. The script also starts up dropbear (the sftp server). (See end of this post).

At this point, I had thought of installing the http client 'curl'. But wait - there's a better way :

[4] Preparing the Phone to send the epub to Kobo:
Installed ES File Explorer (which most users would probably want on their phones anyway). Apart from many other useful things, this app can take an SFTP server (e.g. dropbear on kobo) and represent it as virtual folder that you can seamlessly explore in the phone. Next, enable the wifi hotspot in the phone.

.................

To actually transfer an epub to your reader, Dear Reader, all you do is the
following:

[1] Run the Wifi setup script via Launcher and have it connect to the phone's wifi hotspot.

[2] Use the file manager app on the phone to drop files into the Kobo.

Cheers,
Swamp Thing.

Launcher Script to enable wifi:
Spoiler:
#!/bin/sh

root=$ROOT/usbnet


if [ -f /var/run/dropbear.pid ]
then

kill `cat /var/run/dropbear.pid`
msgbox "dbear" "$?"


wlarm_le -i eth0 down
msgbox "wlarm" "$?"

/sbin/ifconfig eth0 down
msgbox "ifcfg" "$?"

/sbin/rmmod sdio_wifi_pwr.ko
/sbin/rmmod dhd
msgbox "WiFi.." "WiFi Stopped!"
else

# You may need to use the freescale drivers instead; see original Launcher script and notes

/sbin/insmod /drivers/ntx508/wifi/dhd.ko
msgbox "dhd" "$?"

/sbin/insmod /drivers/ntx508/wifi/sdio_wifi_pwr.ko
msgbox "wifi" "$?"

# /sbin/ifconfig eth0 192.168.1.50
/sbin/ifconfig eth0 up
msgbox "ifcg" "$?"

wlarm_le -i eth0 up
msgbox "wlarm" "$?"

wpa_supplicant -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
sleep 4
erz="$?"
msgbox "wpa" $erz

/sbin/udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -f -q
aa='dhcp status '

msgbox "dhcp" $aa$?

if [ $erz -ne "0" ] ; then
msgbox "wpa" "error!"
exit 1
fi
[ ! -e /usr/libexec/sftp-server ] && (mkdir -p /usr/libexec; ln -s $root/sftp-server /usr/libexec/sftp-server)
$root/dropbear -E -r $root/host.key.rsa -d $root/host.key.dss > $root/dropbear.log 2>&1
msgbox "dbear" "$?"
fi



Wifi setup file -- /etc/wpa_supplicant/wpa_supplicant.conf:
Spoiler:
ctrl_interface=/var/run/wpa_supplicant
update_config=0

network={
ssid="-- your ssid --"
scan_ssid=1
key_mgmt=WPA-PSK
psk=** key that you create, see here: http://ubuntuforums.org/showthread.php?t=263136 **
}

Last edited by swamp thing; 10-21-2014 at 08:34 PM.
swamp thing is offline   Reply With Quote
Old 10-28-2014, 10:19 PM   #2
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
hi , swamp thing. I run your script on KBmenu, but my ereader just die. What should I do? thank you!
Haugor is offline   Reply With Quote
Advert
Old 10-29-2014, 08:14 AM   #3
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
@Haugor,

I believe that msgbox needs that the kobo launcher is running. Therefore, I would
  • run the script from kobolauncher in order to see whether it is working on your device. If there is a problem the messages shown by msgbox will help you solve it. If everything works as expected, then
  • remove (or comment out) the lines of the script that call msgbox
  • run the script from KSM
If you like you can later rewrite the script to display error messages via kbmessage.
tshering is offline   Reply With Quote
Old 10-30-2014, 08:47 PM   #4
swamp thing
Enthusiast
swamp thing began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
Quote:
Originally Posted by tshering View Post
@Haugor,

I believe that msgbox needs that the kobo launcher is running. Therefore, I would
  • run the script from kobolauncher in order to see whether it is working on your device. If there is a problem the messages shown by msgbox will help you solve it. If everything works as expected, then
  • remove (or comment out) the lines of the script that call msgbox
  • run the script from KSM
If you like you can later rewrite the script to display error messages via kbmessage.
@Haugor,
Sorry, I didn't check this forum for a couple of days. But I think tshering's suggestion is the best way (thanks, tshering).

Also, if your Wifi is working correctly through the normal setup method, then you may not need to run this script. The script is really for cases where
(a) the device has a problem connecing to wifi in the normal way,

OR

(b) the wifi network does not provide internet connection (that is, your mobile phone provides a local wifi hotspot but it can't reach the internet for some reason)

Last edited by swamp thing; 10-30-2014 at 08:56 PM.
swamp thing is offline   Reply With Quote
Old 10-31-2014, 01:29 AM   #5
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
Quote:
Originally Posted by swamp thing View Post
@Haugor,
Sorry, I didn't check this forum for a couple of days. But I think tshering's suggestion is the best way (thanks, tshering).

Also, if your Wifi is working correctly through the normal setup method, then you may not need to run this script. The script is really for cases where
(a) the device has a problem connecing to wifi in the normal way,

OR

(b) the wifi network does not provide internet connection (that is, your mobile phone provides a local wifi hotspot but it can't reach the internet for some reason)
@swamp thing

Thanks a lot, my wifi is ok. May you give me some guide about using the wifi Ftp?(Must I connect kobo to phones hotspot? may I connect both kobo and phone to a Router?)

Thank you again.
Haugor is offline   Reply With Quote
Advert
Old 10-31-2014, 03:12 AM   #6
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
Quote:
Originally Posted by swamp thing View Post
@Haugor,
Sorry, I didn't check this forum for a couple of days. But I think tshering's suggestion is the best way (thanks, tshering).

Also, if your Wifi is working correctly through the normal setup method, then you may not need to run this script. The script is really for cases where
(a) the device has a problem connecing to wifi in the normal way,

OR

(b) the wifi network does not provide internet connection (that is, your mobile phone provides a local wifi hotspot but it can't reach the internet for some reason)
bingo, I just find the FTP function of busybox. Now I can transfer files with it. By the way, do you know how to build a file Browser for Kobo?(like koreader but can list all file)

Thank you.
Haugor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to speedup page turn on sideloaded epub on Kobo Touch with Firmware 2.0 MisterMax Kobo Reader 40 12-06-2012 05:31 AM
Kobo Touch's page turns with ePub much slower than with Mobi tlangner Kobo Reader 2 09-03-2012 07:42 AM
ePub/Kobo Touch: determine which page ePub opens on? theboyk Conversion 2 12-05-2011 10:19 AM
Kobo Touch - Only send .Epub format? ne0b0rn Devices 1 07-09-2011 04:55 AM
Android App to convert web page to PDF goodspeech enTourage Archive 3 11-19-2010 11:29 AM


All times are GMT -4. The time now is 06:53 AM.


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