Ah Facebook, can’t live with it, can’t live without it. Too many people are on Facebook that I’d like to be able stay in touch with. Jennifer Golbeck has a point, however.
Social media in general should be about the moment. [ref]where a moment is about a month, maybe a year if you stretch it[/ref] It’s a stream of consciousness, not a diary or a novel, or even a Captain’s Log. Think about it – most social media is a ‘hey guys look at this’ There’s no need for it to become ‘evidence that may be used against you in future’ or ‘material that supports Facebook’s business model when we can work out how to monetise it’
The solution is relatively simple. Go to the Timeline and erase everything that’s older than three months. It’s not so easy to do, but it is fascinating to read the absolute banality of your Facebook status updates from years ago. There’s no reason for much of it to persist. Never mind Facebook, even I’d use it against me – every day you live is a day you won’t see again. What exactly made posting that fat cat picture such a great use of my time 🙂
As a side effect icing all that banality makes your FB timeline much tighter and cleaner. The banality is fun at the time, but the time has passed ‘ere six months are gone. I’m not so naive as to believe Facebook deletes the associated meta-data, so there’s a case to be made for reducing the dross proactively. It’s what a blog is for – so you can own your data. There’s a difference between disseminating information and giving up the rights to it – while you can’t unsay anything on the Internet, you don’t have to give it away for resale.
Seems like it’s been a successful year for our swifts, they have been breeding and screaming parties are heard overhead.
They’re still as hard to record as they were last year, however there are more of them it seems. I got the AT XY mics on the job this time. Maybe next year I will try a seriously long boom pole to get the mic pointed straight up in the air and use the directional pattern against some of the noise and traffic rumble of the town, but I’m still of the view swifts sound best in the city!
Clive from the Raspberry Pi Foundation very kindly let us have a Pi Model A and camera, so it’s time to take this project forward a stage. At the moment the alpha test version is in service keeping an eye on our new piglets. Although the original purpose was to keep an eye on our newly arrived cattle pigs are more enterprising, so it’s good to know where they are
Development was stalled however since it’s not easy to work on a piece of kit in service. Ideally one MiFi box could serve a number of cameras. This would reduce the camera power drain and consolidate.
The trouble is that the site is on the edge of town, a couple of hundred metres from the nearest houses, and I want to use BT Wi-Fi
I acquired one of these from ebay I didn’t have much hope for the integrity of the device, and to gain height I needed to go 250m further way from any likely source of WiFi. But it worked a treat, as a WISP client, I’m amazed. I was able to see 18 access points, five of which were BT WiFi , 3 of which were 5dB or above. The TP-Link gives a decent link at more than 5 and nothing at 2. I streamed a video to confirm the stability of the link.
I use it with a TP-Link TL-WA5110G which has the advantage of having a sma antenna socket and a native power supply of 12V. Although the adaptor is specced at 1A I measured the power drain at about 210 mA (~2.5W @12V). Which isn’t great but not terrible
A WISP client is not a repeater
The trouble with using the tP link as a WISP client is the signal is presented as Ethernet, and I’d then want to re-radiate the signal on a different Wi-Fi network. I could set it as a repeater, but then every Raspberry Pi would have the hurt of logging into BT WiFi. Whereas if I use a Raspberry Pi connected via ethernet to the TP-link and a WiPi dongle to connect to the farm I can collect pictures from the cameras on the farm network and perhaps power-manage the TP Link to only update every so often.
So an unexpected win, and I can look at using a Model B as a concentrator
At The Oak Tree we have acquired two bullocks/steers, and it would be good to be able to monitor these guys to check they are okay.
The obvious way is a GSM trail camera, which has got some merit. However, these are typically tripped by movement, and you get a lot of that outside. It might work to use a trail camera with a 15 minute trigger lockout – it’d be tripped all the time but wouldn’t spam you senseless with the 15 min delay. But it’s going to be dear to run as they tend to use MMS – giffgaff charge 16p per MMS for instance, whereas their data rates are 20p per 20Mb . CCTV solutions have the same problem – they are event triggered, whereas we want to be able to see a picture taken sometime in the last 15 minutes. Well, obviously we’d really like realtime streaming video by a pic at most 15 minutes old is a decent second best 🙂
What we ideally want is a camera you can send a message to to take a picture.
I used to have a Youthnet V900 which you could send an SMS to take a picture, but it was the most maddening hunk of junk I have ever purchased. Configuring the settings was done by SMS, and I only ever got it to work with Virgin mobile once. Then Virgin must have changed something and I never got this to work again, either with Virgin or with Giffgaff. In the end I put a hammer through it so it wouldn’t waste any more of my time and money. The satisfaction of doing that was the most value I got out of it.
I took a look at this trail cam and recognised the same commands as the Youthnet . I’m just not going to go there again if it uses the same software. Plus there’s the fact that it doesn’t really suit what I want it to do.
The Pi’s USB subsystem isn’t good enough to run a 3g dongle
So it’s time to break out the Raspberry Pi. Unfortunately the USB subsystem of the Pi means I couldn’t use Gammu directly with a Huawei E156G USB 3G dongle. It would work for a while and then conk out, and only come good again when the Pi was power cycled, not even a restart would fix it. That’s a real shame – this would save me a lot of power drain. Maybe it’s specific to this dongle, but there is always a world of hurt when it comes to the Pi and USB because of the power problem, and a 3G dongle has a high power usage when connected. Even running the E156G off an approved USB separately powered hub and the Pi off an approved PSU didn’t make it any better.
Go MiFi
Obviously if your site has WiFi you don’t need to wrangle with 3G, but there is a lively market in boxes to put a WiFi hotspot using 3G, called MiFi devices. You need to configure these to make use of your 3G dongle (and make sure they are compatible), the type I used is a TP-Link MR-3220
So I used a MICRONEXT MN-WD552B WiFi dongle in the A’s single USB port, which seems reliable. Of course I now eat the power drain of the Pi, WiFi is never low power and the TP-Link 3020 MiFi device gives me another power hit. But it works, and I needed results fast rather than good, so it’ll do for now.
The Raspberry Pi Camera module is really rather excellent
The camera module that the Pi foundation sell for of the Pi is rather good – the larger version of the pic above is already scaled down by half in the camera to reduce the file size. And I compressed it a fair bit. You can control the camera in Python too, using Picamera. Python seems to be the default language for the RPi.
Although the Raspberry Pi is credit card sized, it’s remarkable how big it gets if you want to do anything with it. I used a box I already had – if I decide this works well enough for a permanent version then I will use a PICE waterproof case, but for the prototype a temporary rig is fine.
At the moment both are powered up all the time, and a cron job takes a picture and SFTPs it up every 15 minutes during the day. The Pi and the TP3020 are powered via one of those dual-output 12V car to USB converters, the power drain at 12V is 250mA which is horrible, meaning using 40Ah of a 80Ah leisure battery will take 40*4=160 hours, nearly a week. Which is nasty, but livable with. There is massive opportunity to cut the power drain by bringing up the TP-Link 30210 and the Pi only once every 15 minutes when it’s light – they can be up and do their stuff in 5 minutes so I’d get a 3x drop in power drain from that, and not running in the night would save me another third.
The installation is bush-league, but this is going to need a bit of optimisation anyway
and a close-up shows just how bad it is – waterproofing by electrical tape is living on borrowed time. But that’s where those nice people at PICE come in, so there’s no point in putting any real work in that.
This shows one of the hazards of this location, in that the crows sit on the bar surveying their domain and crap on the IBC. There’s no crap on the bars though, so I might get away with it. Some anti-bird spikes might be in order.
#!/usr/bin/python
#$Id: takepic.py 53 2014-06-26 16:30:17Z richard $
import time
import picamera
import paramiko
import os
import socket
import datetime
# import RPi.GPIO as GPIO
# GPIO.setmode(GPIO.BOARD) # USE Pi BOARD pins, not the BCM ver
# GPIO.setup(7, GPIO.IN, pull_up_down=GPIO.PUD_UP) # 7 is next to gnd on pin 9, so set pull up
# defs
camerafail=False;
DIR='/home/pi/mine/'
imagename='cam01.jpg'
remotename='mysite.com' # assuming this is reachable by ssh and www
try :
with picamera.PiCamera() as camera:
#camera.resolution = (2592, 1944)
# The following is equivalent
#camera.resolution = camera.MAX_IMAGE_RESOLUTION
# run half res to test out connectivity etc and save money
#camera.led = False
camera.resolution = camera.MAX_IMAGE_RESOLUTION
#camera.resolution = (1296, 972) # do half real to eliminate Bayer softness and save TX bandwidth
camera.start_preview()
time.sleep(2)
camera.capture(DIR+imagename, resize=(800,600), format='jpeg', quality=15)
except picamera.PiCameraError,e :
print e
camerafail=True
finally :
camera.close()
time.sleep(10) # hopefully nw is up by now
if not(camerafail) :
timedout=False
connected=False
counter=0
while (not timedout) and not connected :
try :
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((remotename,80))
print(s.getsockname()[0])
connected=True
except socket.error,e :
counter += 1
print counter
finally:
s.close()
time.sleep(5)
if counter >= 5:
timedout=True
print 'Failed to connect to ',remotename,' ',datetime.datetime.now().strftime("%y/%m/%d %H:%M")
# Ideally, this gets called by cron once every quarter of an hour.
#upload
if not timedout:
print 'ftp image starting ',datetime.datetime.now().strftime("%y/%m/%d %H:%M")
try :
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(remotename, port=2222, username='username', password='password')
sftp = ssh.open_sftp();
sftp.put(DIR+imagename, '/my/remote/path/'+imagename)
sftp.close()
print "closed SFTP"
except paramiko.AuthenticationException,e :
print e
except socket.error,e :
print e
The cron job
This is then called by a cron job on the Raspberry Pi. You must to this with root privileges because you are accessing the hardware, so use
which means every 15 minutes between 4am and 10pm run takepic.py and save the error messages etc to log.txt. Before running this as a cron job you want to make sure that if you manually run
Water passing through the sluice to the Town Mill. The mill is no longer working and has been turned into a house, but the water still passes through the sluices. Blackbird chick sound heard at about 20s.
Flock of Jackdaws with young in trees by playing fields and trees by the River Test in Whitchurch. The calls of the young from all around come out in this binaural recording.
There’s a characteristic sound of bearings seizing up, and I first came across this with car wheel-bearings – they screech for weeks before going, but car sounds are hard to localise. Feeling the massive heft to the right in the fast lane of the A12 as the driver’s side wheel-bearing collapses and jams means I know that this sound means a bearing on the way out, even if here it is only on a neighbour’s Flymo 🙂
Getting a camera in an incubator has a lot of the aah factor and lets you see what’s going on without opening the incubator up all the time, which is good for the incubator, the eggs and the reliability of hatching.
You have to take into account that the incubator is a fairly harsh environment. There are lots of ways of making an incubator camera in principle, but the heat and humidity rule out a lot of them, like webcams and trail cams.
Five requirements of a Incubator camera
sealed against moisture
elevated temperature running
physically small
capable of shortening the close focus to ~ 5cm
externally powered
I used an outdoor bullet camera I got from RF Concepts – it’s an old variant of this one.
It used to be on top of a fence post looking at my bird feeder, and stood the test of time against the rain. I removed the square part on the front and tried replacing the lens with a wide angle lens, which stuck out too much and cracked the glass.Fortunately replacement mineral watch crystals are to be had – a 24.8mm was a suiable replacement. Replacing the original lens and unscrewing a bit to get the short focus closer worked a treat, and the replacement glass and O rings have held so far.
A single channel Vivotek 8100 CCTV webserver turns the analogue CCTV signal into a IP-compatible one and thei nbuilt FTP client uploads a picture every so often to make it publically viewable. The 8100 could also stream video but I don’t have a good enough connection for that.
Goose eggs – pure aggression in a small package. Apparently geese spew the eggs out, about 30 per goose per year, then collect them all up and sit on ’em. Last year we incubated some eggs, and because geese are waterfowl, getting the humidity right is key to improving the hit-rate.
Last year I used Xively for the display, but the Cosm/Xively TCP stack is ratty. Certainly for an Arduino, which has only just enough horsepower to run a TCP/IP stack, but the Xively linux library wasn’t that reliable on the Raspberry Pi that I now use as a concentrator.
I now use RRDtool, which can run on the Raspberry Pi,