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.

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>
<p>What settings are you using? Can you paste the allsky.sh content here?</p><p>Also, do you have any error message in the terminal?</p><p>If everything looks good, I would try a firmware upgrade.</p>
<p>I don't think there is a firmware upgrade for the 120MC-S</p><p>Sometimes i get this error, but it works after several tries: </p><p>No Connected Camera...</p><p>Open Camera ERROR, Check that you have root permissions!</p><p> Information:</p><p>- Resolution:2127147952x0</p><p>./allsky.sh: line 29: 8307 Segmentation fault ./capture -gain 50 -width 1280 -height 960 -exposure 1500000 -filename &quot;$FILENAME&quot; -latitude &quot;60.7N&quot; -longitude &quot;10.61E&quot; -wbred 53 -wbblue 80 -textx 200 -time 1 -help 0 -nodisplay 1 -timelapse 1 -usb 40 -timelapse 1</p><p>Here's my allsky.sh</p><p>FILENAME=&quot;allskycam/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 50 \</p><p> -width 1280\</p><p> -height 960 \</p><p> -exposure 1500000 \</p><p> -filename &quot;$FILENAME&quot; \</p><p> -latitude &quot;60.7N&quot; \</p><p> -longitude &quot;10.61E&quot; \</p><p> -wbred 53 \</p><p> -wbblue 80 \</p><p> -textx 200 \</p><p> -time 1\</p><p> -help 0\</p><p> -nodisplay 1 \</p><p> -timelapse 1 \</p><p> -usb 40 \</p>
<p>Problem fixed!</p><p>Just to rule out the cable i switched to another one, must have been a bad cable.</p><p>Weird thing is the cable i used first haven't been used before.</p>
<p>Doesn't seem like the quality command works as it set it to 5: </p><p>Capture Settings:</p><p> Image Type: ASI_IMG_RGB24</p><p> Resolution: 1280x960</p><p> Quality: 3</p><p>./allsky.sh: line 27: 26360 Segmentation fault ./capture -gain 50 -width 1280 -height 960 -exposure 100000 -filename &quot;$FILENAME&quot; -latitude &quot;60.7N&quot; -longitude &quot;10.61E&quot; -wbred 53 -wbblue 80 -textx 200 -time 1 -help 0 -nodisplay 1 -timelapse 1 -usb 40 \</p><p>./allsky.sh: line 28: -quality: command not found</p>
<p>You're right. there seems to be an issue with the -quality option. Have you tried &quot;image.jpg&quot; as a filename?</p>
<p>No, i will make sure to try that.</p><p>I also tried the delay option too, that did not get recognised either.</p>
I deleted one of my comments so it looks like your answer newer got posted on the website.<br>I'm using the raspberry pi 3 which is much faster than the 2 version, from benchmarks it seems to be 50-60% faster.<br>Using all the cores would be great as that would be much better for daytime use too.<br>For winteruse i wonder if 2 cores could be kept in use just to produce heat?<br>As lang as i can get the ftp and timelapse working i'm happy for now :)
<p>I actually run my raspberry pi with the overclock option ON in order to generate a bit more heat in the enclosure.<br>Once I add the thread to save images, It should fix the saving speed issue and make a better use of the cores.</p>
<p id="__CTXSM___28__1483777276074">ThomasJ1, yes with ftp it works :)</p><p id="__CTXSM___28__1483777276074">Thank you technoplusnl!</p><p id="__CTXSM___28__1483777276074">But what must I do to upload the single images to a NAS-folder? (Also the Videoclip). Thank you for your support :)</p>
I haven't tested the instructions but I believe you can do something like that: <a href="http://cagewebdev.com/raspberry-pi-connecting-to-a-network-drive/" rel="nofollow">http://cagewebdev.com/raspberry-pi-connecting-to-a-network-drive/</a><br> <br> Then, in upload.sh, you can modify the script to replace<br> cp &quot;$1&quot; &quot;current/$1-$(date +'%Y%m%d%H%M%S').jpg&quot;;<br> by<br> cp &quot;$1&quot; &quot;home/pi/mynetworkdrive/$1-$(date +'%Y%m%d%H%M%S').jpg&quot;;
Hi Thomas! Amazing Cam! But i have a Question. Is it possible to upload the images and the Timelaps to a Network folder? I have problems to upload it to a website (on my qnap nas). Thanks :)
<p>Hofi77, did you figure it out? The current upload and timelapse scripts are not up to date with the latest capture code so they are likely to have minor issues. I will fix them soon. Have you tried ftp instead of sftp like technoplusnl mentioned?</p>
<p>Hi Hofi77, I had some trouble uploading to my website too because it did not accept sftp, but I changed sftp to ftp in this line:</p><p>lftp <strong>sftp</strong>://user:password@host:/path/to/website</p><p>Then it worked...</p>
<p>After 2 days of installing on different systems I finally got it working on RPi running Ubuntu Mate. Don't know why but I could not get all dependencies installed on Raspbian. Really happy I can now use my ASI120MM as allsky camera. Thanks!</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: