|
|
Thread Tools | Search this Thread |
07-21-2019, 09:55 AM | #1 |
Junior Member
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.
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 MAP Last edited by mapal123; 07-21-2019 at 09:59 AM. |
07-21-2019, 10:04 AM | #2 |
BLAM!
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? |
Advert | |
|
07-21-2019, 10:08 AM | #3 |
BLAM!
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
|
|
07-22-2019, 01:37 AM | #4 |
Junior Member
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. |
07-22-2019, 11:11 AM | #5 |
BLAM!
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. |
Advert | |
|
07-22-2019, 12:02 PM | #6 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
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). |
|
07-22-2019, 12:14 PM | #7 |
BLAM!
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.
|
07-22-2019, 12:29 PM | #8 |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
So that's why I've been confused as to whether it does or doesn't.
|
07-23-2019, 01:26 AM | #9 |
Junior Member
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..) |
07-23-2019, 08:32 AM | #10 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
07-23-2019, 10:49 AM | #11 |
BLAM!
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. |
Tags |
weather domoticz display |
|
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 |