Author Topic: How I setup my webcam  (Read 1196 times)

0 Members and 1 Guest are viewing this topic.

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
How I setup my webcam
« on: February 25, 2022, 05:49:08 PM »
After years of wondering how to setup a webcam I took the dive. Trying to find one set of instructions was elusive, so after reading multiple posts in this topic area, I figured out a solution that worked for me. The key factor that convinced me to use this setup was the Power over Ethernet (PoE) capability in which the Ethernet cable can provide power and comm.

Hardware:

Software:

I started by using the 7-day free trial of IPTimelapse and setup the camera and injector on my desk for a couple of days just to make sure everything worked. I needed the injector because my main switch was not PoE capable. First, I installed the Reolink software to setup the camera. The trickiest part of the setup was getting IPTimelapse to "find" the camera. The IPTimelapse website has a link to the iSpy Camera Connection Database (https://www.ispyconnect.com/cameras) in which you can look up your camera and generate a URL to enter into the IPTimelapse setup for the camera's URL on your home network that looks something like this: http://username:PASSWORD@192.168.1.xxx:80/cgi-bin/api.cgi?cmd=Snap&channel=0&user=username&password=PASSWORD. All I needed to provide in the URL was the username and password I setup in the Reolink software. It was easier than it sounds! Once I was confident that everything worked and I was satisfied with the IPTimelapse features, I purchased IPTimelapse and started the installation. Many thanks to Mike at IPTimelapse for answering several questions I had. I connected the Ethernet cable to the camera and installed the waterproof lid that came with the camera before climbing the ladder. Using the paper template from Reolink, I drilled the mounting holes in the molding on the southwest corner of my house and mounted the camera (camera1.jpg) about 12 feet off the ground. I mounted the camera just above two of my Arlo wireless security cameras (camera2.jpg). I tidied-up the Ethernet cable and the Reolink reset switch cable & optional power port cable with plastic ties and then attached the Ethernet cable to the molding with cable holders that came with the cable (camera3.jpg). I ran the Ethernet cable along the molding and attached it with the cable holders. I drilled a ½ inch hole in the molding by the mechanical/communications room in the basement and fed the cable through the hole after protecting the Ethernet connector with electrical tape. I used exterior Mortite Caulking Cord to plug and waterproof the hole around the Ethernet cable. In the mechanical/communications room, I connected the injector's power cord to an UPS, the Ethernet cable to the main switch, and then plugged-in the camera's Ethernet cable (switch.jpg) to the injector. Finally, using the Reolink app on my phone, I went back outside and climbed the ladder to adjust the camera's position to get the best view facing southwest towards the field behind my house. Done! It wasn't nearly as hard as I imagined. Since my neighborhood homeowner's association has a policy about security cameras not viewing any neighbor's property, I used the crop feature in IPTimelapse to minimize any views of the neighbor's properties.

IPTimelapse takes an image (still picture) every 10 seconds and saves each file in jpg format to a directory on my NAS that runs my weather website. It creates a timelapse of the 10-second images every hour and shows 2-hours' worth of images as a single video. Every hour it saves the video files in mp4 format to a directory on my NAS. At 11:50 PM each night, it creates a 24-hour timelapse from all the image files. All these settings are customizable in IPTimelapse. About 5GB worth of files are created each day. And while my server has about 2.3TB of free space, I wrote a script in Powershell that runs at 11:58 PM each night in Windows Task Scheduler to delete all 8,640 image files and all 24 video files from the previous day and move the 24-hour timelapse video to an archive folder. That way, I'm only storing about 23MB per day for each 24-hour mp4 file.

The live image and hourly timelapse is shown here: https://novawx.dscloud.me/wxcam.php and the archives can be accessed here: https://novawx.dscloud.me/2022-video-archive.php.

I hope someone thinking about adding a webcam to their weather website might find this summary useful.

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 700
    • Lake Huron Weather
Re: How I setup my webcam
« Reply #1 on: February 25, 2022, 07:14:00 PM »
Yep Mike has been great for me too.  [tup]

CW3699

Offline davidmc36

  • He who dies with the most toys wins!
  • Forecaster
  • *****
  • Posts: 1041
  • FN25ie61jw
    • MorewoodW34
Re: How I setup my webcam
« Reply #2 on: February 25, 2022, 08:37:26 PM »
I grabbed one of those cameras a while back. Need to get up the tower for install. I also figured the POE was the way to go for something that will be relatively un-accessable.

I will most likely switch over to that one for my Metobridge image. Better view West of approaching weather.

Offline davidmc36

  • He who dies with the most toys wins!
  • Forecaster
  • *****
  • Posts: 1041
  • FN25ie61jw
    • MorewoodW34
Re: How I setup my webcam
« Reply #3 on: February 25, 2022, 08:38:22 PM »
What do you mean when you say you installed the waterproof lid before taking it outside?

Offline box

  • Senior Contributor
  • ****
  • Posts: 252
Re: How I setup my webcam
« Reply #4 on: February 26, 2022, 03:36:44 AM »
After years of wondering how to setup a webcam I took the dive. Trying to find one set of instructions was elusive, so after reading multiple posts in this topic area, I figured out a solution that worked for me. The key factor that convinced me to use this setup was the Power over Ethernet (PoE) capability in which the Ethernet cable can provide power and comm.

Hardware:

Software:

I started by using the 7-day free trial of IPTimelapse and setup the camera and injector on my desk for a couple of days just to make sure everything worked. I needed the injector because my main switch was not PoE capable. First, I installed the Reolink software to setup the camera. The trickiest part of the setup was getting IPTimelapse to "find" the camera. The IPTimelapse website has a link to the iSpy Camera Connection Database (https://www.ispyconnect.com/cameras) in which you can look up your camera and generate a URL to enter into the IPTimelapse setup for the camera's URL on your home network that looks something like this: http://username:PASSWORD@192.168.1.xxx:80/cgi-bin/api.cgi?cmd=Snap&channel=0&user=username&password=PASSWORD. All I needed to provide in the URL was the username and password I setup in the Reolink software. It was easier than it sounds! Once I was confident that everything worked and I was satisfied with the IPTimelapse features, I purchased IPTimelapse and started the installation. Many thanks to Mike at IPTimelapse for answering several questions I had. I connected the Ethernet cable to the camera and installed the waterproof lid that came with the camera before climbing the ladder. Using the paper template from Reolink, I drilled the mounting holes in the molding on the southwest corner of my house and mounted the camera (camera1.jpg) about 12 feet off the ground. I mounted the camera just above two of my Arlo wireless security cameras (camera2.jpg). I tidied-up the Ethernet cable and the Reolink reset switch cable & optional power port cable with plastic ties and then attached the Ethernet cable to the molding with cable holders that came with the cable (camera3.jpg). I ran the Ethernet cable along the molding and attached it with the cable holders. I drilled a ½ inch hole in the molding by the mechanical/communications room in the basement and fed the cable through the hole after protecting the Ethernet connector with electrical tape. I used exterior Mortite Caulking Cord to plug and waterproof the hole around the Ethernet cable. In the mechanical/communications room, I connected the injector's power cord to an UPS, the Ethernet cable to the main switch, and then plugged-in the camera's Ethernet cable (switch.jpg) to the injector. Finally, using the Reolink app on my phone, I went back outside and climbed the ladder to adjust the camera's position to get the best view facing southwest towards the field behind my house. Done! It wasn't nearly as hard as I imagined. Since my neighborhood homeowner's association has a policy about security cameras not viewing any neighbor's property, I used the crop feature in IPTimelapse to minimize any views of the neighbor's properties.

IPTimelapse takes an image (still picture) every 10 seconds and saves each file in jpg format to a directory on my NAS that runs my weather website. It creates a timelapse of the 10-second images every hour and shows 2-hours' worth of images as a single video. Every hour it saves the video files in mp4 format to a directory on my NAS. At 11:50 PM each night, it creates a 24-hour timelapse from all the image files. All these settings are customizable in IPTimelapse. About 5GB worth of files are created each day. And while my server has about 2.3TB of free space, I wrote a script in Powershell that runs at 11:58 PM each night in Windows Task Scheduler to delete all 8,640 image files and all 24 video files from the previous day and move the 24-hour timelapse video to an archive folder. That way, I'm only storing about 23MB per day for each 24-hour mp4 file.

The live image and hourly timelapse is shown here: https://novawx.dscloud.me/wxcam.php and the archives can be accessed here: https://novawx.dscloud.me/2022-video-archive.php.

I hope someone thinking about adding a webcam to their weather website might find this summary useful.
first thanks for your very detailed post

I have been contemplating something similar for a while and have just purchased a NAS which among other things I hope to run a website from

What software are you using on the NAS for your website and are you overlaying weather text with timelapse?

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #5 on: February 26, 2022, 07:16:16 AM »
@davidmc36: The waterproof lid is a "sleeve" that covers the Ethernet cable and connection to the camera. See attached page from the user guide. It was not a task I wanted to do while up on the ladder! It took two hands to squeeze the "rubber stopper" around the Ethernet cable and at the same time push the stopper into the sleeve.

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #6 on: February 26, 2022, 07:23:45 AM »
@box: I have a Synology NAS, Disk Station D220+. It runs Linux but the interface is via a web GUI. It has a built-in capability to host a website that you setup via the GUI. If you have Synology, I can provide details on how I setup my weather website.

The weather observation text that's overlaid on the camera image and timelapse is generated by the IPTimelapse software - it can read your clientraw.txt file to display the weather text, which is what I do, or it can display CWOP, Wx Underground, nearby NOAA observations as other options.

Offline davidmc36

  • He who dies with the most toys wins!
  • Forecaster
  • *****
  • Posts: 1041
  • FN25ie61jw
    • MorewoodW34
Re: How I setup my webcam
« Reply #7 on: February 26, 2022, 07:47:19 AM »
@davidmc36: The waterproof lid is a "sleeve" that covers the Ethernet cable and connection to the camera. See attached page from the user guide. It was not a task I wanted to do while up on the ladder! It took two hands to squeeze the "rubber stopper" around the Ethernet cable and at the same time push the stopper into the sleeve.

Oh yes. I remember that bit in the box.

Offline box

  • Senior Contributor
  • ****
  • Posts: 252
Re: How I setup my webcam
« Reply #8 on: February 26, 2022, 08:36:05 AM »
@box: I have a Synology NAS, Disk Station D220+. It runs Linux but the interface is via a web GUI. It has a built-in capability to host a website that you setup via the GUI. If you have Synology, I can provide details on how I setup my weather website.

The weather observation text that's overlaid on the camera image and timelapse is generated by the IPTimelapse software - it can read your clientraw.txt file to display the weather text, which is what I do, or it can display CWOP, Wx Underground, nearby NOAA observations as other options.
I have a DS214 Play running DSM7 so i would appreciate any pointers, it's a medium term project as I haven't selected a camera or location yet,but it would be good to put my other data into a website

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #9 on: February 26, 2022, 09:55:07 AM »
I first tried to run my website on my [older] DS218j and it was very slow to respond (processor was too slow and there wasn't enough RAM - 512MB), so I upgraded to the D220+ in December (a Christmas present from my wife!) and maxed-out the RAM at 6GB. I have two 3TB drives running as a RAID and the OS is DSM 7. I relegated my old DS218j to handle general PC backups and as a media server for photos, music, and video. My D220+ is dedicated to my weather stuff.

A good place to start to setup a website on a Synology NAS is here: https://kb.synology.com/en-global/DSM/tutorial/How_to_host_a_website_on_Synology_NAS. I made the mistake of setting up and using the /www directory but don't do that! Make sure you use /web, which is also the root directory on a Synology NAS, and upload all your weather data there. Thanks to Harold (https://www.wxforum.net/index.php?action=profile;u=13960), who runs a Synology NAS, told me to switch from /www to /web. Feel free to ask me any questions if you get stuck.

Offline Johnmac

  • Senior Contributor
  • ****
  • Posts: 161
    • Westminster Massachusetts Weather
Re: How I setup my webcam
« Reply #10 on: February 26, 2022, 03:08:34 PM »
weather doc - any chance you could post a sample of your script for deleting and archiving your IPTimelapse files.

Thanks,

John
John
Westminster, MA USA

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #11 on: February 26, 2022, 04:40:23 PM »
John,

See attached txt file. Change the extension to ps1 to open it in Powershell ISE for editing. I'm not very good at writing code, but the script does work. Let me know if you have any questions and hopefully the comments will help explain what the code is doing. The image and video files created by IPTimelapse on my Windows PC are stored on my Synology NAS server (in \\lightning\web\video) that also hosts my weather website. This script runs on my Windows PC using Task Scheduler.

Bill

Offline box

  • Senior Contributor
  • ****
  • Posts: 252
Re: How I setup my webcam
« Reply #12 on: February 26, 2022, 07:08:47 PM »
I first tried to run my website on my [older] DS218j and it was very slow to respond (processor was too slow and there wasn't enough RAM - 512MB), so I upgraded to the D220+ in December (a Christmas present from my wife!) and maxed-out the RAM at 6GB. I have two 3TB drives running as a RAID and the OS is DSM 7. I relegated my old DS218j to handle general PC backups and as a media server for photos, music, and video. My D220+ is dedicated to my weather stuff.

A good place to start to setup a website on a Synology NAS is here: https://kb.synology.com/en-global/DSM/tutorial/How_to_host_a_website_on_Synology_NAS. I made the mistake of setting up and using the /www directory but don't do that! Make sure you use /web, which is also the root directory on a Synology NAS, and upload all your weather data there. Thanks to Harold (https://www.wxforum.net/index.php?action=profile;u=13960), who runs a Synology NAS, told me to switch from /www to /web. Feel free to ask me any questions if you get stuck.
many thanks

Offline Johnmac

  • Senior Contributor
  • ****
  • Posts: 161
    • Westminster Massachusetts Weather
Re: How I setup my webcam
« Reply #13 on: February 26, 2022, 07:29:00 PM »
John,

See attached txt file. Change the extension to ps1 to open it in Powershell ISE for editing. I'm not very good at writing code, but the script does work. Let me know if you have any questions and hopefully the comments will help explain what the code is doing. The image and video files created by IPTimelapse on my Windows PC are stored on my Synology NAS server (in \\lightning\web\video) that also hosts my weather website. This script runs on my Windows PC using Task Scheduler.

Bill

Thank you, much appreciated
John
Westminster, MA USA

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #14 on: February 27, 2022, 07:22:23 AM »
I found an error in the script I uploaded yesterday. Use the attached. I had the line of code that subtracts a day from the variable $day in the wrong location in the script.

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #15 on: March 01, 2022, 06:03:22 PM »
Ah yes, another error in my script. This morning when I looked at my video directory, no files had been deleted or moved to archive. Then it hit me, today is March 1 and since my script runs the day following the files that need to be deleted and moved, by subtracting 1 from the current day, the resulting day of the month was March 0, which of course doesn't exist. So now I have to find some time (I have one month) to add checks for the last day of each month and, while I'm doing so, make accommodation for the change of the year from Dec 31 to Jan 1.

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 507
Re: How I setup my webcam
« Reply #16 on: March 01, 2022, 06:53:41 PM »
@weatherdoc here is an example you can play with. We use something similar to delete older backups at work.
Change $Path to  suit you as well as $Daysback.

# Delete all Files in C:\temp older than 30 day(s)
$Path = "C:\temp"
$Daysback = "-30"
 
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($Daysback)
Get-ChildItem $Path | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item
« Last Edit: March 01, 2022, 06:58:49 PM by dupreezd »
Davis VP2 6163 | WiFi Logger
CWOP - FW0717
Blitzortung 2100

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #17 on: March 02, 2022, 06:33:19 PM »
Hey @dupreezd - thanks for posting that snippet of code. Much more elegant for deleting files than what I cobbled together. I'll keep it for future use.

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #18 on: March 23, 2022, 05:08:21 PM »
I finally found the time to setup a live feed with help from Mike at IPTimelapse. The live feed is here: https://novawx.dscloud.me/wxcamlive.php

Offline BKS97

  • Contributor
  • ***
  • Posts: 124
    • Sartell East Weather
Re: How I setup my webcam
« Reply #19 on: April 12, 2022, 01:13:40 PM »
@weatherdoc: Thanks for this helpful thread. Matt at Central Maine Weather also helped me out.  After reading your post I finally decided to install a camera – a Reolink RLC-410W.  It is a plug-in model, so I had to purchase some flat DC 12V power extension cable to run about 40 feet from the outside outlet on the house to the camera.  The cord fits in 3M Command clear plastic outdoor cord clips, which I spaced two feet apart along a window edge vertically and then under the eave.  I wrapped all connections in one-inch-wide “stretch and seal” self-fusing silicone tape for waterproofing.  I also had to install an extra-deep waterproof outdoor outlet cover to allow room for the power adapter block and another plug.

After getting the camera operating and installed, I decided to sign up with the timelapse site, Webcam.io, so that I could have a way to get the camera images on my website and have timelapse views.  To get the images to Webcam.io, I used the FTP service on the Reolink phone app to upload my camera’s images. The process took just a few minutes.  Webcam.io provides an HTML code for an auto-updating static image, which I pasted into my website.  Viewers need only to click on the image to bring up the timelapse page.  The cost for Webcam.io’s basic service plan is $4.99 per month.  Text overlays are easy to add.  Overlaying current weather data is also possible, but I haven’t figured out how to do that yet.  Otherwise, all seems to be working well so far: https://www.sartelleastweather.com.
Davis Vantage Pro2 Plus / WLL / MB
KMNSARTE27 / CWOP: FW3030 (F3030)
Sartell East Weather
Weather34 Dashboard

Offline weatherdoc

  • Senior Member
  • **
  • Posts: 59
    • Willowsford Farm Weather
Re: How I setup my webcam
« Reply #20 on: April 12, 2022, 04:52:20 PM »
I'm glad this thread was helpful. I like the layout of your webpage as well as the way you display your camera images and videos. Thanks for sharing.