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 01-18-2014, 02:56 PM   #31
Rufuss
Junior Member
Rufuss began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2014
Device: Kindle 4
Hello

may I add a question concerning Wifi disconncts to this thread?

I'm aso running a weather display. Sometimes the Kindle 4 loses the connection, probably because the signal is a bit weak. In this case I have to reboot, chose in the Kindle the Wifi search and connect again to my network by entering the password each time again.

Is there the possibility to extend the code

Code:
if [ `lipc-get-prop com.lab126.wifid cmState` != "CONNECTED" ]; then
	exit 0
fi
by a command to re-connect to a Wifi network again in case Wifi was disconnected?

This would also allow to switch off the access point over night.

Regards
R.
Rufuss is offline   Reply With Quote
Old 01-19-2014, 01:34 PM   #32
groesser3
Junior Member
groesser3 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2014
Device: K4NT
rsvg-convert on kindle

hi, I would like to convert a svg-file to a png on the kindle. Unforunatly there are some missing libs. One is libcroco, but I suppose, that other libs are missing (http://wiki.dreamhost.com/Installing_librsvg).

[root@kindle bin]# export LD_LIBRARY_PATH=/mnt/us/rsvg-convert/lib:/mnt/us/rsvg-convert/kindle-lib::/mnt/us/lib${LD_LIBRARY_PATH}
[root@kindle bin]# ./rsvg-convert
./rsvg-convert: error while loading shared libraries: libcroco-0.6.so.3: cannot open shared object file: No such file or directory

Has someone a working rsvg-convert installation on the kindle (Kindle 4NT - black)? Cairosvg (cairosvg.org) looks like a promising alternative, but still requires compiling some c-modules (minimum seams "cffi" for "cairocffi").



ps. I googled a lot, but could not found any solution. I also tried to cross-compile rsvg, tried to compile cffi on the kindle using tcc but wasn't successfull either.

groesser3 is offline   Reply With Quote
Advert
Old 01-19-2014, 11:02 PM   #33
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
heres the lib.

I have a partition on my laptop that I used debootstrap to add the base arm install to. Then I added qemu static to it so i can chroot into it. Then I can easily apt-get anything I want, even compile lots of stuff there. Works well for me!
Attached Files
File Type: zip libcroco-0.6.so.zip (77.8 KB, 263 views)
brianinmaine is offline   Reply With Quote
Old 01-19-2014, 11:23 PM   #34
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
Running my version of twobobs 'filechecker' script leaves this package. The kindle-lib directory has libs that are more current than the ones on the device and can usually be deleted.
Attached Files
File Type: zip rsvg-convert.zip (4.41 MB, 358 views)
brianinmaine is offline   Reply With Quote
Old 01-20-2014, 02:13 PM   #35
groesser3
Junior Member
groesser3 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2014
Device: K4NT
rsvg-convert on kindle

@brianinmaine: thanks for the really quick reply!

Now at least I can start the app:

[root@kindle bin]# ./rsvg-convert --version
rsvg-convert version 2.36.1

Unfortunatly, when I try to convert a file I get the following error (different glibc?):

[root@kindle bin]# export LD_LIBRARY_PATH=../lib:../kindle-lib
[root@kindle bin]# ./rsvg-convert --background-color=white -o /tmp/weather-script-output.png /tmp/weather-script-output.svg
./rsvg-convert: error while loading shared libraries: invalid mode for dlopen(): Invalid argument
[root@kindle bin]#

Any advice how to resolve this issue is appreciated!



Loaded objects are as follows:

LD_TRACE_LOADED_OBJECTS=1 ./rsvg-convert --background-color=white -o /tmp/weather-script-output.png /tmp/weather-script-output.svg
librsvg-2.so.2 => ../lib/librsvg-2.so.2 (0x40021000)
libgobject-2.0.so.0 => ../kindle-lib/libgobject-2.0.so.0 (0x4005b000)
libcairo.so.2 => ../kindle-lib/libcairo.so.2 (0x400ac000)
libglib-2.0.so.0 => ../kindle-lib/libglib-2.0.so.0 (0x4018f000)
libm.so.6 => ../kindle-lib/libm.so.6 (0x40277000)
libpthread.so.0 => ../kindle-lib/libpthread.so.0 (0x40320000)
libc.so.6 => /lib/libc.so.6 (0x40340000)
/lib/ld-linux.so.3 (0x40000000)
libgdk_pixbuf-2.0.so.0 => ../kindle-lib/libgdk_pixbuf-2.0.so.0 (0x4043b000)
libgio-2.0.so.0 => ../kindle-lib/libgio-2.0.so.0 (0x40461000)
libpangocairo-1.0.so.0 => ../kindle-lib/libpangocairo-1.0.so.0 (0x40587000)
libpango-1.0.so.0 => ../kindle-lib/libpango-1.0.so.0 (0x4059b000)
libcroco-0.6.so.3 => ../lib/libcroco-0.6.so.3 (0x405e6000)
libxml2.so.2 => ../kindle-lib/libxml2.so.2 (0x40620000)
libgthread-2.0.so.0 => ../kindle-lib/libgthread-2.0.so.0 (0x40752000)
libffi.so.5 => ../kindle-lib/libffi.so.5 (0x4075c000)
libpixman-1.so.0 => ../kindle-lib/libpixman-1.so.0 (0x40770000)
libfontconfig.so.1 => ../kindle-lib/libfontconfig.so.1 (0x40805000)
libfreetype.so.6 => ../kindle-lib/libfreetype.so.6 (0x4083b000)
libpng12.so.0 => ../kindle-lib/libpng12.so.0 (0x408b7000)
libxcb-shm.so.0 => ../kindle-lib/libxcb-shm.so.0 (0x408e0000)
libxcb-render.so.0 => ../kindle-lib/libxcb-render.so.0 (0x408eb000)
libxcb.so.1 => ../kindle-lib/libxcb.so.1 (0x408fa000)
libXrender.so.1 => ../kindle-lib/libXrender.so.1 (0x4091a000)
libX11.so.6 => ../kindle-lib/libX11.so.6 (0x4092a000)
libz.so.1 => ../kindle-lib/libz.so.1 (0x40a45000)
librt.so.1 => ../kindle-lib/librt.so.1 (0x40a63000)
libgcc_s.so.1 => ../kindle-lib/libgcc_s.so.1 (0x40a72000)
libpcre.so.3 => ../lib/libpcre.so.3 (0x40a9c000)
libgmodule-2.0.so.0 => ../kindle-lib/libgmodule-2.0.so.0 (0x40add000)
libselinux.so.1 => ../lib/libselinux.so.1 (0x40ae9000)
libresolv.so.2 => ../kindle-lib/libresolv.so.2 (0x40b0e000)
libpangoft2-1.0.so.0 => ../kindle-lib/libpangoft2-1.0.so.0 (0x40b22000)
libdl.so.2 => ../kindle-lib/libdl.so.2 (0x40b4f000)
liblzma.so.5 => ../lib/liblzma.so.5 (0x40b5a000)
libexpat.so.1 => ../kindle-lib/libexpat.so.1 (0x40b82000)
libXau.so.6 => ../kindle-lib/libXau.so.6 (0x40ba6000)
libXdmcp.so.6 => ../kindle-lib/libXdmcp.so.6 (0x40bb0000)

Last edited by groesser3; 01-20-2014 at 02:43 PM.
groesser3 is offline   Reply With Quote
Advert
Old 01-20-2014, 03:14 PM   #36
groesser3
Junior Member
groesser3 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2014
Device: K4NT
Talking rsvg-convert on kindle [SOLVED]

eventually I found a solution for the dlopen()-issue: I simply removed (renamend) the libdl.so.2 in the kindle-lib folder and voila it worked!!

PS:this thread was really helpful to find the cause:

@brianinmaine: again, without your help I would still try to compile
groesser3 is offline   Reply With Quote
Old 01-20-2014, 04:39 PM   #37
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
I don't use the kindle-lib directory in my path, I just keep it for "symbol? errors? sometimes?" I just have the lib in the path and then if it still won't load I copy the kindle lib into the lib dir. when it runs, I delete the kindle-lib dir to keep my setup tidy.

I couldn't do any of this without the wonderful instructors on here - twobob, knc1, MANY more! Pure awesomeness!

also I think your path should have been: LD_LIBRARY_PATH=../lib:/lib:/usr/lib to include the system files? That messed me up for a long time!

Last edited by brianinmaine; 01-20-2014 at 04:43 PM.
brianinmaine is offline   Reply With Quote
Old 04-17-2014, 11:37 AM   #38
Hellmann
Junior Member
Hellmann began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2014
Device: Kindle
Hey,

im using this code from you and changed it to my location and language.

Code:
# coding: utf-8
#!/usr/bin/python2

# Kindle Weather Display
# Matthew Petroff (http://www.mpetroff.net/)
# September 2012
# Reventlov Giskard (http://volcanis.me/)

import datetime
import codecs
import urllib2
import json

#######################
#unit = "fahrenheit"
unit = "celsius"
#unit_ = u'°F'
unit_ = u'°C'
# Api key from wunderground, get one here: http://www.wunderground.com/weather/api/
api_key = "68486b5679b7b81d"
# Search for the abbreviation here: http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=
#city="CA/San_Francisco/"
city = "Hamburg"
# LOCALISATION
#days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
days_of_week = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']
#tomorrow = 'Tomorrow'
tomorrow = 'Morgen'
#today = 'Today'
today = "Heute"
#hhigh = "High"
hhigh = "Maximum"
#llow = "Low"
llow = "Minimum"
#######################

highs = [None]*4
lows = [None]*4
icons = [None]*4

weather_json = urllib2.urlopen('http://api.wunderground.com/api/'+api_key+'/forecast/lang:DL/q/'+city+'.json')
json_string = weather_json.read()
parsed_json = json.loads(json_string)

highs[0] = parsed_json['forecast']['simpleforecast']['forecastday'][0]['high'][unit]
lows[0] = parsed_json['forecast']['simpleforecast']['forecastday'][0]['low'][unit]
icons[0] = parsed_json['forecast']['simpleforecast']['forecastday'][0]['icon']

highs[1] = parsed_json['forecast']['simpleforecast']['forecastday'][1]['high'][unit]
lows[1] = parsed_json['forecast']['simpleforecast']['forecastday'][1]['low'][unit]
icons[1] = parsed_json['forecast']['simpleforecast']['forecastday'][1]['icon']

highs[2] = parsed_json['forecast']['simpleforecast']['forecastday'][2]['high'][unit]
lows[2] = parsed_json['forecast']['simpleforecast']['forecastday'][2]['low'][unit]
icons[2] = parsed_json['forecast']['simpleforecast']['forecastday'][2]['icon']

highs[3] = parsed_json['forecast']['simpleforecast']['forecastday'][3]['high'][unit]
lows[3] = parsed_json['forecast']['simpleforecast']['forecastday'][3]['low'][unit]
icons[3] = parsed_json['forecast']['simpleforecast']['forecastday'][3]['icon']

weather_json.close()

# Parse dates
day_one = datetime.datetime.today()

#
# Preprocess SVG
#

# Open SVG to process
output = codecs.open('weather-script-preprocess.svg', 'r', encoding='utf-8').read()

# Insert icons and temperatures
output = output.replace('ICON_ONE',icons[0]).replace('ICON_TWO',icons[1]).replace('ICON_THREE',icons[2]).replace('ICON_FOUR',icons[3])
output = output.replace('HIGH_ONE',str(highs[0])).replace('HIGH_TWO',str(highs[1])).replace('HIGH_THREE',str(highs[2])).replace('HIGH_FOUR',str(highs[3]))
output = output.replace('LOW_ONE',str(lows[0])).replace('LOW_TWO',str(lows[1])).replace('LOW_THREE',str(lows[2])).replace('LOW_FOUR',str(lows[3]))

# Localisation/Insert days of week
one_day = datetime.timedelta(days=1)
output = output.replace('DAY_THREE',days_of_week[(day_one + 2*one_day).weekday()]).replace('DAY_FOUR',days_of_week[(day_one + 3*one_day).weekday()])

# Insert the temperatures unit
output = output.replace('UNIT',unit_)

# Localisation
output = output.replace('TOMORROW',tomorrow)
output = output.replace('TODAY',today)
output = output.replace('HIGH',hhigh)
output = output.replace('LOW',llow)

output = output.replace('DATE',day_one.strftime("%H:%M"))

# Write output
codecs.open('weather-script-output.svg', 'w', encoding='utf-8').write(output)
but im getting an error in line 45

Code:
Traceback (most recent call last):
  File "weather-script.py", line 45, in <module>
    highs[0] = parsed_json['forecast']['simpleforecast']['forecastday'][0]['high'][unit]
KeyError: 'forecast'
i cant figure out whats going wrong. the request seems to work normal, because in my wunderground analytics tool i can see a request.

thanks a lot and greetings

hellmann
Hellmann is offline   Reply With Quote
Old 04-18-2014, 01:16 PM   #39
Reventlov
Member
Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.Reventlov is no e-book dilettante.
 
Posts: 22
Karma: 53884
Join Date: Dec 2012
Location: Lyon
Device: Kobo H2O
I'd remove this api key from this public page. Looking at the answer of wunderground, it appears that there are many towns named hamburg:
Code:
     "results": [
            {
                "city": "Hamburg", 
                "country": "CA", 
                "country_iso3166": "CA", 
                "country_name": "", 
                "l": "/q/zmw:00000.3.71221", 
                "name": "Hamburg", 
                "state": "AB", 
                "zmw": "00000.3.71221"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:71646.1.99999", 
                "name": "Hamburg", 
                "state": "AR", 
                "zmw": "71646.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:06371.2.99999", 
                "name": "Hamburg", 
                "state": "CT", 
                "zmw": "06371.2.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "DL", 
                "country_iso3166": "DE", 
                "country_name": "Deutschland", 
                "l": "/q/zmw:00000.3.10147", 
                "name": "Hamburg", 
                "state": "", 
                "zmw": "00000.3.10147"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:62045.1.99999", 
                "name": "Hamburg", 
                "state": "IL", 
                "zmw": "62045.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:51640.1.99999", 
                "name": "Hamburg", 
                "state": "IA", 
                "zmw": "51640.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:71339.1.99999", 
                "name": "Hamburg", 
                "state": "LA", 
                "zmw": "71339.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:48139.1.99999", 
                "name": "Hamburg", 
                "state": "MI", 
                "zmw": "48139.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:55339.1.99999", 
                "name": "Hamburg", 
                "state": "MN", 
                "zmw": "55339.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:07419.1.99999", 
                "name": "Hamburg", 
                "state": "NJ", 
                "zmw": "07419.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:14075.1.99999", 
                "name": "Hamburg", 
                "state": "NY", 
                "zmw": "14075.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:19526.1.99999", 
                "name": "Hamburg", 
                "state": "PA", 
                "zmw": "19526.1.99999"
            }, 
            {
                "city": "Hamburg", 
                "country": "US", 
                "country_iso3166": "US", 
                "country_name": "Vereinigte Staaten", 
                "l": "/q/zmw:54411.2.99999", 
                "name": "Hamburg", 
                "state": "WI", 
                "zmw": "54411.2.99999"
            }
Pick one by changing the query "Hamburg" to something else, as described here: http://www.wunderground.com/weather/...s?d=data/index

For information, it can be anything listed here:
Code:
Example                               Description                                                                                                                     
-----------------------------------------------------------------
CA/San_Francisco                      US state/city
60290                                 US zipcode
Australia/Sydney                      country/city
37.8,-122.4                           latitude,longitude
KJFK                                  airport code
pws:KCASANFR70                        PWS id
autoip                                AutoIP address location
autoip.json?geo_ip=38.102.136.138     specific IP address location

Last edited by Reventlov; 04-18-2014 at 01:40 PM.
Reventlov is offline   Reply With Quote
Old 04-21-2014, 08:17 AM   #40
axelPW2
Member
axelPW2 began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Apr 2014
Device: KPW2
Hi folks, I am new here and new to the Kindle PaperWhite2 that I would like to make it show the weather forecast as screensaver or not. My PW2 is jailbroken and is running Kual. Is this possible right now, does a program already exist for such a thing?
If positive, giving us a link for download would be absolutely awesome!!! Thank you!

Last edited by axelPW2; 04-22-2014 at 04:15 PM.
axelPW2 is offline   Reply With Quote
Old 07-20-2014, 05:01 PM   #41
mattsches
Junior Member
mattsches began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2014
Location: Germany
Device: Kindle 4 NoTouch Black (2012)
Quote:
Originally Posted by brianinmaine View Post
Running my version of twobobs 'filechecker' script leaves this package. The kindle-lib directory has libs that are more current than the ones on the device and can usually be deleted.
Hello Brian,

I try to do the same thing as scolby33 described in his initial post (i. e. make the weather display run on my K4 black without additional server). The rsvg-convert you provided to groesser3 already helped me handle the svg-png conversion (thanks for that!). The only thing I seem to be missing is pngcrush for reducing the color depth (otherwise the picture appears distorted on the device).

Do you possibly see a chance to find a kindle compliant pngcrush compilation, like you did with rsvg-convert? That'd be highly appreciated!

Best regards,
mattsches
mattsches is offline   Reply With Quote
Old 07-21-2014, 08:30 AM   #42
mattsches
Junior Member
mattsches began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2014
Location: Germany
Device: Kindle 4 NoTouch Black (2012)
Found a working binary for pngcrush on kindle on the web. Just in case some else needs it, there you go:

http://arm.koji.fedoraproject.org/ko...?buildID=11465

I downloaded the armv5tel binary rpm, opened it in 7-Zip (on W7), extracted the pngcrush executable and copied it to the K4 - working fine. Caution, newer versions didn't work for me, required a newer libpng than I had on my device. Going back to 1.6.10 seemed to be the easiest option.
So, thanks again to you guys for your valuable work and ideas!
mattsches is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Kindle Weather Station kindlews Amazon Kindle 38 02-15-2012 09:25 AM
Daily Weather Forecasts on Your Kindle? Lulu Amazon Kindle 5 11-09-2011 04:56 AM
Free (Kindle app) AccuWeather (Weather Forecasts on Kindle) arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 6 11-06-2011 02:39 PM
Palmary Weather Server Down cheyennedonna enTourage Archive 6 06-17-2010 09:09 PM
Mobile Content Server - search for or display series_index data? Starson17 Calibre 5 01-08-2010 04:12 PM


All times are GMT -4. The time now is 10:33 AM.


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