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 05-07-2015, 03:20 PM   #226
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
Hello AlterusPrime, I am glad you like KSM.

Quote:
Originally Posted by AlterusPrime View Post
Yesterday evening i was wondering, "wifi" menu has some wget scripts and i thought i could make it wget my books. But i'm so bad at scripting so the only thing i've achieved is exit_code=1. So here's my first question - is it even possible to do so? Like make a script that would wget books from, for example, http://192.168.1.2 (there's a HTTP server running HFS, generates a webpage with links) to some specific folder, like /mnt/onboard/.books/wgotbooks? If it's possible - could you possibly assist me in achieving this?
Do the other wget scripts work? I am asking just to make sure that the wifi connection is working.

How exactly are you trying to download your files? I guess you will
  • download an index file from the server with wget
  • retrieve the available file names from the index file
  • select those file names that have not a counterpart in /mnt/onboard/.books/wgotbooks
  • download each selected file with wget
If you are doing it in this way (or similar), you could write the results of each step to a log file in order to find where the error occurs. Or you can run your script via telnet to see what is happening, or you can execute each command individually from telnet.
Quote:
Originally Posted by AlterusPrime View Post
And second question - could i possibly "rename" the menu strings? I don't really like "start vlasovsoftlauncher" line and would like to shorten it to "start coolreader". Just a cosmetic thing but things like that always make us feel more comfortable, right? To do so - should i rename some script or is it not that easy?
You would have to do some changes in .adds\kbmenu\onstart\ksmhome.sh. But take care, rcS and this file are the two critical scripts in KSM. A mistake can force you to factory reset the reader. And since ksmhome.sh is likely to be overwritten by future updates, you would have to be applied the changes again and again. On a side note, "start vlasovsoftlauncher" does exactly this, it does not start coolreader.
tshering is offline   Reply With Quote
Old 05-07-2015, 04:04 PM   #227
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
*cough* *cough*

rsync!

*cough* *cough*

(No, seriously, rsync is awesome for this kind of stuff, it'll do all the heavy-lifting for you ).
NiLuJe is offline   Reply With Quote
Old 05-07-2015, 05:30 PM   #228
Ken Maltby
Wizard
Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.
 
Ken Maltby's Avatar
 
Posts: 4,466
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
Quote:
Originally Posted by NiLuJe View Post
*cough* *cough*

rsync!

*cough* *cough*

(No, seriously, rsync is awesome for this kind of stuff, it'll do all the heavy-lifting for you ).
*Hic-up*

zsync it is already in Koreader.

*Hic-up*

Or an OPDS server.

Luck;
Ken

Last edited by Ken Maltby; 05-07-2015 at 06:17 PM.
Ken Maltby is offline   Reply With Quote
Old 05-08-2015, 12:51 AM   #229
AlterusPrime
Enthusiast
AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.
 
Posts: 38
Karma: 358
Join Date: May 2015
Device: Kobo Glo
Thanks for your response tshering,
Yes, preset scripts do work perfectly, there's no issue with that.
The thing i'm trying to achieve is: script gets index -> extracts all the files from <a> tags -> downloads them and rewriting existing stuff in the folder.

Now about logging. I was wondering if that's possible to log things into some file 'cause i really want to write the script by myself (just to prove something to myself, and, of course, get the task done), could you possibly tell me how to do the logging?

About vlasovsoftlauncher. Thanks for pointing me to the ksmhome.sh, and yeah, i do understand that VSL doesn't start coolreader by default but i do have "autostart" options in VSL set to Coolreader, so in my case it actually does start Coolreader.

NiLuJe, thanks for advice, i'd definitely look into rsync, it seems even more fitting than wget for that task (if i'll find out how to use it on kobo lol)

Ken Maltby, i was thinking about OPDS stuff but unfortunately i don't use Koreader and Coolreader doesn't actually have an OPDS feature. So that's not my way to do things here. But thanks anyway

UPD: edited ksmhome, got rid of long line, got rid of that rocket icon, changed it to book, set autostart to 3+coolreader - user experience improved.
UPD2: found the kbterminal thing (why didn't i see it earlier? i think i was blind or tired. or even both.), gotta try to debug my script through this.

Last edited by AlterusPrime; 05-08-2015 at 01:47 AM. Reason: Some updates
AlterusPrime is offline   Reply With Quote
Old 05-08-2015, 04:18 AM   #230
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
Quote:
Originally Posted by AlterusPrime View Post
Now about logging. I was wondering if that's possible to log things into some file 'cause i really want to write the script by myself (just to prove something to myself, and, of course, get the task done), could you possibly tell me how to do the logging?
I would do something like this (it is only the basic idea, not the full code)

Spoiler:
Code:
#create name of log file
debug_logfile=/mnt/onboard/wgettest_$(date +%Y%m%d_%H%M%S).log

# only examples
$theurlbase=http://mybooks.com
$targetdir=/mnt/onboard/.books/wgotbooks

#remove index.html if it exists
rm -f $targetdir/index.html

#log what you are going to do
echo "wget -O $targetdir/index.html  $theurlbase/index.html" > $debug_logfile

# do it now for real
wget -O $targetdir/index.html  $theurlbase/index.html

# save the exitcode into a variable
theexitcode=$?

# if exitcode is not 0 log it and exit the script
if [ "$theexitcode" -ne "0" ]; then
  echo "exitcode: $theexitcode" > $debug_logfile
  exit
else
# parse index.html for links
# remove those links that point to files already downloaded earlier
# or if you want to download updated files that have the same filenames as the old ones,
# it seems you have to download all files and compare them to what is already on the device
# [ some code ]
# loop through the links and try downloading them with wget
# log it in the same way as above
# in order to save time during the first trails, maybe write only the log messages
# without actually trying to download
# [some code]
fi


Quote:
Originally Posted by AlterusPrime View Post
UPD2: found the kbterminal thing (why didn't i see it earlier? i think i was blind or tired. or even both.), gotta try to debug my script through this.
I guess kbterminal is not very useful for this task, do it by telnet if this is possible for you.

As for rsync you can find a compiled version in Yet another telnet/sshd & misc tools package... (kobo-stuff-1.3.N-r11910.tar/KoboStuff/KoboRoot/mnt/onboard/.niluje/usbnet/bin)

Last edited by tshering; 05-08-2015 at 04:39 AM.
tshering is offline   Reply With Quote
Old 05-08-2015, 09:20 PM   #231
juequ
Junior Member
juequ began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2014
Location: Montreal Canada
Device: Amazon Kindle 4, Boox M92, Kobo Aura H2O
Thanks very much for your KSM and updates.

I have a Kobo aura H20 (FW:3.12.0), it had run well with KSM07 + update_001 for months, but I got a problem after installing the update_02 & updat_03.

I followed the spoiler, copied both update_02 & updat_03 to .adds\kbmenu via usb; then disabled usb; then disconnected; then selected "install KSM update" in the menu and wait.
But after Kobo H20 rebooted, I found I can't enable usb any more!

Now, if I select "usb enable.sh", it shows: "USB support: disabled, USBNet support: disabled"; if I select "usb enable id like nickel.sh", it shows the same information.
Otherwise, I select "usbnet toggle.sh", it works and shows: "USNNet support: enabled"!

I've tried reboot it several times, but I got the same situation. I still can't make the usb enabled!


Would you please tell me how can I enable USB?
Thanks very much!

Last edited by juequ; 05-08-2015 at 09:24 PM.
juequ is offline   Reply With Quote
Old 05-08-2015, 10:49 PM   #232
juequ
Junior Member
juequ began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2014
Location: Montreal Canada
Device: Amazon Kindle 4, Boox M92, Kobo Aura H2O
Quote:
Originally Posted by juequ View Post
Thanks very much for your KSM and updates.

I have a Kobo aura H20 (FW:3.12.0), it had run well with KSM07 + update_001 for months, but I got a problem after installing the update_02 & updat_03.

I followed the spoiler, copied both update_02 & updat_03 to .adds\kbmenu via usb; then disabled usb; then disconnected; then selected "install KSM update" in the menu and wait.
But after Kobo H20 rebooted, I found I can't enable usb any more!

...
OK, I fixed it.

Usually, I put an SD card in my Kobo H2O, but I removed the SD card while updating KSM.
After I insert the SD card back into Kobo H2O, the usb can be enabled.

I tried it again: remove SD card, reboot H2O, USB enable does NOT work.
Put SD Card back, USB enable works!

I don't know why, but it seems interesting.

Anyway, thanks!
juequ is offline   Reply With Quote
Old 05-09-2015, 02:10 AM   #233
AlterusPrime
Enthusiast
AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.
 
Posts: 38
Karma: 358
Join Date: May 2015
Device: Kobo Glo
tshering
Thanks for your assistance, it's greatly appreciated.
After all the things i've tried, asked and did looks like finally i've made a script that does what i wanted it to do. It has some flaws (like if server has a dir present - it'll probably won't work but after all it's just a 'i'm lazy, i don't want to connect my USB' kind of script i think it's ok)
So, if somebody ever needs exact same thing i did - here's the listing
Spoiler:

#!/bin/sh

index=/tmp/index_$(date +%Y%m%d_%H%M%S)
pindex=/tmp/pindex_$(date +%Y%m%d_%H%M%S)
cindex=/tmp/cindex_$(date +%Y%m%d_%H%M%S)
theurl=http://192.168.1.10:1111
thedir=/mnt/onboard/.books/wgot_em
thetemp=/mnt/onboard/.books/wgot_em/tmp

if [ ! -d "$thedir" ]; then
mkdir $thedir
fi

mkdir $thetemp
wget -O $index $theurl

while read line ;do
echo $(sed -n "/href/ s/.*href=['\"]\([^'\"]*\)['\"].*/\1/gp" | grep -v '../') > $pindex
done < $index

sed -r -e 's/\s+/\n/g' $pindex > $cindex

while read line ;do
wget -O $thetemp/$line $theurl/$line
mv -f $thetemp/$line $thedir/$line
done < $cindex

rm $index
rm $pindex
rm $cindex
rm -rf $thetemp

Spoiler:

Here's an explanation of what this script does.
First, there's a bunch of variables.
$index is a raw index.html from web server.
$pindex - Prepared index - has only links instead of full html page.
$cindex is a Clear index.html, has \n's instead of spaces.
$theurl - web server's address and port
$thedir - is where books will be stored after all the things done
$thetemp - temp folder under $thedir. removed after script's job done
if block makes sure there's a $thedir.
Then it creates $thetemp and gets unprepared index from server.
After, while loop does extracting job, getting all the links from html, except "../".
sed replaces all the spaces with \n's
Another while loop gets all the files from server and moves them to $thedir rewriting any existing file in here.
And cleans the stuff, removing all the index files and the temp directory


Note: script is adapted to nginx 1.9.0 with autoindex enabled, all the books should be placed in /html (aka root) nginx directory. Provided as-is, not guaranteed to work ('cause i'm bad at scripting), but at least for me it does.

Thanks for all the help i got here

Last edited by AlterusPrime; 05-09-2015 at 02:13 AM. Reason: Weird blank space under the post :O
AlterusPrime is offline   Reply With Quote
Old 05-09-2015, 02:42 PM   #234
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
Quote:
Originally Posted by AlterusPrime View Post
looks like finally i've made a script that does what i wanted it to do.
I am glad you found a solution! Thank you for sharing the script.
tshering is offline   Reply With Quote
Old 05-09-2015, 02:50 PM   #235
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
Quote:
Originally Posted by juequ View Post
OK, I fixed it.

Usually, I put an SD card in my Kobo H2O, but I removed the SD card while updating KSM.
After I insert the SD card back into Kobo H2O, the usb can be enabled.

I tried it again: remove SD card, reboot H2O, USB enable does NOT work.
Put SD Card back, USB enable works!

I don't know why, but it seems interesting.
Indeed, very interesting. Possibly this is not related to the two updates. This strange behaviour might have been there already before. Anyway, I do not know why this is happening on your device. I usually do not use an external SD card and have no problem enabling usb. Can nickel connect to the pc if there is not cd card inserted?
tshering is offline   Reply With Quote
Old 05-09-2015, 06:41 PM   #236
juequ
Junior Member
juequ began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2014
Location: Montreal Canada
Device: Amazon Kindle 4, Boox M92, Kobo Aura H2O
Quote:
Originally Posted by tshering View Post
Indeed, very interesting. Possibly this is not related to the two updates. This strange behaviour might have been there already before. Anyway, I do not know why this is happening on your device. I usually do not use an external SD card and have no problem enabling usb. Can nickel connect to the pc if there is not cd card inserted?

Just tried connecting to PC in nickel, it doesn't show me the screen of connect to PC.
It tried connecting to PC with SD card & without SD card, neither works.

It seems I can't connect to PC in nickel at all.
But it doesn't matter, I can connect my device to PC in KSM.
juequ is offline   Reply With Quote
Old 05-09-2015, 07:14 PM   #237
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
Quote:
Originally Posted by juequ View Post
It seems I can't connect to PC in nickel at all.
But it doesn't matter, I can connect my device to PC in KSM.
I think this is serious. In this situation nickel will not process any books that you put anew to the reader. Maybe you do not use nickel anyway and therefore you do not care so much. But something is wrong with your device. Maybe you should factory reset it.

Do you have any other "irregular" software that runs after boot beside KSM?

Last edited by tshering; 05-09-2015 at 07:17 PM.
tshering is offline   Reply With Quote
Old 05-09-2015, 08:05 PM   #238
flip1314
Member
flip1314 began at the beginning.
 
Posts: 15
Karma: 14
Join Date: Feb 2015
Location: Halifax, NS
Device: Kobo Aura HD & Kobo Aura
Quote:
Originally Posted by tshering View Post
Did anybody try KSM 07 on Glo HD? I am asking because I am planning to publish the next update, and if there is something to adjust for Glo HD, I would like to include these changes now (if they are easily done). Geometry settings could probably be a candidate.

If for some reason KSM does not work on Glo HD at all, wait until nickel (the original Kobo GUI) is started automatically after 20 seconds. Then connect via usb to your pc and delete the folder .adds.
I have a Glo HD. KSM installs fine, but when I go to process update 1 the geometry flips 90 degrees clockwise on the "tap&close" page and I cannot move forward from there.
flip1314 is offline   Reply With Quote
Old 05-10-2015, 06:12 AM   #239
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
Quote:
Originally Posted by flip1314 View Post
I have a Glo HD. KSM installs fine, but when I go to process update 1 the geometry flips 90 degrees clockwise on the "tap&close" page and I cannot move forward from there.
Are you still on this page? If yes, force a power-off (press the power button for 20 seconds or even longer, you will not see any change on the screen) and then power on again. If KSM still not working, power-off and on again, wait until nickel is started automatically, connect via usb, rename .adds\kbmenu to .adds\_kbmenu in order to temporarily disable KSM.
tshering is offline   Reply With Quote
Old 05-10-2015, 07:04 AM   #240
flip1314
Member
flip1314 began at the beginning.
 
Posts: 15
Karma: 14
Join Date: Feb 2015
Location: Halifax, NS
Device: Kobo Aura HD & Kobo Aura
Quote:
Originally Posted by tshering View Post
Are you still on this page? If yes, force a power-off (press the power button for 20 seconds or even longer, you will not see any change on the screen) and then power on again. If KSM still not working, power-off and on again, wait until nickel is started automatically, connect via usb, rename .adds\kbmenu to .adds\_kbmenu in order to temporarily disable KSM.
Ya, I tried that stuff before I got your message. I had to pull the SD card and remove the kbmenu folder to get it working again. It just became a blank screen and would no longer boot nickle.
flip1314 is offline   Reply With Quote
Reply

Tags
koreader/nickel, ksm 07


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo-Adding alternative readers using Kobo Start Menu Ken Maltby KOReader 75 01-10-2020 01:35 PM
Kobo Start Menu tshering Kobo Developer's Corner 918 10-12-2017 02:32 PM
QT Browser for Kobo Start Menu? gloriousglib Kobo Developer's Corner 1 05-24-2014 03:59 AM
kobo menu and message tshering Kobo Developer's Corner 26 01-15-2014 09:18 AM
Calibre start menu icon Cy1clown Calibre 1 02-06-2010 02:10 PM


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


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