10-19-2012, 09:05 PM | #1 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Kobo Weather Forecast - for Wifi and Touch
This project was inspired by Matthew Petroff's Kindle weather display
Update: I've changed the script to work on Kobos with a 4-bit framebuffer, as well as on 8-bit framebuffers. Update 2: The script now uses worldweatheronline.com to get the weather forecast, so it's not limited to the US anymore. Update 3: If you have a Kobo Touch, see this post for directions on getting this app working on your Touch. Now that I can draw to the Kobo Wifi's screen, I just had to create something ASAP. Presenting, the Kobo Weather Forecast! How to install The first step of installing is to Enable telnet access to your Wifi. After that's done, download the weather forecast installer and copy it to the .kobo folder on your Wifi. Eject your Wifi from your computer and wait for your Wifi to install the package. It'll take a couple of minutes. Once your Wifi has finished installing and has rebooted, telnet in to your Wifi Code:
telnet YOUR_KOBO_IP Code:
/mnt/onboard/.python/install-python.sh Code:
/mnt/onboard/.python/weather.sh By default, it does not automatically update every hour. If you want it to auto-update, run the following command: Code:
/mnt/onboard/.apps/koboWeather/autoupdate.sh Code:
echo C > /mnt/onboard/.apps/koboWeather/unit.txt Last edited by KevinShort; 12-15-2012 at 10:03 AM. |
10-20-2012, 10:45 AM | #2 |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Cool!
|
Advert | |
|
10-21-2012, 11:59 PM | #3 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2012
Device: Kobo
|
Will this hack work with the Kobo Touch device ?
|
10-22-2012, 07:06 AM | #4 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2012
Device: Sony PRS-505 and Kobo WiFi
|
I can't seem to get it to work on my UK Kobo WiFi with 1.9.10 firmware. I've rooted it, enabled telnet, installed Python and pygame, but when I come to run the script I get the following error:
Kobo Wifi weather forecast started. Getting weather information . . . Drawing to the screen . . . Traceback (most recent call last): File "weather.py", line 346, in <module> get_weather_data() File "weather.py", line 93, in get_weather_data display(days, highs, lows, conditions, img_links) File "weather.py", line 100, in display pygame.display.init() pygame.error: Unsupported console hardware A quick search tells me that "echo 1 > /sys/class/graphics/fb0/rotate" should fix it - but it doesn't. I can echo as much as I like to that file, but pygame still errors out. Any idea what I'm doing wrong? |
10-22-2012, 09:23 AM | #5 |
No Comment
Posts: 3,240
Karma: 23878043
Join Date: Jan 2012
Location: Australia
Device: Kobo: Not just an eReader, it's an adventure!
|
|
Advert | |
|
10-22-2012, 10:10 AM | #6 |
Junior Member
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: kobo wifi
|
I have the same problem as ghalfacree on the same firmware.
If you look at weather.sh you can see it already does echo 1 > /sys/class/graphics/fb0/rotate So that's not going to fix it. I'm going to be so impressed if someone can fix this - the example weather app is very neat, but the whole idea of being able to write Python apps for the kobo is absolutely amazing, so cheers Kevin for work so far. |
10-22-2012, 10:50 AM | #7 | |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I'm not sure if it will work right out of the box, but it could definitely be made to work.
You could go ahead and try to run it as-is on the Touch. I'm just not sure if the Touch's e-ink display will allow updating the screen in the same way as the Wifi Quote:
After a reboot, what is in the rotate file? Mine contains a single zero. Code:
cat /sys/class/graphics/fb0/rotate My US Kobo Wifi is running firmware 1.9 (r25373), from March 29, 2011. Last edited by KevinShort; 10-22-2012 at 11:04 AM. |
|
10-22-2012, 11:13 AM | #8 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: kobo wifi
|
This is after a reboot... looks like at least the rotate file is the same...
Quote:
0 [root@(none) /]# fbset mode "600x800-0" # D: 0.038 MHz, H: 0.063 kHz, V: 0.079 Hz geometry 600 800 600 800 4 timings 26400000 0 0 0 0 0 0 accel false rgba 4/0,4/0,4/0,0/0 endmode |
|
10-22-2012, 02:02 PM | #9 | |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Quote:
Here's my fbset output: Code:
[root@(none) /]# fbset
mode "600x800-0"
# D: 0.038 MHz, H: 0.063 kHz, V: 0.079 Hz
geometry 600 800 600 800 8
timings 26400000 0 0 0 0 0 0
accel false
rgba 8/0,8/0,8/0,0/0
endmode
others were 8-bit. Maybe I can grab some code from over there and see how they deal with it. . . |
|
10-22-2012, 04:10 PM | #10 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2012
Device: Kobo Touch
|
Just tried it out on the Kobo Touch
So I had previously rooted my kobo touch specifically to serve this function after reading about the kindle hack. My old way of doing this was with some scripts on my media server that would generate a correctly formatted .raw file and push it to my kobo touch's screen. Your way seems way more streamlined so I decided to give it a try.
I manually pushed the ".apps" and ".python" to their respective places in "/mnt/onboard/" and ran the script you provided for installing python. This all worked great until I tried running the weather script, it gets through asking for my lat and long and grabbing weather data.. then it dies at: Code:
[root@(none) koboWeather]# python weather.py Kobo Wifi weather forecast started. Getting weather information . . . Drawing to the screen . . . init kbd. init mouse failed. Traceback (most recent call last): File "weather.py", line 346, in <module> get_weather_data() File "weather.py", line 93, in get_weather_data display(days, highs, lows, conditions, img_links) File "weather.py", line 111, in display tiny_font = pygame.font.Font("Cabin-Regular.ttf", 18) RuntimeError: Couldn't load font file ## Edit So I poked around a bit more and realized I don't have a "mouse" binary. The Kobo touch uses a binary called "pickle" to write to the screen. I guess I'll have to poke at it a while and see where I get. Last edited by atomney; 10-22-2012 at 04:16 PM. Reason: I found out more information |
10-22-2012, 04:34 PM | #11 | |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Quote:
and it doesn't prevent the app from continuing to run. The Wifi and Touch both use pickel to display images. (Though I have been able to drive the Touch's screen directly, see my Tetris port) From the error you posted, the script hasn't even gotten to drawing anything yet, but is trying and failing to load a font file. Did you double-check that the font file "Cabin-Regular.ttf" was in the same directory as the "weather.py" script? Last edited by KevinShort; 10-22-2012 at 04:40 PM. |
|
10-22-2012, 06:04 PM | #12 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: kobo wifi
|
Quote:
I'm **way** out of my depth here (decent on Python but embedded Linux - ) but if there's any way I can help sort this for those of us with these devices let me know. Out of interest, I saw the weather app makes a call to update the e-ink after the final pygame call - but did pygame itself need modifying to talk to a / the Kobo's framebuffer? Edit: looks like there's more detail on the kindle buffers here. Last edited by lst; 10-22-2012 at 06:06 PM. Reason: added link |
|
10-22-2012, 09:57 PM | #13 | ||
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Quote:
And I have absolutely no experience with embedded Linux myself outside of my Kobo work. I'm just a high school student who likes to fiddle with stuff. Quote:
it to work was just a matter of compiling python and pygame in a virtual machine for ARM. |
||
10-23-2012, 03:04 PM | #14 |
Addict
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I've found out that pygame doesn't support any bit depth less than 8.
Could someone with a 4-bit Wifi try these commands after a fresh reboot and post the output? Code:
[root@(none) /]# cat /dev/urandom > /dev/fb0 cat: write error: No such device [root@(none) /]# echo 1 > /sys/class/graphics/fb0/rotate [root@(none) /]# cat /dev/urandom > /dev/fb0 cat: write error: No space left on device Code:
cat /dev/fb0 > /tmp/fb cat /tmp/fb | /usr/local/Kobo/pickel showpic |
10-23-2012, 07:06 PM | #15 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Oct 2012
Device: kobo wifi
|
Quote:
Code:
[root@(none) /]# cat /dev/urandom > /dev/fb0 cat: write error: No space left on device [root@(none) /]# echo 1 > /sys/class/graphics/fb0/rotate [root@(none) /]# cat /dev/urandom > /dev/fb0 cat: write error: No space left on device [root@(none) /]# /mnt/onboard/.python/eink_update.sh 2048+0 records in 2048+0 records out 1048576 bytes (1.0MB) copied, 0.018657 seconds, 53.6MB/s Just to confirm I hadn't somehow changed stuff earlier, after this I rebooted again and got: Code:
[root@(none) /]# cat /sys/class/graphics/fb0/rotate 0 Last edited by lst; 10-23-2012 at 07:09 PM. |
|
Tags |
hacking, kobo wifi |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Odd; Kobo-purchased book reads fine on Desktop, WiFi and Sony -but not on Kobo Touch. | beautifulsoup | Kobo Reader | 4 | 07-17-2012 10:29 AM |
Kobo Touch in cold weather | Judsuw | General Discussions | 15 | 06-02-2012 07:23 PM |
Sync epubs between Kobo app and Kobo wifi? | emilikins | Kobo Reader | 1 | 11-17-2011 05:12 PM |
Kobo Desktop App v1.7 onboard Kobo WiFi | ZombWii | Kobo Reader | 6 | 10-20-2010 01:24 PM |
Forrester upgrades sales forecast by 50% | xoox | News | 0 | 10-10-2009 05:11 AM |