Skip to main content

frankAllSkyCam

Open-source AllSky camera software for a Raspberry Pi + Pi HQ Camera (or compatible libcamera sensor) with a fisheye lens. Point it at the sky, run it on a cron schedule, and it takes care of the rest:

  • Captures a full-sky JPEG every minute or so, with exposure automatically driven by measured or estimated sky brightness (SQM), day or night.
  • Watermarks each image with date/time, sun and moon rise/set times, moon phase, visible-planet icons, your own logo/compass, and any extra sensor data you want to show (weather station, temperature, humidity, ...).
  • Estimates cloud cover and star count directly from the image, using different, purpose-built detection for daytime (blue-sky-vs-cloud color analysis) and nighttime (adaptive point-source detection that accounts for the Moon, trees/obstructions, and partial cloud).
  • Builds nightly timelapses (night-only and/or full 24h) and a startrail image, and can upload everything to your own website via FTP.
  • Optionally drives a dew heater (via a network relay or a GPIO-controlled one) based on the gap between internal temperature and dew point, to keep the lens clear.
  • A watchdog reboots the Pi automatically if captures ever stall.

Everything runs unattended via cron, installed with a single command.

Quick install

pip3 install frankAllSkyCam

On newer Raspberry Pi OS (Bookworm and later), pip may refuse a system-wide install; if so, use:

pip3 install frankAllSkyCam --break-system-packages

Then run it once to generate your config:

python3 -m frankAllSkyCam

This creates ~/frankAllSkyCam/ with a config.txt you'll want to edit before going further - see the full walkthrough below.


1. Prerequisites

Start from a clean, up-to-date Raspberry Pi OS (Lite is fine, no desktop needed):

sudo apt update
sudo apt upgrade

Make sure pip is available:

sudo apt install python3-pip

Install ImageMagick's development headers (needed to render the moon-phase image):

sudo apt install libmagickwand-dev

frankAllSkyCam uses libcamera (bundled with current Raspberry Pi OS). The older raspistill is not supported. Check libcamera works before going further:

libcamera-jpeg -o test.jpg --immediate -n

You should see it capture and leave a test.jpg in the current folder.

2. Install frankAllSkyCam

pip3 install frankAllSkyCam

Then launch it once, so it can bootstrap your configuration:

python3 -m frankAllSkyCam

The first run creates:

~/frankAllSkyCam/
~/frankAllSkyCam/img/       (captured images, organized by day)
~/frankAllSkyCam/log/       (logs from every scheduled job)
~/frankAllSkyCam/sqm/       (SQM readings, if enabled)
~/frankAllSkyCam/png/       (logo, compass, moon/planet icons - customize freely)
~/frankAllSkyCam/tools/     (optional extras - see "Extra sensors" below)
~/frankAllSkyCam/config.txt
~/frankAllSkyCam/index.html

Any of these files can be freely edited - they live outside the installed package, so a future pip install --upgrade frankAllSkyCam will never overwrite your customizations. png/ in particular is where you'd drop your own logo or compass image, matching the filenames already configured in config.txt.

3. Configure your system

Edit ~/frankAllSkyCam/config.txt (e.g. nano ~/frankAllSkyCam/config.txt). At minimum, set:

[site]
inte = <name printed on top-center of the image>
latitude = 44.75
longitude = 9.29
elevation = 1150
time_zone = Europe/Rome

If you own a SQM-LE sky-quality meter, point to it under [sqm] (otherwise leave use_sqm_le = n and the software estimates SQM from the image itself):

[sqm]
use_sqm_le = n
ip_address = <ip_address_of_the_SQM_LE>
port = 10001
sqmLog = n

Hosting the image

Option A - the Pi serves it locally, via Apache:

sudo apt install apache2 -y
sudo mkdir -p /var/www/html/img
sudo mv ~/frankAllSkyCam/index.html /var/www/html/

For a full gallery-style site (timelapses, startrails, sky map) rather than just the bare image, grab the website/ folder from this repository - plain HTML + JS, no PHP required.

Option B - upload to an external website via FTP. Configure [ftp] in config.txt:

[ftp]
isFTP = True
FTP_server = your_ftpserver.com
FTP_login = your_username
FTP_pass = your_password
FTP_uploadFolder = /your_folder/
FTP_filenameAllSkyImgJPG = /img/allskycam
FTP_fileNameTimelapseMP4 = /video/frankAllSkycam
FTP_fileNameStarTrailJPG = /startrail/startrail.jpg

Leave isFTP = False if you don't want any remote upload.

Timelapses

[timelapse]
nightTL = True   # allskycam_night.mp4, sunset to sunrise
fullTL = True    # allskycam_24h.mp4, full day

config.txt is fully commented - text position, font/color, logo/compass/planet icon placement, and max night exposure (esp_secs) are all in there and safe to tweak.

4. Test it

python3 -m frankAllSkyCam

If it worked, you'll find the generated JPEG:

  1. In a browser, at http://<your_raspberry_IP> (if you set up Apache)
  2. At ~/frankAllSkyCam/img/<YYYYMMDD>/<file>.jpg
  3. On your remote FTP host, if configured

5. Automate it

python3 -m frankAllSkyCam.crontab

This installs every scheduled job for you: captures (every 1-2 min, day/night-aware interval), a watchdog every 15 minutes, nightly startrail and timelapse generation, daily old-image cleanup, and a periodic ephemeris refresh. Re-run it any time (e.g. once a year) to refresh the sunrise/sunset-based capture windows.

Every job's output now goes to its own log file under ~/frankAllSkyCam/log/, so if anything misbehaves, that's the first place to check.

Enjoy it!


Extra sensors, weather stations, and the dew heater

~/frankAllSkyCam/tools/ holds small, independent scripts meant for you to edit - they live outside the installed package specifically so a pip install --upgrade never touches your customizations.

  • generateExtraData.py collects data from your own devices (a weather station, a Shelly smart plug, an I2C temperature/humidity sensor, ...) and writes a single text string that gets watermarked onto the image (enable it via et_use = y under [extra_text] in config.txt). Several ready-made helper functions are included (Ecowitt/WS90-style JSON stations, a Davis Vantage Pro2 plaintext feed, Shelly devices) - uncomment and configure the ones you have in getData().
  • generateExtraData.conf, sitting next to it, holds your device URLs/IPs and credentials - kept separate from the main config.txt on purpose, so this file can be handed to (or edited by) someone who only needs to touch sensor settings.
  • The same file can also switch a dew heater on/off, based on (internal temperature - dew point), reusing whatever sensor readings you already fetch for the watermark text (no extra network calls). It supports either a network relay (e.g. a Shelly) or a relay wired directly to a Raspberry Pi GPIO pin - see the [dew_heater] section in generateExtraData.conf.

Both are wired into the crontab automatically by python3 -m frankAllSkyCam.crontab.

For expert users

Exposure duration is predicted from SQM via a small polynomial model, trained from real-world (SQM, exposure seconds) pairs stored in:

~/frankAllSkyCam/sqmexp.csv

Add or adjust pairs to retune the curve for your own site/camera/gain settings - the software interpolates (degree-3 polynomial regression) between the values you provide. The esp_secs parameter in config.txt always caps the maximum exposure regardless of what the model predicts.

You can also fully customize the libcamera-still invocation via additional_night_params / additional_day_params in config.txt - gain, white balance, contrast, anything libcamera-still accepts (just don't set --shutter or --immediate there, those are managed for you).

Requirements

Installed automatically via pip: pytz, numpy, ephem, Wand, opencv-python-headless, Pillow, requests. Python 3.9+.

If you use the optional sensor examples in tools/generateExtraData.py that read Raspberry Pi hardware directly (CPU temperature, an I2C sensor, GPIO-driven relays), they rely on gpiozero, smbus/smbus2, and RPi.GPIO - all pre-installed on Raspberry Pi OS, no extra steps needed.

License

GPLv3 - see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frankallskycam-12.tar.gz (131.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

frankallskycam-12-py3-none-any.whl (135.9 kB view details)

Uploaded Python 3

File details

Details for the file frankallskycam-12.tar.gz.

File metadata

  • Download URL: frankallskycam-12.tar.gz
  • Upload date:
  • Size: 131.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for frankallskycam-12.tar.gz
Algorithm Hash digest
SHA256 3096dca132817166456c0656a0435ece9de00a7355bb10390352ed72b525bd99
MD5 b98c1ed03383fd7315c5c1c2f9a1071e
BLAKE2b-256 fa2c3503f5e6024d2845aa7acd1cac1a1dd4ebf6f6b1723ee671df96f049175a

See more details on using hashes here.

File details

Details for the file frankallskycam-12-py3-none-any.whl.

File metadata

  • Download URL: frankallskycam-12-py3-none-any.whl
  • Upload date:
  • Size: 135.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for frankallskycam-12-py3-none-any.whl
Algorithm Hash digest
SHA256 7f8285fac477a3f9280ba1351913ef825b1d531d930161619d2ad1eaf04e0616
MD5 1c13b7e6c235b6b1da44b0912ff13e00
BLAKE2b-256 880639600c4999bf9df6c16b18935e14c23e3947cc35c804afc887c1251af760

See more details on using hashes here.

Release history Release notifications | RSS feed

47

2 files

46

2 files

45

2 files

44

2 files

43

2 files

42

2 files

41

2 files

40

2 files

39

2 files

38

2 files

37

2 files

36

2 files

34

2 files

33

2 files

32

2 files

31

2 files

30

2 files

29

2 files

28

2 files

27

2 files

26

2 files

25

2 files

24

2 files

23

2 files

22

2 files

21

2 files

20

2 files

19

2 files

18

2 files

17

2 files

16

2 files

15

2 files

14

2 files

13

2 files

This release

12 This release

2 files

10.3

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page