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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-21-2018, 03:42 AM   #1
sherman
Evangelist
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
USBMS Shenanigans...

So, I may have been playing a bit the past several days...

I've been trying to see what I can get away with behind Nickel's back, without actually having to kill Nickel. This was born from ideas from kobo-rclone, but I wanted to push things further.

So after some experimentation, getting sidetracked and creating an onscreen keyboard using FBInk (oops...), and many device reboots, I'm finally starting to get something that is faintly approaching stability. I will note that my H2O has carried on like a trooper, although it's probably wondering if there is a Union to join...

Where I'm at currently is I can switch into USBMS mode, remount the internal memory partition (to a different mountpoint, just in case), and crucially, enable WiFi.

Once there, one can do what one wishes to do without having to kill Nickel. Touch input even becomes viable (I may have written a touch driver to go along with the onscreen keyboard). I finally figured out today, that Nickel appears to kill the touch screen after a few seconds in USBMS mode. HOWEVER, not if the Wifi gets re-enabled, which makes me wonder if there is a link somewhere.

This was all done in Go.

Here's a screenshot of what I currently have:
Click image for larger version

Name:	usbms.png
Views:	110
Size:	49.0 KB
ID:	166418

I just thought you folks might be interested. I've got plans for this. PLANS I say
sherman is offline   Reply With Quote
Old 09-21-2018, 08:27 AM   #2
patrik
Addict
patrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy bluepatrik can differentiate black from dark navy blue
 
Posts: 326
Karma: 13166
Join Date: Jan 2010
Device: Kobo Aura HD
Nice
patrik is offline   Reply With Quote
Old 09-21-2018, 12:09 PM   #3
boriar
Addict
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
Posts: 342
Karma: 279082
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Very interesting!
boriar is online now   Reply With Quote
Old 09-21-2018, 12:21 PM   #4
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: 7,590
Karma: 7567460
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
.

The touch input status in USBMS mode *might* be H2O and/or zforce specific: I know I've had to forcibly re-enable it on wakeup in KOReader, because it sometimes failed to wake-up on its own.

On the off-chance you don't actually need WiFi, you can check if the same trick works there:

Code:
echo "a" > /sys/devices/virtual/input/input1/neocmd

Last edited by NiLuJe; 09-21-2018 at 12:27 PM.
NiLuJe is offline   Reply With Quote
Old 09-21-2018, 03:50 PM   #5
pazos
cosiñeiro
pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'
 
Posts: 68
Karma: 10000
Join Date: Apr 2014
Device: mostly kobos (mini, auraHD, auraOne)
Nice work sherman, Did you modified stock shell scripts or found a way to hook your code inside nickel?
pazos is offline   Reply With Quote
Old 09-21-2018, 04:31 PM   #6
sherman
Evangelist
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
Quote:
Originally Posted by pazos View Post
Nice work sherman, Did you modified stock shell scripts or found a way to hook your code inside nickel?
Currently launching via SSH/telnet. Programs that will be distributed could be launched via KFMON.

As far as bringing up Wifi, am currently replicating what the Koreader folks have done in their enable/disable wifi shell scripts.

The screenshot in the OP was just an example test program to bring the three parts, or libraries together. That is the entering/leaving USBMS mode, the on-screen keyboard, and the touch stuff.

The idea is that potential devs can pick and choose the required components.

The goal is not to create a complete GUI toolkit, or anything like that. Rather, to provide a simple means of say letting the user input a password or some other info that might be required.

The original question really was, how much can I get away with without killing Nickel?
sherman is offline   Reply With Quote
Old 09-21-2018, 04:49 PM   #7
pazos
cosiñeiro
pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'
 
Posts: 68
Karma: 10000
Join Date: Apr 2014
Device: mostly kobos (mini, auraHD, auraOne)
Quote:
Originally Posted by sherman View Post
The original question really was, how much can I get away with without killing Nickel?
On the good old days you can pause/resume nickel with killall -STOP/killall -CONT, at some point on FW3.x the trick didn't work (nickel kept polling for events and other programs can't see these inputs)

I am really interested on your research
pazos is offline   Reply With Quote
Old 09-21-2018, 04:54 PM   #8
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: 7,590
Karma: 7567460
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
@pazos: Good point, I can't actually remember on which FW I was the last time I tried that, but I did indeed resort to that for a while when debugging both KFMon & KOReader .

EDIT: Apparently quite a while ago . According to the FW grid that was 3.19 at the very latest. I remember committing that patch some time (possible quite a bit, actually) after having last used it, so, take that with a grain of salt...

Last edited by NiLuJe; 09-21-2018 at 05:00 PM.
NiLuJe is offline   Reply With Quote
Old 09-21-2018, 05:09 PM   #9
sherman
Evangelist
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
I'm probably not going to do much more "research" on capabilities so to speak, I think I've figured out enough that I can do what I want now.

The drive for all of this is for applications which download ebook content. In this situation, doing stuff in USBMS mode means that Nickel will import your content when you leave USBMS mode.

And with the additions NiLuJe has added to FBInk, one can detect when Nickel has finished importing content too. Which opens up further possibilities.

All of this would not have been possible without the prior work done by the Koreader team, and other Kobo devs. All credit goes to them really.
sherman is offline   Reply With Quote
Old 09-25-2018, 12:26 PM   #10
Ace33
Junior Member
Ace33 began at the beginning.
 
Ace33's Avatar
 
Posts: 1
Karma: 10
Join Date: Mar 2018
Device: Kobo Aura One
Is the code anywhere on GitHub, I'm really interested to see how this was implemented in Go
Ace33 is offline   Reply With Quote
Old 09-25-2018, 05:00 PM   #11
sherman
Evangelist
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
Quote:
Originally Posted by Ace33 View Post
Is the code anywhere on GitHub, I'm really interested to see how this was implemented in Go
Not yet, but it will be!

I'm still not sure how stable it really is, and won't really know until I integrate it into a project (which I have such a project in the works). When I'm a bit more sure it's not going to corrupt things, I will be releasing it.

Basically, all three components (USBMS, touch input handling, onscreen-keyboard) are very much still alpha level.
sherman is offline   Reply With Quote
Old 09-25-2018, 06:37 PM   #12
pazos
cosiñeiro
pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'pazos knows the difference between 'who' and 'whom'
 
Posts: 68
Karma: 10000
Join Date: Apr 2014
Device: mostly kobos (mini, auraHD, auraOne)
Quote:
Originally Posted by sherman View Post
Basically, all three components (USBMS, touch input handling, onscreen-keyboard) are very much still alpha level.
I want to know how are you able to read the touchscreen with nickel running.

About alpha quality, I have a couple of "tethered" devices available for testing.
pazos is offline   Reply With Quote
Old 09-25-2018, 07:43 PM   #13
sherman
Evangelist
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
Quote:
Originally Posted by pazos View Post
I want to know how are you able to read the touchscreen with nickel running.

About alpha quality, I have a couple of "tethered" devices available for testing.
When waiting for a touch event, I simply open '/dev/input/event1' and read whatever it spits out (a Linux 'input_event' struct). It's then just a matter of decoding the "event packets" into a set of usable coordinates. No guaranteeing I have that final bit completely correct, as each Kobo device does it different...

This works especially well in USBMS mode (so long as you can keep the touch screen awake), as there are no on-screen Nickel controls to interfere with.

If you folk are happy with alpha level software, I'll upload what I have to Github. Beware, the USBMS stuff is a hot mess of C, mixed with Go (using cgo), and a few calls to external programs for good measure. It ain't pretty, but sorta seems to work. I welcome any help in refining it.
sherman is offline   Reply With Quote
Old 09-28-2018, 04:01 AM   #14
sherman
Evangelist
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 481
Karma: 960665
Join Date: Aug 2008
Location: Auckland - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo, Kobo Aura H2O
Ok, finally got around to putting this all up on Github. The projects are the following:

kobo-sim-usb
go-kobo-input
go-osk

Not the most memorable of names, but hey...

[EDIT: and sorry it's all a bit bare-bones. I just wanted to get something uploaded for you folks]

Last edited by sherman; 09-28-2018 at 04:07 AM.
sherman 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
Firmware Update New Kindle UI: Amazon back with their aggressive obnoxious shenanigans Indigo121 Amazon Kindle 7 03-24-2016 10:43 AM


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


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