Here’s the hardware setup of the OctoCam stuck on the window. You can see the Pi Zero W, the cable that is very securely attached to make sure the OctoCam doesn’t move, and outside.  Note: As of May 2021, OctoCam is in a different position to accomm

OctoCam (v0)

OctoCam received numerous incremental updates throughout late 2021. These changes have significantly altered the way OctoCam works and the UI design.

The OctoCam that was worked on until May 2021, and located in my freshman dorm room is now OctoCam (v0).

OctoCam is an experimental software stack based on Pimoroni’s OctoCam kit (which includes a Pi Zero W, an octopus-shaped acryllic shell, and “mounting” hardware), with the intention of creating weather timelapses, accessible via a web interface.

Due to the heavy CPU & storage requirements, I needed to run OctoCam on my home servers. However, with limited upload bandwidth from home, I needed my web server to actually serve the timelapse videos.

This required a 3-horse setup, where the Pi, my home server, and web server had to work in symphony. Through weeks of experimentation - this setup finally worked out, although it was quite the challenge.

Since March, OctoCam It’s captured some awesome weather events - including beautiful sunsets, low clouds at night (using night-specific exposure/ISO settings), snow squalls, and rainstorms!

In April 2021, I rewrote the web UI, and installed a 120° wide-angle camera in May 2021.

Language: Python, HTML, CSS, JavaScript (the usual)

Frameworks: PiCamera, Flask, ffmpeg, Materialize, and the magic of SFTP uploads (things got a little hacky…)

Lines of code: ~1,000

Timeframe: February 2021 - May 2021

You can visit this project at octocam.owenthe.dev.

 Here’s the hardware setup of the OctoCam stuck on the window. You can see the Pi Zero W, the cable that is very securely attached to make sure the OctoCam doesn’t move, and outside.  Note: As of May 2021, OctoCam is in a different position to accomm

Here’s the hardware setup of the OctoCam stuck on the window. You can see the Pi Zero W, the cable that is very securely attached to make sure the OctoCam doesn’t move, and outside.

Note: As of May 2021, OctoCam is in a different position to accommodate the 120° wide-angle camera upgrade.

 OctoCam both has a public and private web interface. This is the the first area of the private interface.  The first part of the web interface is the latest image captured by OctoCam and sent to the server. Whenever images are sent to a server, a ti

OctoCam both has a public and private web interface. This is the the first area of the private interface.

The first part of the web interface is the latest image captured by OctoCam and sent to the server. Whenever images are sent to a server, a timestamp is attached to each photo (as seen in the bottom right corner).

 After the main image, this is where the web interface got major upgrades in April 2021.  The generate new timelapse has been moved up on the page, and is now accessible without insane amounts of scrolling.   The timelapse library is now split into n

After the main image, this is where the web interface got major upgrades in April 2021.

The generate new timelapse has been moved up on the page, and is now accessible without insane amounts of scrolling.

The timelapse library is now split into not saved (really should be unsaved) and saved tabs. The not saved tab includes the automatically generated timelapses, along with unsaved timelapses made manually.

 Here’s the saved tab of the library. You’ll notice the timelapses here don’t have the date range. Why’s that?  The timeframe of a timelapse is encoded in the filename, as <UNIX timestamp of timelapse end>_<duration in seconds>.mp4. It’s

Here’s the saved tab of the library. You’ll notice the timelapses here don’t have the date range. Why’s that?

The timeframe of a timelapse is encoded in the filename, as <UNIX timestamp of timelapse end>_<duration in seconds>.mp4. It’s an interesting way to avoid dealing with the hassle of calculating this from the FPS/timeframe of mp4 files.

The timelapses here used the old <UNIX timestamp of timelapse end>.mp4 format, thus, no duration.

 Each timelapse block has three buttons to allow for further control of the timelapse. The delete button does what it says - deletes the timelapse on the server.   The save button tells the OctoCam system to not delete this specific timelapse when ti

Each timelapse block has three buttons to allow for further control of the timelapse. The delete button does what it says - deletes the timelapse on the server.

The save button tells the OctoCam system to not delete this specific timelapse when timelapses older than 14 days are purged.

The download button provides a quick way to download the source .mp4 file of the timelapse.

 The generate timelapse has seen some major improvements. You can now generate timelapses out from the current time (as it was before the UI upgrade)…

The generate timelapse has seen some major improvements. You can now generate timelapses out from the current time (as it was before the UI upgrade)…

 …but now you can generate timelapses in a specific range. This is using the datetime-local input field type (which isn’t present in Firefox/IE). 30 days of photos are stored on the server (after realizing 5 days of images uses about ~2.0 GB of stora

…but now you can generate timelapses in a specific range. This is using the datetime-local input field type (which isn’t present in Firefox/IE). 30 days of photos are stored on the server (after realizing 5 days of images uses about ~2.0 GB of storage), so you can go pretty far back in terms of images.

Non-saved timelapses are deleted after 14 days, due to their much larger storage requirements.

 Lastly - there’s a new public area for OctoCam. This page contains a stripped down version of the private Web UI, and can only access timelapses marked for public viewing. A daily timelapse is generated at 4 AM each night.  There’s also some informa

Lastly - there’s a new public area for OctoCam. This page contains a stripped down version of the private Web UI, and can only access timelapses marked for public viewing. A daily timelapse is generated at 4 AM each night.

There’s also some information about OctoCam on the public page.

 Flowchart of how everything works. Since there’s 3 discrete systems that run OctoCam, I tried to make this as accurate as possible but relatively easy to understand. There’s a lot of extra checks not shown here to make sure everything runs smoothly.

Flowchart of how everything works. Since there’s 3 discrete systems that run OctoCam, I tried to make this as accurate as possible but relatively easy to understand. There’s a lot of extra checks not shown here to make sure everything runs smoothly.

A quick note: Because the internet isn’t 100% reliable (Wi-Fi disconnects, outages, etc), the upload system from the Pi to my Home Server will save images on the Pi if upload fails. The next time internet is available, the Pi will upload any images saved (at a rate of ~8 minutes/min for long outages). This ensures that even in an internet outage, OctoCam will continue to capture images so there’s no gaps in timelapses.

(2 mins, 23 sec) A full-day timelapse captured off the wide-angle camera. Since it was installed during the last week of college, it only captured a handful of full-day timelapses. This one was the most interesting.

You’ll notice twice in the video where the brightness of the image changes. This is OctoCam going in and out of night mode (setting the shutter speed to ~500ms, ISO 400) to allow for better night-time visibility. This is timed to 25 minutes before sunrise and 25 minutes after sunset, as retrieved from the Dark Sky API on a daily basis.

(2 mins, 23 sec) Another full-day video demo of OctoCam, when a line of strong rain rolled through.

(2 mins, 23 sec) The last video demo here, of when it snowed in April.