Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-21-2019, 09:55 AM   #1
mapal123
Junior Member
mapal123 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2019
Device: kindle
Kindle weather+domotic display : need a second page/image activated with touch

Hi!
Great forum here, it was really useful to me to develop my own Weather display.
It display data from a french weather website, temp graph, and also temperature of my home gotten from my domotic system.
It's based on Mathew petroff project


Here is a snapshot in case anyone is interested




The hard heavy part I all coded in python (that I know well) , it modifies in the end a SVG file, that is converted in png.

The kindle "only" downloads the png via a cronjob (see code at the end of the post) from my local server, every couple of minutes, displays it using eips command. Kindle commands I know almost nihil.

Bash, linux, I am ok with it, but not a champion!

I've seen Kual, but I am thinking I need only a small part of it, or even there is a much easier solution.

Now for the questions.
  1. 1) Anybody knows an easy way to use touchscreen to implement a simple action (toggle eips and display a second .png with other informations)
  2. 2) other commands that I could use to:
    - lower / increment background visibility of kindle
    - restart framework /re-enable sleep
    I would like to launch them in the cronjob, if a given file is found (or not) on the server. This would leave the "intelligence" on my server!

Here's kindle code I used from Mathew petroff project

Code:
stop framework  #as name suggests

lipc-set-prop -i com.lab126.powerd preventScreenSaver 1  #disables screensaver /sleep
lipc-set-prop com.lab126.pillow disableEnablePillow disable

wget http://IP/weather-script-output.png  #gets the image from servr
eips -f -g weather-script-output.png   #displays it
All help would be really appreciated

MAP

Last edited by mapal123; 07-21-2019 at 09:59 AM.
mapal123 is offline   Reply With Quote
Old 07-21-2019, 10:04 AM   #2
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Note that a cron job will only do the... job if the device is never put to sleep (i.e., it needs to be tethered to a power source).

Otherwise, you're entering the rtc wakeup wasteland, so here be dragons...

That said...

1/ You can either parse the input event yourself, the Kindle does things in a roughly sane manner (i.e., Linux evdev).
Or you can rely on third-party tools to do the heavy lifting (i.e., evtest or evemu, which I just added to USBNetwork. The stock evtest might be good enough, depending on what you need it for).

3/ Not quite sure what you meanly that? The front light intensity, you mean? (In which case, there are lipc commands that I don't remember OTOH, check KOReader's kindle powerd module).

4/ Basically the invert of the two lipc commands you quoted .
Note that the pillow thing doesn't necessarily work as well as you might want it to on newer FWs versions. See comments about that in KOreader's startup script.

5/ See my comments at the start of this post. Otherwise, I don't see what else might be Kindle-specific in this query?
NiLuJe is offline   Reply With Quote
Advert
Old 07-21-2019, 10:08 AM   #3
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Sidebar: since you mentioned Python, note that you could move most of the display logic in there, on-device, since I ship FBInk/py-fbink with my Python packages, which means yummy interaction with Pilllow.
NiLuJe is offline   Reply With Quote
Old 07-22-2019, 01:37 AM   #4
mapal123
Junior Member
mapal123 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2019
Device: kindle
Hi thanks for the comments and suggestions.
indeed I know cron only does HIS job.

On my media server I have a remote and a bash script running evtest in. a loop and acting on some buutton push. this works.
So I will study on ssh evtest , what happens when I toiuch the screen.

is there a lighter simpler way though? (ie without a bash script like described here). I don't need to identify a specific portion of the screen only the touch event and an associated bash command.
I have usb net 0.22 I think.
mapal123 is offline   Reply With Quote
Old 07-22-2019, 11:11 AM   #5
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
You'll always need *something* the poll the input device . However you implement that is up to you, though. If you're okay with reacting to the barest random brushes, you can simply poll it and react to the first thing that comes up (random Google link that is completely random and I haven't actually read: https://www.linuxjournal.com/article/6429). Just keep in mind that "one touch == *multiple* evdev events" with a touchscreen, it's less straightforward than a keyboard where you basically only get keydown/keyup/keyrep & sync events.

But if you need to react to only some *specific* things, you'll either have to decode it yourself (it's actually fairly straightforward, we've had people doing it in shell over in Kobo-land), or rely on something that does it for you (f.g., evtest).

Last edited by NiLuJe; 07-22-2019 at 11:17 AM.
NiLuJe is offline   Reply With Quote
Advert
Old 07-22-2019, 12:02 PM   #6
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by mapal123 View Post
Hi thanks for the comments and suggestions.
indeed I know cron only does HIS job.

On my media server I have a remote and a bash script running evtest in. a loop and acting on some buutton push. this works.
So I will study on ssh evtest , what happens when I toiuch the screen.

is there a lighter simpler way though? (ie without a bash script like described here). I don't need to identify a specific portion of the screen only the touch event and an associated bash command.
I have usb net 0.22 I think.
If you use ssh to login over the USB network, the kernel will set an internal bit "run lock". That is, it will never shut down, which is nice, since it is also getting power from the USB cable.
You WILL see the screen enable its "screen saver" on time-out, but that does not effect the kernel shutdow (just the change in the display).
knc1 is offline   Reply With Quote
Old 07-22-2019, 12:14 PM   #7
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
That *may* not hold true anymore on the KOA2/PW4/KOA3: my Forma, which runs on a similar HW as those three, will happily suspend while plugged in in USBNet mode, unlike all my other devices, which behave as @knc1 just described.
NiLuJe is offline   Reply With Quote
Old 07-22-2019, 12:29 PM   #8
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by NiLuJe View Post
That *may* not hold true anymore on the KOA2/PW4/KOA3: my Forma, which runs on a similar HW as those three, will happily suspend while plugged in in USBNet mode, unlike all my other devices, which behave as @knc1 just described.
So that's why I've been confused as to whether it does or doesn't.
j.p.s is offline   Reply With Quote
Old 07-23-2019, 01:26 AM   #9
mapal123
Junior Member
mapal123 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2019
Device: kindle
ok thanks all for the answers. evtest seems perfect...and my action will be delayed so whatever touch is caught is good (kindle is fixed near the wall)

quick last dummy question...
who will poll evtest...is it running in the background and itself handling actions..or do I need to make it run in a loop by bash command?

if you have a link with a kindle example (or linux compatible) that'd be great and will avoid me trial and error next weekend (I have a baby..less time now to play around than before..)

mapal123 is offline   Reply With Quote
Old 07-23-2019, 08:32 AM   #10
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by mapal123 View Post
- - - - -

(I have a baby..less time now to play around than before..)

Evidently, you already had too much "play around" time before.
knc1 is offline   Reply With Quote
Old 07-23-2019, 10:49 AM   #11
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I was actually thinking of the actual poll() syscall wrapper in C at the time, but the idea is similar .

Either you loop on evtest and parse the output yourself, or you loop on evtest in query mode to let it do the parsing for you.
NiLuJe is offline   Reply With Quote
Reply

Tags
weather domoticz display


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
K3 Kindle Keyboard 3 with Version 3.4.2. Possible to jailbreak to display time/weather? lori87 Kindle Developer's Corner 6 12-30-2022 04:49 PM
Weather display without server Rocketmagnet Kindle Developer's Corner 2 05-05-2015 10:31 PM
Display of a png image linked to a svg image roger64 Editor 6 03-13-2015 06:21 AM
Kindle Weather Display WITHOUT server scolby33 Kindle Developer's Corner 41 07-21-2014 08:30 AM
Please help install weather display... (-_-) Kindle Developer's Corner 1 04-25-2013 07:59 PM


All times are GMT -4. The time now is 11:51 AM.


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