Happy 2018, everyone! Hope it’s wonderful for you!
Last night I packaged everything up in the trail camera lunch box and gave it the first outdoors test. The first thing it captured was this little guy!
I think there may still be a few things to sort out. The PIR sensor may not be very sensitive or the code may not be 100% functioning correctly (though it seemed to be in all other tests I ran indoors), as the videoing stopped before I would have thought it should. However, as the very first thing it captured was the hedgehog I am very pleased with the result!
One thing I’ve always wanted to do with my Raspberry Pi was to build a trail camera, and when the Pi Zero was released with a camera port I thought that it was about time I stopped wanting to do it and actually just do it.
It took a while to get parts delivered from various places, but eventually in the last week or so I have finally built a trail camera. I’ll probably post more about that at a later date, but the most intriguing part for me was the programming…
Most of the trail cameras I had seen on the internet that people had built would either take a photo when a PIR sensor was triggered or would take just time lapse photos all night. Neither of these solutions really appealed to me. What I wanted was a video, and more than that I didn’t just want a video to record for a few seconds and stop. I wanted it to keep recording as long as there was movement triggered by a PIR.
In the end I came up with quite a nice small solution using Python and I’ve put it up on GitHub so feel free to fork and use or improve.
What I like about my solution is that when the PIR is triggered it will start recording for a definable number of seconds. If the PIR is triggered within that time it’ll just extend the record time by that many seconds again, and so on and so on until the PIR hasn’t been triggered for at least that many seconds at which point the recording will end.
Easy to use and exactly what I wanted. So feel free to grab my trailcam phython script on GitHub.
I’ve pushed a few changes to phpiwire can now use the PWM functions in wiringPi. You can use either the hardware PWM pins or any of the GPIOs by using software PWM. A couple new examples of how to do this have also been added to the repository.
With software PWM comes the requirement to include pthreads, so that’s also linked when you compile the zephir extension.
I’d recommend you do a full clean first before compiling with:
zephir fullclean zephir install
I’ve just arrived back from the inaugural PHP South Coast Conference. It was a really great event that seemed to go without a hitch, had a fantastic range of speakers and a nice bunch of people that attended. So first of all, a really big thank you! to PHP Hampshire, BrightonPHP and PHP Dorset for putting on a top-notch event – you really wouldn’t have known it was their first one as everything seemed so professional! Continue reading “PHP South Coast 2015”
Yesterday I was one of four people to do a lightning talk at BrightonPHP. As anyone who knows me; I hate public speaking with a passion. Anything over, say, four people (usually including me) and I just like to sit there quietly and not say much. But encouraged by @coderabbi’s Wisdom as a Service talk he did at BrightonPHP in February (read: told at the train station by coderabbi that I had to do a talk) and the fact that it was a lightning talk so I didn’t actually have to speak that long, I presented a very brief, high-level overview of Zephir.
If you think any of this is inaccurate, needs tweaking, etc., then please let me know and I’ll happily update it accordingly.
Well done also to Rich, Rowan and Tristan for their very informative talks on joind.in, xml/json and selenium (respectively)… Although I’m the only one that didn’t get an applause after their talk, so you’re all dead to me. 😛
I’ve just started to use PhpStorm, which is a wonderful IDE. However, I wanted to make it even easier for myself to open files and folders. A context menu in Windows fits the bill quite nicely – just right-click on a folder and open in PhpStorm.
This batch file will do just that!
loading gist file...
Just set the path to whatever suits your system and then right-click and ‘run as administrator’ on the batch file.
I had the chance recently to read the book Instant Simple Botting with PHP, written by Shay Anderson and published by Packt Publishing. The book is designed to be a very quick and easy (hence the title!) introduction in to creating bots to scan web pages and collect information from them.
The book seems squarely aimed at beginners in PHP and object orientated programming so lives up quite well to the “simple” aspect of the title. However, I wouldn’t really say “instant” because there are quite a few pages dedicated to setting up PHP and making sure it works with a simple “Hello world”. My preference would have been just to assume that someone that wants to know how to create bots probably already has PHP set up and has at least a passing familiarity with it. But as it seems to cater to real beginners I suppose it needs to hand-hold people through the setup.
The code is clear throughout and easy for anyone to understand and follow and by the end of it you’ll have something that will very basically scrape a web page. If you’re a beginner I’d imagine you’d be left with some sense of accomplishment and something pretty simple with which you should be able to tinker without getting too caught up with a tonne of code or complexity. However, if you are any kind of seasoned developer then you will probably find the book too light-weight as there are no advanced techniques are really discussed. But then, what would you expect with just around 60 pages in the book?
However, as I’ve said, the code is nice an clean, the book for what it is is well written, and the author discusses some good practices. Great for a beginner but probably not enough for a mid/seasoned developer.
I use SVN for most of my projects at work and have diligently kept it up-to-date with the latest versions of the work copies. What happens when the working copy structure changes, as it did from 1.7.x to 1.8.x, is that Zend Studio gives error messages about the SVN connector client not being compatible. Annoying! However, if like me you’ve recently updated your SVN version to 1.8 and want Zend Studio to be compatible then it’s just a matter of a few easy steps for you to take.
I have a Dreamhost account and have done for some while. Typically I’m happy with their service, but yesterday was the first real frustration I had with them. I wanted to use procmail to send email to a script for processing. I was sure I had done this before on Dreamhost, but couldn’t seem to get it to work in the wee hours of the night. So after a quick email to support asking if it was possible, they came back with this response:
Unfortunately this is not possible. We do
not offer or support any type of email to script functionality on our
And this pretty much backed up all the searches I had been doing on line in regards to Dreamhost and using procmail.
Now, where they may not support people doing this, it is my pleasure to tell you that it is possible! And here’s how you do it…
Continue reading “Dreamhost and procmail – parsing your mail with a script”