A Raspberry Pi operated Wireless Allsky Camera
This is the source code for the Allsky Camera project described on Instructables.
In order to get the camera working properly you will need the following hardware:
NOTE: Owners of USB2.0 cameras such as ASI120MC and ASI120MM may need to do a firmware upgrade. This changes the camera to use 512 byte packets instead of 1024 which makes it more compatible with most hardware.
NOTE: The T7 / T7C cameras, e.g., from Datyson or other sellers, are not officially supported but persistent users may get them to work by following these instructions.
You will need to install the Raspbian Operating System on your Raspberry Pi. Follow this link for information on how to do it.
Make sure you have a working internet connection by setting it through the terminal.
Start by installing git if not already there. Open the terminal and type the following:
shell sudo apt-get install git
Now fetch the code from this GitHub page:
shell git clone --recursive https://github.com/thomasjacquin/allsky.git
Then navigate to the allsky directory:
shell cd allsky
Now, run the install script:
shell ./install.sh # PatriotAstro's video shows using "sudo"; that is no longer needed
NOTE: Version 0.8 added many new settings and changed the name of several existing settings. For example, there are now separate brightness levels for daytime and nighttime, called "daybrightness" and "nightbrightness". Version 0.7 only had "brightness" that applied to both day and nighttime. It's very important that you save a copy of your current settings prior to upgrading to version 0.8 so you can restore them properly. The WebUI from the
allsky-portalpackage uses these new settings so it's also important to update AllSky prior to updating the WebUI.
Also note that in version 0.8, the default image file created and uploaded is called either "image.jpg" or "liveview-image.jpg", depending on how you set things up. The prior "image-resize.jpg" is no longer created. Keep that in mind if you copy the image to a remote web server - it will need to know about the new name.
Some users have reported ASIERRORTIMEOUT errors with their ZWO cameras in verion 0.8. Click here to troubleshoot.
There are many configuration variables that need to be set as well as many optional ones. Please see the allsky Settings page for a list of them.
The AllSky software should start automatically when the Raspberry Pi boots up. To enable or disable this behavior, use these commands:
sudo systemctl enable allsky.service # starts the software when the Pi boots up sudo systemctl disable allsky.service # does NOT automatically start the software
When you want to start, stop, or restart the software, or obtain status, use one of the following commands:
shell sudo systemctl start allsky sudo systemctl stop allsky sudo systemctl restart allsky sudo systemctl status allsky
Starting the program from the terminal can be a great way to track down issues as it provides debug information. To start the program manually, make sure the service is stopped (see above), then run:
cd allsky ./allsky.sh
If you are using a desktop environment (Pixel, Mate, LXDE, etc) or using remote desktop or VNC, you can add the
previewargument in order to show the images the program is currently saving.
See this Wiki page for instructions on how to update the AllSky software.
If you don't want to configure the camera using the terminal, you can install the WebUI. Please note that this will change your hostname to allsky (or whatever you called it when installing), install the lighttpd web server, and replace your
/var/www/htmldirectory. It will also move
/etc/raspap/settings_*.json. Using the WebUI is highly recommended as it provides additional information on each setting and allows error checking behind the scenes.
It will prompt you for a new name of your Pi (default is 'allsky').
After you complete the WebUI setup, you'll be able to administer the camera using the WebUI by navigating to
Note: If you changed the name of your Pi (to 'piname', for example, instead of the default 'allsky') during the WebUI install then use this:
The default username is admin and the default password is secret. If this website is publically viewable you should change those settings.
A public page is also available in order to view the current image without having to log into the portal and without being able to do any administrative tasks. This can be useful for people who don't have a personal website but still want to share a view of their sky:
Make sure this page is publically viewable. If it is behind a firewall consult the documentation for your network equipment for information on allowing inbound connections.
Note: The WebUI setup uses
/etc/raspap/settings_*.jsonfor the camera settings. If, for some reason, you prefer to go back to the non-WebUI version, make sure to edit your
config/config.shfile to have
The dark frame subtraction feature removes hot pixels from night sky images. The concept is the following: Take an image with a cover on your camera lens and let the software subtract that image later from all images taken throughout the night.
See this Wiki page on dark frames for instructions on how to use them.
By default, a timelapse video is generated at the end of nighttime from all of the images captured in the last 24 hours.
To disable timelapse, open
Example to generate a timelapse manually:
./scripts/generateForDay.sh -t 20210710
Note: If you are unable to create a timelapse, see this Wiki page on troubshooting timelapse issues.
A Keogram is an image giving a quick view of the night activity. It was originally invented to study the aurora borealis. For each nighttime image a central vertical column 1 pixel wide is extracted. All these columns are then stitched together from left to right. This results in a timeline that reads from dusk to dawn.
See the Keogram Wiki page for more details.
Startrails are generated by stacking all the images from a night on top of each other.
To disable startrails, open
See the Startrails Wiki page for more details.
You can specify how many days worth of images to keep in order to keep the Raspberry Pi SD card from filling up. Automatic deletion is enabled by default and will keep 2 weeks of data on the card.
AUTO_DELETE="true" NIGHTS_TO_KEEP=14Set to "false" to keep all nights (requires manual management of SD card free space).
NOTE: "NIGHTSTOKEEP" should really be "DAYSTOKEEP" since it will keep that many 24-hour days of data, not just the nighttime data.
When using the allsky service, issues are written to a log file. In case the program stopped, crashed, or behaved in an abnormal way, take a look at this log file:
You can display your files on a website, either on the Pi itself or on another machine.
If you want to host the website on your Raspberry Pi, run the following command. Note that this requires first installing the WebUI.
And set these variabled in
PROTOCOL='local' IMAGE_DIR='/var/www/html/allsky/' VIDEOS_DIR=`/var/www/html/allsky/videos` KEOGRAM_DIR=`/var/www/html/allsky/keograms` STARTRAILS_DIR=`/var/www/html/allsky/startrails`
If you want to host the website on a different machine, like in this example, download the source files from this repository: https://github.com/thomasjacquin/allsky-website.git.
Once you've installed the website, either on your Pi or another machine, look at the descriptions of the settings on the allsky-website Settings page.
Experienced users may want to add some additional processing steps at the end of nighttime. To do so, copy
scripts/endOfNight_additionalSteps.shand then add your additional processing steps which will be run after the usual end-of-night processing, but before the deletion of any old image files.
Edit this file via the "Editor" link on the left side of the WebUI page.
If you want to modify a compiled file, edit the corresponding
src/*.cppfile and run the following command from the
shell make all sudo make installThis will compile the new code, create a new binary, and copy it to the top level
If you've built an allsky camera, please send me a message and I'll add you to the map.
upload.shcentralizes all the upload code from other scripts, and can be used to debug uploading issues. See this Wiki page for more information.
If you found this project useful, here's a link to send me a cup of coffee :)