{"id":452,"date":"2014-02-18T16:25:56","date_gmt":"2014-02-18T21:25:56","guid":{"rendered":"http:\/\/www.cloppermillweather.org\/blog\/?p=452"},"modified":"2014-02-18T16:28:08","modified_gmt":"2014-02-18T21:28:08","slug":"web-cam-madness","status":"publish","type":"post","link":"https:\/\/www.cloppermillweather.org\/blog\/2014\/02\/18\/web-cam-madness\/","title":{"rendered":"Web Cam Madness"},"content":{"rendered":"<p>Sharing my data with Weather Underground includes sharing my Webcam images for them to display alongside my weather data.\u00a0 Recently I checked on their site to verify the Webcam images were being uploaded and kept seeing that my camera was disabled.\u00a0 They were supposed to be grabbing the image using a URL I supplied them with.\u00a0 I would check the URL I had given them for my camera image to make sure it was working.\u00a0 Since it is the same URL used to display the image on my own pages I felt pretty confident that the image was available.\u00a0 But every time I enabled my camera on their Web site it would become disabled within a few hours to a day.<\/p>\n<p>In order to remedy this problem I chose to change from having them retrieve my camera image to me uploading it via FTP.\u00a0 At least that way I would have some degree of control over when the images were being delivered.\u00a0 That led to a couple of issues I needed to address.\u00a0 The first was that the Webcam software I was using, Yawcam, could only do FTP to one site.\u00a0 I was already using that capability to upload images to my own Web site.\u00a0 That required that I create an FTP script to upload the image to Weather Underground.\u00a0 After creating the script, I set Yawcam to save off the current Webcam image to a folder on my server&#8217;s hard drive.\u00a0 Then I set up Windows task scheduler to run the FTP script every two minutes.\u00a0 Everything looked good so I left it to run.<\/p>\n<p>When I checked back later that day I noticed that the image had stopped changing on Weather Underground.\u00a0 I checked my logs and saw that the FTP script was still working.\u00a0 Checking my server I discovered that Yawcam had stopped updating the still image it was supposed to be capturing from the webcam.\u00a0 The image being FTP&#8217;d to my Web site was fine, and the streaming video was also fine.\u00a0 I restarted Yawcam and monitored the image being saved.\u00a0 After several hours it stopped updating again.\u00a0 This went on for the next few hours before I decided on a different approach to work around this apparent bug in Yawcam.<\/p>\n<p>Yawcam has a feature where it can act as a Web server and serve up the latest image from the Webcam as a JPEG file.\u00a0 I enabled this feature and set out to find a way to retrieve the image from Yawcam directly.\u00a0 I ended up writing a Powershell script to retrieve the image and FTP it to the Weather Underground site.\u00a0 I let it run for a day to make sure it was stable.\u00a0 The image updated correctly and I was satisfied with how the script was running.<\/p>\n<p>Now I started to get carried away with myself, like I tend to do.\u00a0 I decided it would be nice to have a time-lapse video of the day&#8217;s webcam images.\u00a0 I modified the script to create a folder using the date and save the images in that folder using a sequence number (the count of images in the folder + 1).\u00a0 That permitted me to use ffmpeg to build an MPEG video of the images.\u00a0 I set the script to run once per minute and save off the images in sequence.\u00a0 I then wrote another script that runs ffmpeg to create the time lapse video and set it to run in the middle of the night on yesterday&#8217;s image sequence.\u00a0 Finally, I had the script FTP the MPEG file it had just created to my weather Web site.\u00a0 A link on my Web page permits viewing that video.\u00a0 The Web site only retains one day of time lapse video.\u00a0 The nightly upload overwrites the video from the prior day.\u00a0 Everything appears to be running smoothly.\u00a0 I still plan to write a script to clean up the sequence of images off of my hard drive after an expiration period has passed.<\/p>\n<p>I ordered a new humidity sensor, as mine appears to be suspect.\u00a0 I probably won&#8217;t have an opportunity to install the sensor chip on the humidity circuit board until the weather warms up a bit.\u00a0 Always something to do.\u00a0 I also have been preparing a Raspberry Pi to use as the new station computer.\u00a0 That will come when I get some free time and motivation, or my current station computer quits working for me.\u00a0 We&#8217;ll see which occurs first.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sharing my data with Weather Underground includes sharing my Webcam images for them to display alongside my weather data.\u00a0 Recently I checked on their site to verify the Webcam images were being uploaded and kept seeing that my camera was &hellip; <a href=\"https:\/\/www.cloppermillweather.org\/blog\/2014\/02\/18\/web-cam-madness\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-452","post","type-post","status-publish","format-standard","hentry","category-weather"],"_links":{"self":[{"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/posts\/452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/comments?post=452"}],"version-history":[{"count":0,"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/posts\/452\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/media?parent=452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/categories?post=452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloppermillweather.org\/blog\/wp-json\/wp\/v2\/tags?post=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}