An all sky camera is a device designed to take pictures of the entire sky over a certain amount of time, usually to monitor meteor showers or other astronomical phenomena.

I built mine to monitor the northern lights. I live in the Yukon and we sometimes get beautiful aurora displays during the night. However, I also have a day time job and I need my 8 hours of sleep. I created this camera to record a movie of the entire night. That way, I can replay the movie in the morning and never miss any aurora night.

Step 1: Requirements and Materials

My requirements for this camera are the following:

  • needs to photograph most of the sky
  • needs high sensitivity to low light
  • should be weather proof
  • no wires should run to the house
  • needs to be autonomous
  • needs to create a movie from pictures and upload it to the internet
  • needs to start at dusk and stop at dawn

After thinking about it for a while, I decided that the device should include its own computer and send the pictures using wifi. As for the camera, I decided to use an astronomy camera that would be small enough and was powered over USB.

Here's the list of materials:

  • ASI224MC camera from ZWO (ASI120MC or MM works too and is cheaper)
  • wide angle lens Arecont 1.55 (It gives a wider field of view than the lens that comes with the camera)
  • Raspberry Pi 2 (or 3)
  • 64 GB micro SD card
  • Wifi module (no need if Raspberry Pi 3)
  • Short right angle USB cable
  • 4" ABS pipe with end caps
  • Acrylic dome

I thought about adding a dew heater but after a few month of testing, I never got any frost on the acrylic dome. This is possibly due to the heat produced by the raspberry pi itself.

Step 2: Wiring

In this instructable, I will assume that you already have raspbian installed on the SD card.

The wiring is relatively easy. Plug the USB cable to the camera on one side and the raspberry pi on the other. Plug the wireless dongle into one of the 3 remaining USB ports of the pi. Insert the micro SD card in its slot and plug the raspberry pi to its 5V adapter.

In order to keep things tidy, you can fix your camera and computer onto a plywood board like I did on the picture.

Step 3: Build the Enclosure

The enclosure is made of a 4" ABS pipe, a flat end cap and a threaded end cap with its lid.

The flat cap goes on top and is drilled to the diameter of the camera. The threaded cap goes at the bottom and a hole (for the extension cord) is drilled in the centre of the lid.

The acrylic dome can be fixed onto the top end using weather proof silicon. I used an acrylic ring but it makes things more complex than they need to be.

You can now fix the enclosure onto your deck, your roof or any other location with a good view of the sky.

Step 4: Software

Update: If you need to change the way the capture works, you might have to make changes to the C++ source and compile it on your Raspberry PI. To do this, follow PeterD192's detailed instructions in the comments.

Update 2 (Nov 11th 2016): I have set up a GitHub page with an install script to make things easier for everyone: https://github.com/thomasjacquin/allsky If you use it, you shouldn't have to use any of the following instructions.

Original Instructions:

In order to capture images with the camera, we need to run a program in the terminal. ZWO provides an SDK in order for developers to communicate with the camera. Using this SDK, I modified one of their C++ example and compiled it for the raspberry pi. Here's a list of dependencies that need to be installed in order to get the program running.

  • OpenCV to capture the image of the sky (You can get a compiled version here)
  • Sunwait to calculate the civil twilight of your location. There is a compiled version in the archive. Make sure you copy it to your path:
    sudo cp ~/allsky/sunwait /usr/local/bin
  • Required dependencies:
    sudo apt-get update && sudo apt-get install libusb-dev libav-tools gawk lftp entr imagemagik

To make things easy, I have attached an archive. Extract it at /home/pi/allsky.

From the lib folder, you will need to run this in order to use the camera without being root:
sudo install asi.rules /lib/udev/rules.d

You will also need to add libASICamera2.so to your library:
sudo cp ~/allsky/lib/armv7/libASICamera2* /usr/local/lib

Another thing you will need to do in order to automate everything is to run the main program on startup of the pi. You can open ~/.config/lxsession/LXDE-pi/autostart and add this line:
@xterm -hold -e ~/allsky/allsky.sh

Remember to set your wifi connection in order for the pi to upload videos.

allsky.sh contains all the parameters you might want to play with: GPS coordinate, white balance, exposure and gain.

Step 5: Collect Images

Now that the raspberry pi is ready, you can plug your all sky camera. The startup script should call allsky.sh which in turn calls the binary file named "capture". It will determine if it's day time or night time. In case it's night time, the capture will start and take a picture every 5 seconds (or whatever value you set in allsky.sh). At the end of the night, the capture will stop and avconv will stitch them together and upload a video to your website using FTP.

Step 6: Watch Your Time Lapse Videos

The video produced by avconv should weigh between 30 and 50 mb depending on the length of the night (here in the Yukon, we can get from 18 hours to 0 hours of night time) and should be viewable on any web browser.

In the event that you find something interesting in the video, you can access the individual images on the raspberry pi. They will be in a folder named after yesterday's date.

Here's a page showing my own videos with almost all night archived starting January 18th 2016. Some have beautiful northern light, others have clouds, snow or rain.

<p>Hi Thomas,</p><p>My Allsky cam is working fine and can save images, creating mp4, uploading image to my webpage. But... it can not properly work for a whole day, sometime 2 hrs, sometime 4-6 hrs, then stop working. The Raspbian system still working for web browsing, or can manually restart the allsky.sh.</p><p>Tried to swap cameras, use Lan or wifi for image uploading, replaced MicroSD cards, replaced USB power supplies, disable the screen off and power saving process, also tried to stop the image resize process but all no success to make the allsky process run for longer than 12 hours.</p><p>I discovered the process is running smoother at daytime period (no image saving and uploading). As the uploading to FTP file size is quite large (~600kb when lens is coved, ASI120 MM/MC) for my ADSL internet service, i tried to reduce the image quality to cut the file size to improve the uploading speed. However, even i modified the quality values from 95% to 50% but the uploading file size stills no change (~600kb when lens is coved). May be this is normal for a totally dark image.</p><p>Any suggestion to me for my trouble shooting? Thanks in advanced.</p><p>Raymond.</p>
<p>Hi Raymond,</p><p>Regarding the file size, I have an ASI224MC and it's rare for me to upload files larger than 250kb. That's when I have lots of features on the image (clouds or aurora). For a black image that should be much less. What are your settings? Can you paste the content of allsky.sh?</p><p>Try decreasing the size of the image before upload instead of decreasing the quality. Also make sure to use JPG instead of PNG to cut the size even more.</p><p>This is what I use for example in saveImage.sh: convert &quot;$1&quot; -resize 962x720 -gravity East -chop 2x0 &quot;$1-resize.jpg&quot;;</p><p>Regarding the instability, I had the same kind of problem when my SD card started to fail. Like any computer, when there is a power cut or an improper shutdown, some blocks of memory can get corrupted during a write operation and lead to an unstable operating system. You said you swapped the micro SD so we can probably rule that out.</p><p>When you say it stops working, does it crash? Is there any message in the console?</p><p>Thomas</p>
<p>Hi Thomas,</p><p>Thanks for the reply. I use the default allsky.sh setting and using same script as yours for image resizing. Also tried to use size reduced images for FTP upload. Just changed the FTP address to my site. I will show the contents of my allsky.sh when back to home tonight.</p><p>There is no error message in the command console and no crash. Desktop and console are normal except the allsky process is stopped but it stills showing 7-8% cpu usage for capture process in the task monitor.</p><p>I started with &quot;capture&quot; only last night (without saving image and uploading process) after dinner and found it can run until the timelapse conversion is done at morning.</p><p>Raymond</p><p>Below is the script of the all sky.sh</p><p>----------------------------------------------</p><p>#!/bin/bash</p><p>echo &quot;Starting allsky camera...&quot;</p><p>cd /home/pi/allsky</p><p>FILENAME=&quot;image.jpg&quot;</p><p># Set upload to false if you don't want to upload the latest image to your website</p><p>UPLOAD=true</p><p># Set -help to 1 for full list of arguments</p><p># Set -nodisplay to 1 on Raspbian Lite and other OS without Desktop environments</p><p>ls &quot;$FILENAME&quot; | entr ./saveImage.sh &quot;$FILENAME&quot; &quot;$UPLOAD&quot; &amp; \</p><p>./capture \</p><p> -gain 150 \</p><p> -exposure 5000000 \</p><p> -filename &quot;$FILENAME&quot; \</p><p> -latitude &quot;22.27N&quot; \</p><p> -longitude &quot;114.08E&quot; \</p><p> -wbr 53 \</p><p> -wbb 80 \</p><p> -textx20 \</p><p> -fontcolor255 255 255 \</p><p> -time 1 \</p><p> -help 0 \</p><p> -nodisplay 0 \</p><p> -timelapse 1 </p>
<p>Hi Raymond, the fact that capture is still running is a good sign. That means the issue comes from one of the scripts.</p><p>Just to make sure though, is your time set correctly on your Pi? I see from your GPS info that you are in Hong Kong. There's a binary called sunwait that return the civil twilight for your given GPS coordinates. Let's say that the civil twilight at sunrise happens at 5:30am, then the capture will stop capturing images at 5:30am but it will continue running in the background until it's dark again. So it's important that your Pi clock is set correctly.</p><p>Can you also run a session where you are just saving images but not uploading? If it runs fine, we'll know it probably breaks during upload.</p><p>Also, you could try adding -width 640 and -height 480 to reduce your image size by 4 and see if it works better.</p>
<p>Hi Thomas,</p><p>Yes, have double checked the system time is correctly setup. Tried to set for local image saving only, can't pass for 10 hrs. Tried reduce the image size to 70% before current saving and FTP upload, can't pass for 10 hrs. The most longest working mode is to allow capture image only (this process is continue running even at day time but no current image saving and FTP upload), it can pass 12 hrs until the timelapse.sh is triggered. I will disable the timelapse to see if it can run longer.</p><p>I will find heatsinks or cooling fan for the pi3 board to see if it can get some improvement. Will also find a faster MicroSD card for it (now using Sandisk 60/90Ms Ultra). BTW, what kind of MicroSD card you are using? Thanks again!</p><p>Raymond</p>
<p>Hi Raymond,</p><p>I have a 64GB Samsung evo. It works great. The heat sink is a good idea. Here in the Yukon the nights are cold so I never worried about overheating but it may be a problem in your location. Especially if it is enclosed in a small container. You should check the temperature when it's running: <a href="https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/">https://www.cyberciti.biz/faq/linux-find-out-raspb...</a></p><p>Also, since your image file is fairly large, I would increase the delay between images to give some time for the Pi to write the camera sensor data on file. You can use the option -delay 1000 to have a 1 second delay between shots (the default is 10ms).</p>
<p>Hi Thomas,</p><p>I recently put together an all sky camera using the ASI120MC-S which is the USB3 version of the camera (couldn't get 2.0 when I bought it) it mostly works but I'm having a lot of trouble with image artifacts, basically a grey band in the bottom of the image, link attached, this seems to alternate every other image leading to a nauseating flicker effect. The second issue is that most nights I have to kill the process after it stops working and restart it from scratch, I run the all sky.sh script headless by passing it into nohup ./allsky.sh &gt; /dev/null 2&gt;&amp;1 &amp; maybe that is the issue but I can't imagine why. These two issues have made an otherwise good camera setup somewhat unusable. Any suggestions? Logs I can check? I can provide my script file setup if need.</p><p>Thanks, Liam</p><p>Grey band: https://cl.ly/kRAm</p>
<p>Hi Liam,</p><p>One thing that comes to mind is that the ./allsky script may be running twice on the Raspberry Pi.</p><p>The install script creates an autostart script that launches allsky.sh automatically. You can disable that behavior by removing the following line from /home/pi/.config/lxsession/LXDE-pi/autostart:</p><p>@xterm -hold -e /home/pi/allsky/allsky.sh</p><p>allsky.sh starts a few processes such as: entr and capture. Run ps -aux to make sure that there are no duplicates. If there are, you can kill them from the terminal or restart the Pi after removing the autostart line and start allsky.sh manually with nohup.</p><p>Let me know how it goes.</p><p>Thomas</p>
<p>Hi Thomas,</p><p>I just wanted to follow up with you about the banding issue, it is still happening and makes a good portion of the image unusable. Any hints or suggestions? Have you tested the software with the USB3 version of the ASI120MC (which I have). Thanks</p><p>Grey band: <a href="https://cl.ly/kRAm" rel="nofollow"> https://cl.ly/kRAm</a></p>
<p>Hey Liam,</p><p>I don't think you would need the firmware upgrade with the USB3 version of the ASI120MC. Most users reported a segmentation fault with the USB2 version and the firmware upgrade fixed it.</p><p>I would suggest updating to the latest SDK: <a href="http://astronomy-imaging-camera.com/software/ASI_linux_mac_SDK_V0.6.0414.tar">http://astronomy-imaging-camera.com/software/ASI_l...</a></p><p>There might be something specific to the USB3 version in their latest release.</p><p>I haven't tested the USB3 version myself. I would try to use the camera with oacapture and make sure it works in order to rule out any camera or Raspberry Pi issue: <a href="http://www.openastroproject.org/downloads/">http://www.openastroproject.org/downloads/</a></p><p>Let me know if you make any progress on that issue.</p><p>Thomas</p>
<p>Thomas,</p><p>TL;DR Update your lib/libASICamera2.so and libASICamera2.a to version V0.6.0414, either armV6 or 7 depending on your Pi.</p><p>Yes! Updating to the new SDK files seemed to fix the banding issue, time will tell if it still locks up the Pi, does your script or the ZWO lib do any logging? It would help if I had a place to look to try and pinpoint where things are going wrong. Also, it might be worth updating the library files on the github repo, everything else seems to work fine so it must just fix things for the USB3 cameras. Thanks!</p>
<p>Only the headers of the libraries are editable so I don't think I could add logging there. It might be worth looking at dmesg or syslog to see if there's anything there.</p>
<p>Thanks Liam for the feedback. I updated the readme and I will update the repo once I get home. I'm glad it fixes the issue for the USB3 version of the ASI120.</p>
<p>Yeah, I thought that may have been it in the beginning but I removed that line from the terminal config, now I just run the script directly, still getting freeze ups and the banding towards the bottom of the image.</p>
Sorry if this is a duplicate post. It doesn't seem to be showing up. Is there a way to set the exposure to automatic instead of a fixed exposure so that it can run night and day?
<p>Hi Frankie, the documentation of the SDK mentions the auto exposure indeed but this hasn't been implemented in the current version of my code. Here are the available options:</p><p>ASI_AUTO_MAX_GAIN,//maximum gain when auto adjust</p><p>ASI_AUTO_MAX_EXP,//maximum exposure time when auto adjust,unit is second</p><p>ASI_AUTO_MAX_BRIGHTNESS,//target brightness when auto adjust</p><p>I will probably try to include those in the future when I get a bit more time to focus on the code. In the meantime, If you are familiar with C++ development, you can modify capture.cpp to include these options.</p>
<p>Hi Thomas,</p><p>Merci pour vos explications et r&eacute;ponse rapide,thanks for your explanations and fast answer,I think I would go with the ASI224MC ...Which should be still a challenge for me...</p><p>Perhaps should I contact you again if in trouble ?</p><p>Anyway thanks for the good job already done ;-)!</p>
<p>Please don't hesitate to ask questions if you're having issues during the installation. I'm glad to help.</p><p>Also, I forgot to mention that if you want to keep cost down, you can use an ASI120MC-S which is significantly cheaper than the ASI224MC. Maybe a bit less sensitive but if you only use it as an allsky camera, I don't think it would make much difference.</p>
<p>Hi,</p><p>I am a new french member and I have discovered this pages as I was trying to find informations on building an all sky camera...I couldn't find better here ;-)!</p><p>After decades as amateur astronomer I am more a telescope builder than a computer handyman...So I am hoping just sticking to your explainations to make the system work...</p><p>Sorry if the following question should be a silly one but to reduce cost I would like to replace the ASI224MC camera with a GP224C (which is a Altair GPCAM2 IMX224 colour camera...with same low noise sensor...) </p><p>The question is : do I have to change anything on the programming side if I switch to this different camera ?This woul be a big trouble for me...</p><p>Thank you for your advice and for sharing all this valuable information with us ;-)!</p>
<p>Hi Telescopator,</p><p>I'm also french and a telescope builder ;)</p><p>Long story short: I don't think you'll be able to swap the cameras because the code is based on the Software Development Kit provided by ZWO. So basically, in the code, there are functions such as: ASICameraInfo or ASIGetControlValue... which means that it will only make sense when you are trying to talk to a camera made by ZWO.</p><p>However, I'm not saying the GP224C can't work with the Raspberry Pi. In order to get it to work, you would need to ask Altair Astro for their SDK and modify capture.cpp. Unfortunately, I don't own an Altair Camera so I can't tell you for sure it would work 100%.</p><p>I hope that makes sense.</p><p>Thomas</p>
<p>Thanks for sharing this great instructable. I have a couple of questions:</p><p>1) would it be possible to make this using the new WiFi/BlueTooth Raspberry Pi Zero W? See: <a href="https://arstechnica.com/information-technology/2017/02/new-10-raspberry-pi-zero-comes-with-wi-fi-and-bluetooth/" rel="nofollow">https://arstechnica.com/information-technology/201...</a></p><p>2) I'm curious about substituting cameras. Rather than time lapse still shots, is there a camera that could do the same with video (to capture meteors/fireballs, for example)?</p><p>3) What are the attributes one looks for in a good camera for an all-sky system? If color is not important, does one mostly look at sensor size/ LUX sensitivity /signal-to-noise ratio?</p>
<p>The problem you'll encounter with the new Pi zero W is that there's no USB ports on it and you need to connect the camera somehow. I would chose a Pi 3 since it's more powerful, has more RAM and has onboard wifi.</p><p>A lot of meteor survay cameras are using NTSC/PAL video format. Most of them use a high sensitivity camera such as the Sony Super HAD II. You will then need to convert the analog signal to digital. In that case you might be able to get away with the USB ports and use the Pi zero.</p><p>You mentioned three of the attributes that are crucial to this kind of camera. the larger the pixels, the more signal to noise ratio you will get.</p><p>Also for a larger resolution, you'll need a larger sensor... and then in turn a larger lens, which can get costly if you want one with a fast aperture (1.4 or 1.8)</p><p>Keep in mind also that a large sensor produces more data and the Raspberry Pi needs to keep up with it.</p><p>For meteor, I think a standard Sony Super HAD II 768(H)&times;494(V) would be enough.</p>
<p>Hi Thomas. Sorry. I couldn't edit allsky.sh via terminal, so i opened the file with text editor. Tried to add some entry like gamma value, in the way shown below ( and honestly other ways), but nothing... What should i do?</p><p>Anyway last night i caught many meteors with 35'' exposure time, so i'm also trying to modify the code in order to automatically process master dark frames and contain noise.</p><p>Thanks.</p><p>#!/bin/bash</p><p>echo &quot;Starting allsky camera&quot;</p><p>cd /home/pi/allsky</p><p>WIDTH=</p><p>HEIGHT=</p><p>BIN=1</p><p>MODE=1</p><p>GAIN=60</p><p>GAMMA=20</p><p>EXPOSURE=35000000</p><p>FILENAME=&quot;OCB_Masera&quot;</p><p>LATITUDE=&quot;46.1N&quot;</p><p>LONGITUDE=&quot;8.1E&quot;</p><p>WBR=&quot;53&quot;</p><p>WBB=&quot;80&quot;</p><p>ls &quot;$FILENAME-full.jpg&quot; | entr ./convert.sh &quot;$FILENAME&quot; &amp; ./capture &quot;$WIDTH&quot; &quot;$HEIGHT&quot; &quot;$BIN&quot; &quot;$MODE&quot; &quot;$GAIN&quot; &quot;$EXPOSURE&quot; &quot;$FILENAME&quot; &quot;$LATITUDE&quot; &quot;$LONGITUDE&quot; &quot;$WBR&quot; &quot;$WBB&quot; &quot;$GAMMA&quot;</p>
<p>Hi Andrea, I think you're using an old version of the code. There was no setting for gamma at the time. I will release a new version probably tomorrow which fixes a few things reported by users. You should check it out. I'll give you heads up when it's published.</p>
<p>Hi Thomas, it's a week i'm using profitably our software. Great.</p><p>To be honest i have two more questions, if i can.</p><p>First, which is the right syntax in order to add to allsky.sh other arguments like gamma, delay, brightness, timestamp ecc. ?. I tried but didn't succeed.</p><p>Second, how could frame rate be modified in the timelapse section?. I think default value is 25 fps, isnt it?.</p><p>Thanks a lot, i appreciate,</p><p>Andrea.</p>
<p>Hi Andrea,</p><p>if you open allsky.sh, you will see a few arguments already there. You can add your own at the end, 1 per line, as long as you remember to end the line with a back slash (\). Then save the file and run it: ./allsky.sh</p><p>For the frame rate, you'll have to open timelapse.sh and modifiy the value &quot;25&quot; in this line:</p><p>avconv -y -f image2 -r 25</p><p>Replace 25 by the desired frame rate, then save the file. You can run ./timelapse.sh again but you'll have to first remove the files with a number (0001, 0002, etc) because the script will recreate them.</p><p>Let me know how it works. </p>
<p>Hi Thomas!</p><p>here the errors:</p><p>pi@AllSkyCam:~/allsky $ avconv -y -f image2 -r 25 -i current/%04d.jpg -vcodec libx264 -b:v 2000k current/allsky.mp4</p><p>avconv version 11.8-6:11.8-1~deb8u1+rpi1, Copyright (c) 2000-2016 the Libav developers</p><p> built on Oct 8 2016 02:37:00 with gcc 4.9.2 (Raspbian 4.9.2-10)</p><p>[mjpeg @ 0xa84de0] invalid id 5</p><p>[mjpeg @ 0xa84de0] Picture size 57225x64989 is invalid</p><p>[mjpeg @ 0xa84de0] mjpeg: unsupported coding type (cf)</p><p>[mjpeg @ 0xa84de0] invalid id 254</p><p>[mjpeg @ 0xa84de0] mjpeg: unsupported coding type (c7)</p><p>[mjpeg @ 0xa84de0] invalid id 173</p><p>[mjpeg @ 0xa84de0] Can not process SOS before SOF, skipping</p><p>[mjpeg @ 0xa84de0] mjpeg: unsupported coding type (c8)</p><p>[mjpeg @ 0xa84de0] palette not supported</p><p>[mjpeg @ 0xa84de0] Picture size 65112x47662 is invalid</p><p>Input #0, image2, from 'current/%04d.jpg':</p><p> Duration: 00:01:45.96, start: 0.000000, bitrate: N/A</p><p> Stream #0.0: Video: mjpeg, 25 fps, 25 tbn</p><p>Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (current/allsky.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.</p><p>Output #0, mp4, to 'current/allsky.mp4':</p><p>Output file #0 does not contain any stream</p><p>pi@AllSkyCam:~/allsky $ </p>
<p>In your allsky.sh file, what's your filename? Does it end with jpg or png ?</p><p>The timelapse script assumes that you're using .jpg extensions. if your original filename is &quot;image.png&quot; and gets converted to &quot;0001.jpg&quot; you might get errors when reading the image with avconv.</p><p>To fix this, I would delete the 0001.jpg, 0002.jpg, etc images and replace .jpg by .png in the following scripts:</p><p><u>upload.sh:</u></p><p>convert &quot;$1&quot; -resize 962x720 -gravity East -chop 2x0 &quot;$1-resize.png&quot;;</p><p><u>timelapse.sh:</u></p><p>gawk 'BEGIN{ a=1 }{ printf &quot;mv -v ./current/%s current/%04d.png\n&quot;, $0, a++ }'</p><p><em>and</em></p><p>bash &amp;&amp; avconv -y -f image2 -r 25 -i current/%04d.png .......</p><p>I have a new version of the code to fix this and I'll update the github repo it in a few days.</p><p>Let me know if that works for you.</p>
Hello Thomas!<br><br>Now it works but the mp4-file has 0 Bytes :(<br><br>Greetings<br>Manuel
<p>Hi Manuel,</p><p>was there any errors in the terminal window?</p><p>Make sure you remove all the files with a number (0001, 0002, 0003, etc) and the empty.mp4 (0 byte size) but keep all the images with a timestamp and run ./timelapse.sh again.</p><p>Look for errors in the terminal and paste them here if you find any.</p>
<p>Hi Thomas!</p><p>Here the errors in the Terminal:</p><p>avconv version 11.8-6:11.8-1~deb8u1+rpi1, Copyright (c) 2000-2016 the Libav developers</p><p> built on Oct 8 2016 02:37:00 with gcc 4.9.2 (Raspbian 4.9.2-10)</p><p>[mjpeg @ 0xcaade0] Picture size 44542x23456 is invalid</p><p>[mjpeg @ 0xcaade0] invalid id 201</p><p>[mjpeg @ 0xcaade0] mjpeg: unsupported coding type (c7)</p><p>[mjpeg @ 0xcaade0] dqt: 16bit precision</p><p>[mjpeg @ 0xcaade0] invalid id 67</p><p>[mjpeg @ 0xcaade0] invalid id 36</p><p>[mjpeg @ 0xcaade0] Picture size 42221x35226 is invalid</p><p>Input #0, image2, from 'current/%04d.jpg':</p><p> Duration: 00:02:50.64, start: 0.000000, bitrate: N/A</p><p> Stream #0.0: Video: mjpeg, 25 fps, 25 tbn</p><p>Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (current/allsky-20170208.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.</p><p>Output #0, mp4, to 'current/allsky-20170208.mp4':</p><p>Output file #0 does not contain any stream</p><p>Generating Timelapse</p><p>Greetings and thank you for your help :)</p><p>Manuel</p>
<p>Hey Manuel,</p><p>What camera do you use and what size are your images? I'm talking about the 0001.jpg. </p><p>For example, I have an ASI224 and my 0001.jpg is 962x720 in size. The reason I'm asking is because cameras don't have exactly the same sensor ratio and we might need to adjust the script.<br>Also, are the images valid? Can you open 0001.jpg?</p>
<p>Hi Thomas!</p><p>i have the ASI120mm. I can open the 0001.jpg an it is 1280x960 in size.</p>
<p>Ok so we'll try to run the command manually in the terminal in order to locate the error: from your allsky directory, type this:</p><p>avconv -y -f image2 -r 25 -i current/%04d.jpg -vcodec libx264 -b:v 2000k current/allsky.mp4</p><p>Let me know what errors you get.</p>
<p>Hello Thomas;great peace of software, but i have some issues with Raspi P3 and ASI 120MM. First how can i modify delay time without making new code?</p><p>Second: from timelapse.sh command i get erroneous messages:</p><p>mv: &lsquo;./current/0001.jpg&rsquo; and &lsquo;current/0001.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0002.jpg&rsquo; and &lsquo;current/0002.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0003.jpg&rsquo; and &lsquo;current/0003.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0004.jpg&rsquo; and &lsquo;current/0004.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0005.jpg&rsquo; and &lsquo;current/0005.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0006.jpg&rsquo; and &lsquo;current/0006.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0007.jpg&rsquo; and &lsquo;current/0007.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0008.jpg&rsquo; and &lsquo;current/0008.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0009.jpg&rsquo; and &lsquo;current/0009.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0010.jpg&rsquo; and &lsquo;current/0010.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0011.jpg&rsquo; and &lsquo;current/0011.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0012.jpg&rsquo; and &lsquo;current/0012.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0013.jpg&rsquo; and &lsquo;current/0013.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0014.jpg&rsquo; and &lsquo;current/0014.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0015.jpg&rsquo; and &lsquo;current/0015.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0016.jpg&rsquo; and &lsquo;current/0016.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0017.jpg&rsquo; and &lsquo;current/0017.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0018.jpg&rsquo; and &lsquo;current/0018.jpg&rsquo; are the same file</p><p>mv: &lsquo;./current/0019.jpg&rsquo; and &lsquo;current/0019.jpg&rsquo; are the same file</p><p>&lsquo;./current/OCB_Masera-20170206235308.jpg&rsquo; -&gt; &lsquo;current/0020.jpg&rsquo;</p><p>&lsquo;./current/OCB_Masera-20170206235314.jpg&rsquo; -&gt; &lsquo;current/0021.jpg&rsquo;</p><p>&lsquo;./current/allsky-20170205.mp4&rsquo; -&gt; &lsquo;current/0022.jpg&rsquo;</p><p>&lsquo;./current/OCB_Masera-20170207000412.jpg&rsquo; -&gt; &lsquo;current/0023.jpg&rsquo;</p><p>&lsquo;./current/OCB_Masera-20170207000417.jpg&rsquo; -&gt; &lsquo;current/0024.jpg&rsquo;</p><p>&lsquo;./current/OCB_Masera-20170207000422.jpg&rsquo; -&gt; &lsquo;current/0025.jpg&rsquo;</p><p>avconv version 11.8-6:11.8-1~deb8u1+rpi1, Copyright (c) 2000-2016 the Libav developers</p><p>built on Oct 8 2016 02:37:00 with gcc 4.9.2 (Raspbian 4.9.2-10)</p><p>Input #0, image2, from 'current/%04d.jpg':</p><p>Duration: 00:00:01.00, start: 0.000000, bitrate: N/A</p><p>Stream #0.0: Video: mjpeg, yuvj420p, 640x480 [PAR 1:1 DAR 4:3], 25 fps, 25 tbn</p><p>[libx264 @ 0x1d88e60] using SAR=1/1</p><p>[libx264 @ 0x1d88e60] using cpu capabilities: none!</p><p>[libx264 @ 0x1d88e60] profile High, level 3.0</p><p>[libx264 @ 0x1d88e60] 264 - core 142 r2431 a5831aa - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 -<a href="http://www.videolan.org/x264.html" rel="nofollow">http://www.videolan.org/x264.html </a>- options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00</p><p>Output #0, mp4, to 'current/allsky-20170206.mp4':</p><p>Metadata:</p><p>encoder : Lavf56.1.0</p><p>Stream #0.0: Video: libx264, yuvj420p, 640x480 [PAR 1:1 DAR 4:3], q=-1--1, 2000 kb/s, 25 fps, 25 tbn, 25 tbc</p><p>Metadata:</p><p>encoder : Lavc56.1.0 libx264</p><p>Stream mapping:</p><p>Stream #0:0 -&gt; #0:0 (mjpeg (native) -&gt; h264 (libx264))</p><p>Press ctrl-c to stop encoding</p><p>[mjpeg @ 0x1d83280] invalid id 254</p><p>Error while decoding stream #0:0</p><p>[mjpeg @ 0x1d83280] invalid id 254</p><p>Error while decoding stream #0:0</p><p>[mjpeg @ 0x1d83280] invalid id 254</p><p>Error while decoding stream #0:0</p><p>[mjpeg @ 0x1d83280] invalid id 254</p><p>Error while decoding stream #0:0</p><p>Thanks in advance Thomas.</p>
<p>Hi,</p><p>First, for the delay between images, you should try to add a -delay argument in allsky.sh. The value is in milliseconds so if you want 2 seconds between images, you need -delay 2000</p><p>Then for the error &quot;... are the same file&quot;. That would happen if there's already a file with the same name. To fix it, you should delete all files with a number (0001, 0002, 0003, etc) and keep the ones with a timestamp.</p><p>Make sure to remove any .mp4 file too because they would cause an error when generating the new video file.</p><p>Then you can run ./timelpase.sh again</p><p>This should work properly now.</p><p>Thomas</p>
Hello Thomas!<br><br> I have a problem with timeshift <br>I've got the error &quot;destination /current.1234.jpg is not a folder&quot;<br> timeshift file is the original<br> thank you for your help <br><br>greetings <br>Manuel
<p>Hey Manuel.</p><p>The convert and timelapse scripts need a little bit of tweaking since the last time I updated the binary. I will update them once I've tested my latest code.</p><p>current.1234.jpg is not a valid name. It needs to be current/1234.jpg</p><p>I'll need a little bit more info to debug this one. Can you paste the content of timelapse.sh here?</p><p>Also, do you already have a &quot;current&quot; folder with all your images saved properly inside of it?</p>
Of course i mean current/1234.jpg. Sorry my mistake.<br> Yes I have the &quot;current&quot; folder (/home/pi/allsky/current) and all images are in that folder. <br><br> At the moment I am on the way. Please wait about 30 minutes then I can paste the content of timelapse.sh<br><br> Thank you very much <br>
<p>so here are:;</p><p>TIMELAPS:</p><p>#!/bin/bash</p><p>ls -rt current | grep &quot;$1&quot; | # find jpegs</p><p>gawk 'BEGIN{ a=1 }{ printf &quot;mv -v ./current/%s current/%04d.jpg\n&quot;, $0, a++ }' | # build mv command</p><p>bash &amp;&amp; avconv -y -f image2 -r 25 -i current/%04d.jpg -vcodec libx264 -b:v 2000k current/allsky-`date -d &quot;yesterday 13:00&quot; '+%Y%m%d'`.mp4 &amp;&amp; lftp sftp://user:password@host:/path/to/website/ -e &quot;put current/allsky-`date -d &quot;yesterday 13:00&quot; '+%Y%m%d'`.mp4; bye&quot; &amp;&amp; mv ./current `date -d &quot;yesterday 13:00&quot; '+%Y%m%d'`</p><p>ALLSKY:</p><p>#!/bin/bash</p><p>echo &quot;Starting allsky camera...&quot;</p><p>cd /home/pi/allsky</p><p>FILENAME=&quot;image.PNG&quot;</p><p># Run with -help or -h for full list of arguments</p><p>Uncomment the following line to allow upload of your image for live view</p><p>ls &quot;$FILENAME&quot; | entr ./upload.sh &quot;$FILENAME&quot; &amp; \</p><p>./capture \</p><p> -gain 5 \</p><p> -exposure 20000000 \</p><p> -filename &quot;$FILENAME&quot; \</p><p> -latitude &quot;48.39N&quot; \</p><p> -longitude &quot;14.39O&quot; \</p><p> -wbred 53 \</p><p> -wbblue 80 \</p><p> -textx200 \</p><p> -time 1\</p><p> -help 0\</p><p> -nodisplay 1 \</p><p> -timelapse 1</p><p>UPLOAD:</p><p>echo &quot;Resizing\n&quot;;</p><p>convert &quot;$1&quot; -resize 962x720 -gravity East -chop 2x0 &quot;$1-resize.jpg&quot;;</p><p>mkdir -p current;</p><p>cp &quot;$1&quot; &quot;/home/pi/AllSkyCamNAS/Bilder/ $1-$(date +'%Y%m%d%H%M%S').jpg&quot;;</p><p>cp &quot;$1&quot; &quot;current/$1-$(date +'%Y%m%d%H%M%S').jpg&quot;;</p><p>echo &quot;Uploading\n&quot;;</p><p>#lftp ftp://admin:admin@host:/path/to/website -e &quot;put $1; bye&quot;</p>
<p>Hey Manuel,</p><p>if you get the error when lauching ./timelapse.sh in the terminal, you can try to modify that line:</p><p>gawk 'BEGIN{ a=1 }{ printf &quot;mv -v ./current/%s current/%04d.jpg\n&quot;, $0, a++ }' | # build mv command</p><p>with this one:</p><p>gawk 'BEGIN{ a=1 }{ printf &quot;mv -v ./current/%s ./current/%04d.jpg\n&quot;, $0, a++ }' |</p><p>Give it a try and let me know how it goes.</p>
<p>sorry is the same</p><p>mv: the specified destination &quot;./current/1234.jpg&quot; is not a directory</p>
<p>Hey Manuel, try replacing &quot;mv&quot; by &quot;cp&quot; for now (line 3 on timelapse.sh). That will copy instead of renaming. Then you can delete the files with the timestamp manually.</p><p>I'll try to locate the source of the error.</p>
<p>Hi Thomas!</p><p>always the same</p><p>cp: the specified destination &quot;./current/1234.jpg&quot; is not a directory</p><p>its confusing</p>
<p>how can i delete and reinstall all new?</p><p>greetings</p><p>Manuel</p>
<p>Just rename the allsky directory to something else (allsky-old for example) and run the git clone command in a terminal again:</p><p>git clone <a href="https://github.com/thomasjacquin/allsky.git"> https://github.com/thomasjacquin/allsky.git</a></p><p>You won't have to run ./install.sh again because you already have all the dependencies installed.</p>
<p>thank you :)</p><p>i have run ./install.sh 3 times before i asked you :-( now the allsky.sh starts 3x at startup. how can i change this?</p>
<p>ok its done. now it starts1x</p>
<p>Just got your message. For other users who have the same issue, here's how to fix it:</p><p>Open <em style="">~/.config/lxsession/LXDE-pi/autostart</em> and remove the duplicate lines.</p>
<p>Thanks for this great project and especially the software.</p><p>I'm gonna be making my own enclosure with my 3D printer, but will using your software.</p><p>I got the software up and running, but i only get a black image when capturing, i got a 120MC-S (USB3) so i wonder if this could have the same problem as the USB2 version?</p>

About This Instructable




Bio: Most of the things I build usually relate to either astronomy, physics or woodworking in general.
More by ThomasJ1:Planets Photography Guide Newspaper Stand See Through Star Map 
Add instructable to: