View Single Post
Old 08-30-2023, 04:12 PM   #5
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 242
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
Fbpad & USB

It seems there is somewhat flaky support for USB keyboard for fbpad on the Kobo, if you have some productive time to fritter away...
* requires USB host support:
https://www.mobileread.com/forums/sh...d.php?t=340418


DOWNLOAD THE AGETTY PACKAGE:

$ cd myalpine/

$ wget https://dl-cdn.alpinelinux.org/alpin...-2.38.1-r1.apk

RUN THESE COMMANDS FROM LINUX DESKTOP:

$ tar zxvf agetty-2.38.1-r1.apk

$ mv sbin/agetty scripts/

NOW CONNECT YOUR KOBO TO YOUR PC:

Copy your agetty binary from the scripts/ folder on the PC to the sbin/ folder on the kobo.


***UPDATE***
CRITICAL STEP (or agetty won't run):
# cp /mnt/onboard/.adds/koreader/libs/ld-musl-armhf.so.1 /lib/
***

Edit system file on your Kobo at your own risk (may blow up your device - just kidding, but type carefully) :

EDIT /sbin/kobo_getty.sh
Code:
#!/bin/sh
[ -e /dev/ttymxc0 ] && /sbin/getty -L ttymxc0 115200 vt100 &
[ -e /dev/ttyS0 ] && /sbin/getty -L ttyS0 0 vt100 &
[ -e /dev/tty1 ] && /sbin/agetty -s 38400 -t 600 tty1 vt100
* I wouldn't want anyone modifying their system files just because I did.
If I may paraphrase NiLuJe, "Here Be Dragons", where "Dragons" be a metaphor for messing up core system functionality possibly leading to failure to startup or connect, or even mysterious application malfunctions that manifest later on.
These system files were put there by folks with comprehensive system level understanding, to be modified by folks who have invested many person-hours code-grokking/reverse engineering to achieve comparable understanding.
Since I am neither, what is my excuse?
Well on my Clara HD the first two lines are exactly the same except I added the "&" at the end.
I then added the third line which I have researched the meaning of.
Also I have multiple backups and contingency plans for connecting to and/or re-establishing my Clara.
Also, it only cost 99 US$, is not used for work, and contains no important data.
So non-expert readers, please make your own risk assessment.


Edit NickelMenu config file:

EDIT /mnt/onboard/.adds/nm/config.txt
Code:
menu_item :main :fbpad :cmd_spawn :quiet:/mnt/onboard/.adds/koreader/scripts/fbpad /bin/sh 0</dev/tty1
    chain_success                      :dbg_toast          :Started fbpad                           
    chain_failure                      :dbg_toast          :Error                                   
menu_item :main :Stop fbpad :cmd_spawn :quiet:/usr/bin/pkill fbpad                                
    chain_success                      :dbg_toast          :Stopped fbpad                           
    chain_failure                      :dbg_toast          :Error

Power off your Kobo.
When you restart it, set USB host mode, plug in your powered USB connected keyboard, run fbpad from NickelMenu, and type (may stall).




*****


CORRECTION FOR MORE STABLE OPERATION:

DO NOT EDIT /sbin/kobo_getty.sh. RETURN IT TO ORIGINAL STATE, e.g.:
Code:
#!/bin/sh
[ -e /dev/ttymxc0 ] && /sbin/getty -L ttymxc0 115200 vt100
[ -e /dev/ttyS0 ] && /sbin/getty -L ttyS0 0 vt100
#[ -e /dev/tty1 ] && /sbin/agetty -s 38400 -t 600 tty1 vt100

INSTEAD EDIT /etc/inittab to add the agetty line only:
Code:
::sysinit:/etc/init.d/rcS
::respawn:/sbin/kobo_getty.sh
::once:/sbin/agetty -s 38400 -t 600 tty1 vt100
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rcK
::restart:/sbin/init
***
***UPDATE***
See POST #7 for a better way of doing this.
Avoids the most system file meddling, but you will have to kill agetty again each time you return to Nickel after exiting KOReader.
***


Edit NickelMenu config file to add Stop agetty command:

EDIT /mnt/onboard/.adds/nm/config.txt
Code:
menu_item :main :fbpad :cmd_spawn :quiet:/mnt/onboard/.adds/koreader/scripts/fbpad /bin/sh 0</dev/tty1
    chain_success                      :dbg_toast          :Started fbpad                           
    chain_failure                      :dbg_toast          :Error                                   
menu_item :main :Stop fbpad :cmd_spawn :quiet:/usr/bin/pkill fbpad                                
    chain_success                      :dbg_toast          :Stopped fbpad                           
    chain_failure                      :dbg_toast          :Error  
menu_item :main :Stop agetty :cmd_spawn :quiet:/usr/bin/pkill agetty                                
    chain_success                      :dbg_toast          :Stopped agetty                           
    chain_failure                      :dbg_toast          :Error


Power off your Kobo.
When you restart it, set USB host mode, plug in your powered USB connected keyboard, run Stop agetty, then fbpad from NickelMenu, and type (shouldn't stall).

Last edited by elinkser; 10-22-2023 at 12:33 PM. Reason: risk notice, cd, corrected stability,better hack,ld-musl-armhf.so.1
elinkser is offline   Reply With Quote