Thursday, 13 June 2013

And in other news..

updated the script that takes the images, so instead of having 10 individual scripts, that are called from cronjob, I know have a single script that takes an image and names it based on the actual minute.

much neater, as only needs 1 entry in cronjob, and is just easier to maintain..

Contained in links on left, but also here :)

# script to take picture from webcam on /dev/video0
# then upload to gliding centre webserver
# get the single digit of time, ie 0-9 for file extension
day=`date "+%a"`
DMY=`date "+%x"`
now=`date "+%R"`
gettime=`date "+%M"`
lastminute=`echo $gettime | sed -e 's/\(^.*\)\(.$\)/\2/' `
# take photo
fswebcam -d /dev/video0 -i 0 --title "HusBos West" -r 640x480 $filename
echo picture taken $taken
# upload to website
ncftpput -u user -p password /picam/1/ $filename
echo picture $filename uploaded $taken

Picam down.. again

Well, it failed a couple of weeks ago, as you might of noticed from the images in the previous post.. ( ie its not updated )

This time the failure was total, so I suspect internet, or power failure.

Couldnt get to the club for a bit, and when I did the weather was too good... ( completed 500km of  600km flight that day ! :) ).

Anyway, managed it last weekend, and discovered that the RPi was 'dead'.. it still had power, on boot up, it just freezes, no network connection, in fact nothing other than the red light.. ahh, thats why I couldnt connect to it over the Lan then..

Re-installed the old axis webcams as a temporary fix, ( but boy do they look pants in comparison ), and took the pi home..

Investigation showed the RPi to be fine, so its the memory card...

I thought it might be full again, but putting it into one of my other PCs, I couldnt see the main partition at all. GParted showed it as being corrupt, or unreadable, although the boot partition was fine.

Anyway, I dont have unlimited time, so thought I'd just use a fresh SD card, and a reinstall.

That only took a few hours, and this time I've improved it by adding an email daemon, so that the RPi will email me daily with a log report, ip address, disk usage etc, so next time it starts to play up I'll have advance notice, and I might be able to get to the bottom of the missing daytime images.

Links on the right for setting up the email daemon, hope to have the Picams installed next time I'ma t the club, tho that might no be this weekend as the weather looks pants :(

Monday, 8 April 2013

update on the failure..

So, an examination of the rpi, showed that the flash disk had run out of space...

As it filled up it couldnt create jpgs, hence the zero size files..

Then when it got totally full, it couldnt resolve the dns, to get to the ftp server, so no files at all !

This was all caused by a bit of a bodge I'd done..

In order to try and keep the old webcams and the picams as maintenance free as possible, I've put them on a mains timer switch. So the power goes off every night, and then back on again first thing in the morning. This resets the old cams ( which randomly die and need a power cycle frequently ), and I didn't think it would be a problem for the picams as I'd put a 'shutdown' in the crontab..

But.. I'd done a shutdown -r ( ie a reboot ) rather than a -h ( halt ).
So even tho the rpi was rebooting every night, it was also being powered off separately and effectively uncontrolled.. The result of this was the rpi generating crash logs, every day, which eventually filled up the flashdisk.. doh !

I've changed the shutdown statement, and added a 2nd webcam, and even been up the ladder again, so both picams are now working, all off the one RPI.

They need a bit of 'adjustment' in their enclosure.. well, actually they are just balanced on the top of the old webcams,  and one of them has fallen over already, but it looks like we are getting there..

Just need a few weeks of testing and troubleshooting I think..

Here's some links to the latest images

Wednesday, 27 March 2013


well, the pi cam was working reliably, for a couple of months... then it stopped..

first it seemed to produce zero sized files, so maybe the usb webcam part has died..

it did that for a few weeks, but now it doesnt even do that..

Now the gliding season nears , I hope to be up the ladder and examine the bits !

In the mean time I've been making a backup cam, and documenting the process a bit better...
The problem...
At present we use 2 x AXIS 210 IP webcams to give a good view of the airfield.

  • the webcams at husbos are getting old ( over ten years old..), and so freeze regularly
  • the were never intend for outdoor use, the sun and heat puts them out of focus
  • we could do with something better..
As an example, heres a shot from one of the webcams when its working well..

and later in the day when its got warm, the camera goes out of focus making it almost useless..
 the other webcam is even worse, as it gets more sun !

by comparison, this is a logitech webcam being driven by a raspberry pi.
Much better, and way cheaper !

So the aim is to get this working reliably..

Thursday, 30 August 2012

test images from pi cam in use..

some of the components..

a raspberry pi, and a 'cheap' logitech webcam