Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2014, 03:40 PM   #121
dudedudedude
Junior Member
dudedudedude began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2014
Device: Aura
Somebody suggested I necropost in this thread with my question. Please excuse the new username, I forgot my old one so decided to just make a new account:

So did anyone successfully get the weather app installed from here onto the aura with the latest firmware? I managed to telnet into my device, I extracted the python libraries from here and have the app (all the root files from the site) extracted in my .kobo folder (which, I assume, is the successor of the .apps folder mentioned in the link) but am at a loss about what I should do next. Running

LD_LIBRARY_PATH=mnt/onboard/.kobo/python/pygamelibs/ python


results in a file not found message. Running weather.py from the bitbucket link using SSH results in a "Permission denied" message even though it looks like I'm in as root and I don't know what the equivalent of SUDO is for running files using SSH...

Yeah, I'm something of a noob that's patient enough to get somewhere. I would appreciate any help or advice with this.

My device is a Kobo Aura running the latest firmware and yes, I backed it up to a 4gb microsd using this method before trying any of this.

Last edited by dudedudedude; 03-15-2014 at 01:35 AM.
dudedudedude is offline   Reply With Quote
Old 03-14-2014, 07:08 PM   #122
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
What if you use the absolute path to python? I'm guessing it would be this:
Code:
LD_LIBRARY_PATH=mnt/onboard/.kobo/python/pygamelibs/ /mnt/onboard/.kobo/python/bin/python
One question for you. How did you make a backup of your Aura? I thought they didn't use internal micro SD cards.
KevinShort is offline   Reply With Quote
Advert
Old 03-15-2014, 04:42 PM   #123
dudedudedude
Junior Member
dudedudedude began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2014
Device: Aura
Thanks I encountered another error, though:



Even though I connected my kobo via USB and was staring right at that file right where the shell said it should be. Any idea why it's complaining?

Also, to answer your question, I just followed the instructions in the thread. I guess it does have an internal micro SD card?
dudedudedude is offline   Reply With Quote
Old 05-25-2014, 06:11 PM   #124
claybratt
Junior Member
claybratt began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2014
Device: Kobo Wifi
I tried getting the hello world python script to run but I get this error message.

Hello, world
Traceback (most recent call last):
File "hello.py", line 13, in <module>
call(["/bin/show_pic", "/tmp/image.jpg"])
File "/mnt/onboard/.python/lib/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/mnt/onboard/.python/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/mnt/onboard/.python/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I thought it may have been from one of the firmware updates so I got a copy of an older SD card image from Davidfor, thank you by the way.

Thank you for any help.

I managed to copy the image.jpg and open it on my computer, looks like it was generated fine. So I'm thinking it may be an issue with the call to show pic.

Last edited by claybratt; 05-26-2014 at 01:21 PM.
claybratt is offline   Reply With Quote
Old 01-13-2015, 06:12 PM   #125
ro-76
Junior Member
ro-76 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2003
Location: Ireland
Device: Pocket PC
I just got my Kobo wifi working again after a repeat flash of the SD card. I tried to install this again and get an error when I run the weather app:

Kobo Wifi weather forecast started.
Getting weather information . . .
Traceback (most recent call last):
File "weather.py", line 363, in <module>
get_weather_data()
File "weather.py", line 53, in get_weather_data
weather_xml = urllib2.urlopen(weather_link)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 1174, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>

Does anyone have some advice on how to fix this?

Thx
ro-76 is offline   Reply With Quote
Advert
Old 01-13-2015, 07:38 PM   #126
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Quote:
Originally Posted by ro-76 View Post
I just got my Kobo wifi working again after a repeat flash of the SD card. I tried to install this again and get an error when I run the weather app:

Kobo Wifi weather forecast started.
Getting weather information . . .
Traceback (most recent call last):
File "weather.py", line 363, in <module>
get_weather_data()
File "weather.py", line 53, in get_weather_data
weather_xml = urllib2.urlopen(weather_link)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/mnt/onboard/.python/lib/python2.7/urllib2.py", line 1174, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>

Does anyone have some advice on how to fix this?

Thx
The URL that was used for the weather seems to have changed.

The application uses
Code:
http://free.worldweatheronline.com/feed/weather.ashx?q=lat,long&format=xml&num_of_days=5&key=525804183f140652120211
This seems to have changed to
Code:
http://api.worldweatheronline.com/free/v2/weather.ashx?q=lat,long&format=xml&num_of_days=5&key=525804183f140652120211
however the existing API key seems to be invalid.

I've got a new key, however I sense the format of the data being returned has changed. When I get the script working I'll let you know
PeterT is offline   Reply With Quote
Old 01-13-2015, 07:50 PM   #127
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Try making these changes in the weather.py

Change
Code:
weather_link='http://free.worldweatheronline.com/feed/weather.ashx?q={0},{1}&format=xml&num_of_days=5&key=525804183f140652120211'.format(lat, lon)
to
Code:
weather_link='http://api.worldweatheronline.com/free/v2/weather.ashx?q={0},{1}&format=xml&num_of_days=5&key=95f758b5c88e1b323c12bd1017202'.format(lat, lon)
(note the new URL and the new key value).

Change
Code:
h_temps = dom.getElementsByTagName('tempMax%s' % unit)
l_temps = dom.getElementsByTagName('tempMin%s' % unit)
to
Code:
h_temps = dom.getElementsByTagName('maxtemp%s' % unit)
l_temps = dom.getElementsByTagName('mintemp%s' % unit)
PeterT is offline   Reply With Quote
Old 01-14-2015, 04:56 PM   #128
ro-76
Junior Member
ro-76 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2003
Location: Ireland
Device: Pocket PC
Quote:
Originally Posted by PeterT View Post
Try making these changes in the weather.py

Change
Code:
weather_link='http://free.worldweatheronline.com/feed/weather.ashx?q={0},{1}&format=xml&num_of_days=5&key=525804183f140652120211'.format(lat, lon)
to
Code:
weather_link='http://api.worldweatheronline.com/free/v2/weather.ashx?q={0},{1}&format=xml&num_of_days=5&key=95f758b5c88e1b323c12bd1017202'.format(lat, lon)
(note the new URL and the new key value).

Change
Code:
h_temps = dom.getElementsByTagName('tempMax%s' % unit)
l_temps = dom.getElementsByTagName('tempMin%s' % unit)
to
Code:
h_temps = dom.getElementsByTagName('maxtemp%s' % unit)
l_temps = dom.getElementsByTagName('mintemp%s' % unit)

Thanks for the super quick reply. I ran it again, but I now have this error:

[root@(none) /]# /mnt/onboard/.python/weather.sh
Kobo Wifi weather forecast started.
Getting weather information . . .
Creating image . . .
Traceback (most recent call last):
File "weather.py", line 363, in <module>
get_weather_data()
File "weather.py", line 108, in get_weather_data
display(days, highs, lows, conditions, img_links, unit)
File "weather.py", line 210, in display
image = pygame.image.load(img_links[1])
pygame.error: Couldn't open icons/clear_sky_night.png

I looked in the .apps/koboWeather/icons folder and there is no file clear_sky_night.png. Do you think I am missing icons or have the icon names changed?

Any ideas?

Thx

Update: I made a copy of the sunny icon and renamed the copy as 'clear_sky_night.png'. It's now working! Is there a way to generate a list of the possible pngs that I may need to avoid this happens again when the weather changes?

Thx

Last edited by ro-76; 01-14-2015 at 05:18 PM.
ro-76 is offline   Reply With Quote
Old 01-14-2015, 05:52 PM   #129
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
I'll see if I can figure that out. Give me an hour or so.
PeterT is offline   Reply With Quote
Old 01-14-2015, 07:29 PM   #130
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
AH... I think I made a mistake in one of the original changes.

We need
Code:
weather_link='http://api.worldweatheronline.com/free/v2/weather.ashx?q={0},{1}&format=xml&num_of_days=5&tp=24&key=95f758b5c88e1b323c12bd1017202'.format(lat, lon)
to get a daily weather stat, as opposed to every 3 hours by default. (Adding in an extraparamater &tp=24

See if that makes a difference (and if so, we don't need any additional graphics)

See http://www.worldweatheronline.com/ap...ather-api.aspx for the API
PeterT is offline   Reply With Quote
Old 01-16-2015, 02:29 AM   #131
ro-76
Junior Member
ro-76 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2003
Location: Ireland
Device: Pocket PC
Quote:
Originally Posted by PeterT View Post
AH... I think I made a mistake in one of the original changes.

We need
Code:
weather_link='http://api.worldweatheronline.com/free/v2/weather.ashx?q={0},{1}&format=xml&num_of_days=5&tp=24&key=95f758b5c88e1b323c12bd1017202'.format(lat, lon)
to get a daily weather stat, as opposed to every 3 hours by default. (Adding in an extraparamater &tp=24

See if that makes a difference (and if so, we don't need any additional graphics)

See http://www.worldweatheronline.com/ap...ather-api.aspx for the API
That did it! Thanks for your help.
ro-76 is offline   Reply With Quote
Old 01-16-2015, 12:18 PM   #132
Stremon
Member
Stremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a TexanStremon might easily be mistaken for a Texan
 
Posts: 24
Karma: 18454
Join Date: Dec 2014
Device: Kobo glo
Might be a stupid question, but is it possible to make this forecast working on Kobo glo?
Stremon is offline   Reply With Quote
Old 03-01-2015, 04:09 PM   #133
mokayak
Junior Member
mokayak began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2015
Device: Kobo mini
Can't import libraries

I'm both a Python noob and a Kobo noob (I just bought a mini mainly in the hope of running a version of this script).

Followed all instructions for backing up SD card, installing telnet, installing python and weather package OK. When I ran weather.sh for the first time it prompted for my location but then just stopped with no further output.

Using God's Own Debugging Technique (i.e. lots of print statements) I established that it dies somewhere in the first line of weather.py, i.e. "import urllib2". If I swap the first two lines around, it instead dies on "import pygame, os".

Some mucking about with test files established that a simple syntax error gave a nice Python error message, as I'd hope; and that attempting to import a made-up library also gave a proper error message, e.g. "ImportError: No module named horse", which suggested to me that this wasn't just a matter of paths (but what do I know?).

FWIW:

Code:
[root@(none) ~]# echo $PATH
/sbin:/usr/sbin:/bin:/usr/bin
I also read a bit of Python docs, went into the Python shell and did
Code:
>>> import sys
>>> sys.path
['', '/mnt/onboard/.python/lib/python27.zip', '/mnt/onboard/.python/lib/python2.7', '/mnt/onboard/.python/lib/python2.7/plat-linux2', '/mnt/onboard/.python/lib/python2.7/lib-tk', '/mnt/onboard/.python/lib/python2.7/lib-old', '/mnt/onboard/.python/lib/python2.7/lib-dynload', '/mnt/onboard/.python/lib/python2.7/site-packages']
At this point, now I knew about the Python shell, I thought I could try importing the relevant libraries in there to see what happened:

Code:
>>> import pygame,os
[root@(none) ~]# python
Python 2.7.2 (default, Feb  4 2012, 12:18:06) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame,os
[root@(none) ~]# python
Python 2.7.2 (default, Feb  4 2012, 12:18:06) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame, os
[root@(none) ~]#
In other words, attempting to import sys works; attempting to import either of the two libraries used by weather.py fails immediately stops python.

I'm hoping this is something obvious that I'm doing wrong.... what would it be?

many thanks in advance.
mokayak is offline   Reply With Quote
Old 03-10-2015, 01:14 PM   #134
barobach_so
Connoisseur
barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.
 
Posts: 76
Karma: 25460
Join Date: Feb 2015
Device: kobo h2o
hi
Does it work on Aura H2O ?
and another Question: does this weather app show instead of Nickel or we have both by changing key ?

Last edited by barobach_so; 03-10-2015 at 01:17 PM.
barobach_so is offline   Reply With Quote
Old 03-13-2015, 06:57 AM   #135
barobach_so
Connoisseur
barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.barobach_so knows what's going on.
 
Posts: 76
Karma: 25460
Join Date: Feb 2015
Device: kobo h2o
any news ?
barobach_so is offline   Reply With Quote
Reply

Tags
hacking, kobo wifi


Forum Jump

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 09:29 AM
Kobo Touch in cold weather Judsuw General Discussions 15 06-02-2012 06:23 PM
Sync epubs between Kobo app and Kobo wifi? emilikins Kobo Reader 1 11-17-2011 04:12 PM
Kobo Desktop App v1.7 onboard Kobo WiFi ZombWii Kobo Reader 6 10-20-2010 12:24 PM
Forrester upgrades sales forecast by 50% xoox News 0 10-10-2009 04:11 AM


All times are GMT -4. The time now is 06:25 PM.


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