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 12-25-2021, 03:20 PM   #196
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Naturally I want to keep using this as well - on my Libra 2 which has been sitting unused in its box for way too many days now - but it'll take time and motivation, which is a bit complicated right now. Won't be able to do anything much for another month at least, sorry. If you didn't already replace the bundled outdated fbink with uptodate version, maybe that alone would help you already
frostschutz is offline   Reply With Quote
Old 12-27-2021, 04:31 PM   #197
vdanjean
Junior Member
vdanjean began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2021
Device: none
Hi,
fbink from https://www.mobileread.com/forums/sh...d.php?t=299110 is not recent enough for Kobo Sage. But recompiling it from github sources works ;-) You can see my messages at the end of the just cited thread.

I've been hit by another problem with AutoShelf. To detect user action, it monitors /dev/input/event1. But, on Kobo Sage, this is not (always?) the good file.
I wrote a patch to detect the good eventX file based on /proc/bus/input/devices.
To be fully correct, we must know the name of the touch screen. I put the one I know in the script (ie for Kobo Sage and Kobo Forma).
If nothing is found, it failback to /dev/input/event1 as before but also generate a file in /mnt/onboard/AutoShelf-bugreport.txt (with the contents of /proc/bus/input/devices) so that my patch can be improved.

I put my patch below, feel free to use it as you want.

I can also give you the full updated KoboRoot.tgz if you wish to quickly update the package.

Regards,

Code:
diff --git a/usr/local/AutoShelf/autoshelf.sh b/usr/local/AutoShelf/autoshelf.sh
index 8f09d7a..7a433a6 100755
--- a/usr/local/AutoShelf/autoshelf.sh
+++ b/usr/local/AutoShelf/autoshelf.sh
@@ -15,6 +15,77 @@ config() {
     [ "$value" != "" ] && echo "$value" || echo "$2"
 }
 
+#
+# touchscreen input file
+#
+TS_GUESS=
+ts_input() {
+    local l
+    local FOUND=
+    local CANDIDATE=/dev/input/event1
+    local EVENT
+    local tempdir="$(mktemp -d)"
+    mkfifo "$tempdir/fifo"
+    cat /proc/bus/input/devices > "$tempdir/fifo" &
+    while read l; do
+	case "$l" in
+        'N: Name="cyttsp5_mt"') FOUND=1;;
+	'N: Name="Elan Touchscreen"') FOUND=1;;
+	'N: Name='*[Tt]ouch[Ss]creen*) FOUND=2;;
+        'H: Handlers='*) EVENT="$(echo "$l" | sed -e 's/.*\(event[0-9]\+\).*/\1/')" ;;
+	'')
+	    case "$FOUND" in
+	    1)
+		echo /dev/input/"$EVENT"
+		rm -rf "$tempdir"
+		return ;;
+	    2)
+		CANDIDATE="/dev/input/$EVENT"
+		;;
+	    esac
+	    FOUND= ;;
+        *) ;;
+	esac
+    done < "$tempdir/fifo"
+    rm -rf "$tempdir"
+    TS_GUESS=1
+    echo "CANDIDATE=$CANDIDATE"
+}
+
+ts_warn() {
+    if [ "$TS_GUESS" != 1 ]; then
+	return
+    fi
+
+    for i in $(seq 1 60)
+    do
+        if [ -e /mnt/onboard/.kobo/KoboReader.sqlite ]
+        then
+            break
+        fi
+
+        sleep 1
+	break
+    done
+
+    if [ ! -e /mnt/onboard/.kobo/KoboReader.sqlite ]; then
+	: return
+    fi
+
+cat > /mnt/onboard/AutoShelf-bugreport.txt <<EOF
+The touchscreen have not been exactly detected.
+To improve AutoShelf, please send the following information to the developpers:
+
+Input devices on the machine:
+$(cat /proc/bus/input/devices)
+
+Machine version:
+$(cat /mnt/onboard/.kobo/version)
+$(uname -a)
+
+EOF
+}
+
 # database escapes
 escape() {
     echo -n "${1//"'"/"''"}"
@@ -241,7 +312,8 @@ then
     grep /mnt/onboard /proc/mounts && exit
     fbink -g file="/usr/local/AutoShelf/autoshelf-off.png"
 
-    while cat /dev/input/event1 | dd bs=1 count=1
+    TS_INPUT="$(ts_input)"
+    while cat "$TS_INPUT" | dd bs=1 count=1
     do
         grep /mnt/onboard /proc/mounts && exit
 
@@ -267,6 +339,7 @@ then
     exit
 elif [ ! -e /tmp/autoshelf-on ]
 then
+    ts_warn
     # disabled mode
     exit
 fi
@@ -285,6 +358,8 @@ do
     sleep 1
 done
 
+ts_warn
+
 if [ -e /mnt/onboard/.kobo/KoboReader.sqlite ]
 then
     cfg_logfile="$BASE"/$(config logfile '')
vdanjean is offline   Reply With Quote
Old 12-27-2021, 05:02 PM   #198
vdanjean
Junior Member
vdanjean began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2021
Device: none
I made a github pull request if you prefer.
vdanjean is offline   Reply With Quote
Old 12-27-2021, 05:44 PM   #199
gesundheit
Member
gesundheit began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Sep 2021
Device: Kindle PW5 SE (2021)
What's the programmatic reason for the chance of database corruption? I'd like to be able to use this, but I'd rather not have to keep backing up KoboReader.sqlite. I'm interested in seeing if I can fix this bug.
gesundheit is offline   Reply With Quote
Old 01-28-2022, 11:27 AM   #200
JeanCremers
Member
JeanCremers began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2022
Device: kobo
i got my new kobo libra 2 today and tried the script. Firmware version 4.30.18838. This is my first kobo. After connecting an image comes up with a couple of books, when clicked it changes into an image with AUTOSHELF below but nothing seems to happen. When clicked again it changes back to the previous image. On disconnect nothing seems to have happened, no collections were made.
JeanCremers is offline   Reply With Quote
Old 01-28-2022, 12:00 PM   #201
makara
Connoisseur
makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'
 
makara's Avatar
 
Posts: 79
Karma: 10000
Join Date: Jul 2012
Location: Israel
Device: KA1, KLH2O, Oasis 3
Everything worked on Kobo Aura One.(4.30.18838) The problem was in the Macintosh archiver. Everything worked out in the Windows environment.
makara is offline   Reply With Quote
Old 01-28-2022, 12:01 PM   #202
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Quote:
Originally Posted by JeanCremers View Post
when clicked it changes into an image with AUTOSHELF below
That's autoshelf ON state.

Quote:
When clicked again it changes back to the previous image.
That's OFF state

autoshelf runs on usb disconnect if it was set to ON state. it won't run when OFF (default is OFF)

and yes, sorry, this still needs an update
frostschutz is offline   Reply With Quote
Old 01-28-2022, 01:49 PM   #203
JeanCremers
Member
JeanCremers began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2022
Device: kobo
Excuse for being so dumb.
1 i put a folder with books (*.txt) into x:\.kobo like x:\.kobo\Asimov
2 i disconnect the kobo so it can update it's database
3 i connect thje kobo again, and press the autoshelf icon so it's on and starts after disconnect.
4 i disconnect the kobo duh.

Still not getting what i want, sometimes i see one collection added named Unknown/ with one book in it, not the one that was in the folder i copied.
JeanCremers is offline   Reply With Quote
Old 01-28-2022, 02:00 PM   #204
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,525
Karma: 78910202
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by JeanCremers View Post
1 i put a folder with books (*.txt) into x:\.kobo like x:\.kobo\Asimov
Interesting I never knew one could purchase Asimov's books in TXT format.

Sent from my Pixel 4a using Tapatalk
PeterT is offline   Reply With Quote
Old 01-28-2022, 02:26 PM   #205
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
well, .kobo is ignored by default (skip path setting)
frostschutz is offline   Reply With Quote
Old 01-28-2022, 02:47 PM   #206
JeanCremers
Member
JeanCremers began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2022
Device: kobo
sigh, they were converted for my old kindle.
JeanCremers is offline   Reply With Quote
Old 01-28-2022, 02:48 PM   #207
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,758
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by JeanCremers View Post
they were converted for my old kindle.
Do you have the original format? If it's ePub, use that for your Kobo. If not, use Calibre to convert to ePub.
JSWolf is online now   Reply With Quote
Old 01-29-2022, 07:41 AM   #208
JeanCremers
Member
JeanCremers began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2022
Device: kobo
@frostschutz it worked like a charm. Thanks!
@JSWolf i used calibre to convert to epub yes, thanks.
JeanCremers is offline   Reply With Quote
Old 02-05-2022, 12:26 AM   #209
poczynek
Zealot
poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.
 
Posts: 114
Karma: 26552
Join Date: Jan 2017
Device: Kobo Forma
I have factory reset my Forma and i just cannot uninstall Autoshelf Beta. I have also put the dot folder in the main directory of Kobo but it still comes up when i am plugged into a computer. How can i permanently uninstall?
poczynek is offline   Reply With Quote
Old 02-05-2022, 01:50 AM   #210
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by poczynek View Post
I have factory reset my Forma and i just cannot uninstall Autoshelf Beta. I have also put the dot folder in the main directory of Kobo but it still comes up when i am plugged into a computer. How can i permanently uninstall?
Did you do the factory reset from the Device information page of the settings? If so, that only formats the book partition and doesn't clear the root partition. The full factory reset, which sets the firmware back to the original, can be done from the Developers option screen when developers mode is on, or using the manual factory reset.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Beta for BB? FF2 Amazon Kindle 2 05-28-2011 10:21 AM
Development Signing up for the beta glen enTourage Archive 16 04-06-2011 04:33 PM
Beta Beta Test of Major New Features Starson17 Calibre 45 05-17-2010 10:55 AM
0.6 out of beta? Nate the great Calibre 3 07-17-2009 02:45 AM


All times are GMT -4. The time now is 04:28 PM.


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