Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098

    Jivelite geo/weather maps screensaver

    I had occasionally thought about trying to write a dedicated screensaver to show various real-time geo/weather maps, maybe a bit like a Geochron display. But then I saw how @sodface was using the built-in Image Viewer screensaver, and realised I didn't need to reinvent the wheel. So since this is now rather off-topic for @sodface's Alpine Linux thread, I thought I'd post an example here, just as a heads-up in case, like me, you hadn't realised that the image viewer can be used this way.

    In my case, I am using a script on a pCP setup to fetch a number of images from various internet sites and store them in a local folder called 'home/tc/ScreenSaverImages'. I then call this script every 15 minutes using a cron job. I have configured the Image Viewer screensaver to use local storage, and to look in that folder. Fortunately, which is key to this, the Image Viewer screensaver seems to re-read the directory and re-load each image file whenever it updates, so I can add images to that folder, or update existing images, and the screensaver always cycles through the current images. My script also pushes this folder to a couple of Jogglers which are set up to use the Image Viewer screensaver.

    I started off trying to use some of the nice images provided by Fourmilab, but the server eventually locks me out even if I only fetch one image every 15 minutes, and only during the hours when I'm likely to want to see the images - it seems very determined to stop the server being overwhelmed - so I've stopped using that source.

    I now collect a variety of images from other sources, and am on the lookout for other sources, so please go ahead and post anything you think might be interesting. My current 'GetScreenSaverImages.sh' script is as follows:

    Code:
    #UK Rain
    wget "https://api.sat24.com/mostrecent/GB/rain" -O /home/tc/ScreenSaverImages/UKRain.bmp
    
    #UK Snow
    wget "https://api.sat24.com/mostrecent/GB/snow" -O /home/tc/ScreenSaverImages/UKSnow.bmp
    
    # UK Sun & Clouds
    wget "https://api.sat24.com/mostrecent/GB/visual5hdcomplete" -O /home/tc/ScreenSaverImages/UKSunClouds.bmp
    
    # UK Infrared
    wget "https://api.sat24.com/mostrecent/GB/infrapolair" -O /home/tc/ScreenSaverImages/UKInfraRed.bmp
    
    #https://api.sat24.com/crop?type=visual5hdcomplete&lat=55.9533&lon=-3.1883&width=800&height=800&zoom=0.30&continent=eu
    
    #Moon visibility
    wget "https://www.timeanddate.com/scripts/sunmap.php?obj=moon" -O /home/tc/ScreenSaverImages/moonlight.bmp
    
    #Day and Night
    wget "https://www.timeanddate.com/scripts/sunmap.php?earth=1" -O /home/tc/ScreenSaverImages/DayNight.bmp
    
    #Images available from Fourmilab.  Server locks you out if you take images regularly, so no longer used
    #wget "https://www.fourmilab.ch/cgi-bin/Earth?img=cloudy.bmp&dynimg=y&opt=-p&date=0" -O /home/tc/ScreenSaverImages/CloudyEarth.bmp
    #wget "https://www.fourmilab.ch/cgi-bin/Earth?img=NASAmMM-l.evif&dynimg=y&opt=-p&date=0" -O /home/tc/ScreenSaverImages/NASADayNight.bmp
    
    # Push images to Jogglers
    rsync -avhiO --delete /home/tc/ScreenSaverImages/ root@192.168.1.21:/root/ScreenSaverImages/
    rsync -avhiO --delete /home/tc/ScreenSaverImages/ root@192.168.1.22:/root/ScreenSaverImages/
    With a bit of luck, the images below should be the current versions of the above images. If you're not from the UK, the images from sat24 can be configured to show other regions (Europe only I think).

    UK Rain


    UK Snow


    UK Sun & Clouds (visible, i.e. doesn't show anything after dark)


    UK Infrared


    Moon visibility


    Day and Night

  2. #2
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098
    Quote Originally Posted by chill View Post
    Fortunately, which is key to this, the Image Viewer screensaver seems to re-read the directory and re-load each image file whenever it updates, so I can add images to that folder, or update existing images, and the screensaver always cycles through the current images.
    Correction: The directory is only re-read whenever the screensaver kicks in. So completely new images don't show up until that happens. But an updated image, i.e. a new image with the same name as an existing image, will be re-loaded as the screensaver cycles through it's directory list.
    Last edited by chill; 2021-01-22 at 04:59.

  3. #3
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,290
    Quote Originally Posted by chill View Post
    I now collect a variety of images from other sources, and am on the lookout for other sources, so please go ahead and post anything you think might be interesting.
    In the Daylight Clock applet I used images from die.net: https://www.die.net/earth/
    There is a number off different projections available and also one for moon phase: https://www.die.net/moon/

    Daylight Clock applet no longer works since die.net switched to use https.
    Erland Isaksson (My homepage)
    Developer of many plugins/applets
    Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )

  4. #4
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098
    Quote Originally Posted by erland View Post
    In the Daylight Clock applet I used images from die.net: https://www.die.net/earth/
    There is a number off different projections available and also one for moon phase: https://www.die.net/moon/

    Daylight Clock applet no longer works since die.net switched to use https.
    Perfect, thank you. https isn't a problem for pCP, so fetching the images via a script outside of Jivelite seems to work ok.

  5. #5
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,174
    Looks useful - so tagging for pretend #wiki
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  6. #6
    Senior Member
    Join Date
    Dec 2013
    Posts
    109
    Quick question (I like that approach!) - in which folder do you put the script so that it survives reboots?

    Thanks

    Rainer

  7. #7
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098
    Quote Originally Posted by rkrug View Post
    in which folder do you put the script so that it survives reboots?
    Anything in /home/tc (and below) will survive a reboot, provided you do a backup first (pcp bu).

  8. #8
    Senior Member
    Join Date
    Dec 2013
    Posts
    109

    Jivelite geo/weather maps screensaver

    > On 22 Jan 2021, at 14:15, chill <chill.9vvpwn (AT) no-mx (DOT) forums.slimdevices.com> wrote:
    >
    >
    > rkrug wrote:
    >> in which folder do you put the script so that it survives reboots?
    >>

    >
    > Anything in /home/tc (and below) will survive a reboot, provided you do
    > a backup first (pcp bu).


    Thanks a lot.

    >
    >
    > ------------------------------------------------------------------------
    > chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
    > View this thread: http://forums.slimdevices.com/showthread.php?t=113732
    >
    >

  9. #9
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098
    Quote Originally Posted by erland View Post
    In the Daylight Clock applet I used images from die.net: https://www.die.net/earth/
    There is a number off different projections available and also one for moon phase: https://www.die.net/moon/
    Hi Erland - do you have any tips for fetching a plain image from die.net?

    If I paste, for instance, 'https://static.die.net/earth/rectangular/1280.jpg' into a browser search bar I get a plain image displayed (1280 pixels across).

    But if I try to fetch it with wget then it fails:
    Code:
    tc@pCPTV:~/ScreenSaverImages$ wget "https://static.die.net/earth/rectangular/1280.jpg" -O /home/tc/ScreenSaverImages/WorldSunlight.jpg
    Connecting to static.die.net (104.26.1.94:443)
    wget: server returned error: HTTP/1.1 503 Service Temporarily Unavailable
    I'm guessing that's because the service that renders the image is intended to respond only to browsers. I tried adding a user agent to the command - same result. I tried curl, and received a file of html that looks like the code that renders the image.

  10. #10
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,290
    Quote Originally Posted by chill View Post
    Hi Erland - do you have any tips for fetching a plain image from die.net?
    It worked previously without having to do anything specific but I guess they might have added something to stop people from downloading the images when they switched to https. My guess is that you might need to set some http header to make wget/curl look like a browser. You should be able to use the debug/developer view of a working browser to see which headers it uses.

    The Daylight Clock applet fetch the images via the mysqueezebox.com image proxy, you will find the code here if it helps:
    https://github.com/erland/squeezebox...pplet.lua#L895

    Not sure if mysqueezebox.com adds some headers but I think I didnĺt use that in the beginning, if I remember correctly it was added to cache the images so many users using Daylight Clock applet simultaneously wouldnĺt overload die.net
    Erland Isaksson (My homepage)
    Developer of many plugins/applets
    Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •