the rain has begun. It won’t stop more than a few minutes or hours until Sunday. As I detailed yesterday, the west coast is in the crosshairs with some potentially extreme amounts. Our totals are I think a little less sure but should get into the 30-50 range for the three days.
Check out the temperature map for Saturday.
Some very warm sub tropical Pineapple Express air will be coming our way. We may even get a taste of that air later today (Friday) as well and it should linger until Sunday. Whenever the wind blows, it should feel quite pleasant.
Webcam fixing itself now.
After trying a hardware solution – more shielding – to keep my webcams from disconnecting themselves from the computer, I’ve instead moved to a less optimal, but at this point more effective software based strategy. Basically, I have created a script that will monitor the webcams and restart them and the software they use to snap pictures.
The code snapshot is from a much larger script that is actually responsible for both looking after the webcams and uploading the latest weather values and images to the website. It runs every minute. This looks like a crazy amount of gobbledygook but thankfully the internet provides examples that I can easily tweak for my own situation. 🙂 At the top you can see it checking the “date”. It actually checks if the image is more than 180 seconds, or 3 minutes, old. It does this for both cameras. If it is, then one or both of the cameras has probably disconnected and they need to be re-booted.
The lines with “VBoxManage” are what close the software running in Windows XP. The next lines starting with “curl” control the WeMo power device. A keen eye might notice that the only difference between the two huge chunks of writing that start with “curl” is the first has a 0 (off) and next has a 1 (on). Oh, binary.
The VBoxManage starts the software in Windows XP again and away it goes! And no, I’m not worried abut you seeing my username and password for the Windows XP box since it’s not actually connected to the internet and doesn’t do anything but make the cameras take pictures. That is not my normal password 🙂
Oh, and if you’re wondering. The lines that say “sleep” are delays, in seconds, that give the cameras and software time to boot before the next command is run. Otherwise it all happens too fast for the hardware and software to keep up and the connections fail.
For the tech heads: The Mac Mini is running MacOS X 10.10 “Yosemite”. It has a 4 core 2.3GHz Intel Core i7 CPU with a 1TB HD and 16GB of RAM (very recently upgraded from 4GB of RAM to be able to run the Virtual Machine nicely). In time I hope to upgrade it to a SSD, but it will be a while before the Solid state drives come down in price for me to afford it. It also has a couple external hard drives, one for storage of media and one for backup.