11

(Marcin) #1
FORGE

SSH FOR WINDOWS


WinSCP and PuTTY are two very useful utilities for
connecting to your Raspberry Pi (or any Linux machine).
WinSCP for Windows gives you an easy tool for
transferring files between your Windows machine
and the Pi, and PuTTY allows you to run commands on
it remotely, as if you were connected to the machine
directly with a screen and keyboard. You can install
the latest version of each from ninite.com – look under
Developer Tools.

YOU’LL NEED
Raspberry Pi 3B+
(or a more powerful
computer if you have
one spare)
A network / IP
camera (must
output a network
stream via RTSP,
and not restrict
you to using the
manufacturer’s
own app)
A smart WiFi LED
light bulb
(like this one:
hsmag.cc/jPFBpI)
2 × DuPont cable
(female/male)
1 × LED
1 × 330 Ω resistor
1 × breadboard
(or soldering iron for
more permanent
setup)
An IFTTT account
(free)
A Kasa account
(free)
An internet
connection and
router or switch
Lengths of Cat5e
or Cat6 cable
(to connect your
IP camera and
Raspberry Pi to your
router/switch)
Optional: a PoE
router, if you choose
an IP camera which
can be powered
over Ethernet

streaming service to have a stream from your camera
setup monitored by their servers. However, for this
build, I’ll be installing the software locally (which is
free) and running it as a daemon on the Raspberry Pi
to continually monitor the IP camera.


I’VE GOT THE POWER
Since processing a video feed and continually
searching for number-plates within it is a fairly
intensive operation, we’d recommend using the most
powerful of Pis, which (at the time of writing) is the
Raspberry Pi 3B+. For more power, you could install
it on something like an Intel NUC Mini PC, and if you
need really fast and accurate results you can even
configure OpenALPR to use NVIDIA GPUs.
You’ll need a Raspberry Pi set up with the latest
version of Raspbian Lite.
It’s also useful to connect up an LED to the Pi’s
GPIO ports to allow you to view at-a-glance whether


the system thinks your car is currently home or
away. This is completely optional, but it helps with
debugging and could also form part of a permanent
installation if you like. Using a breadboard and a
couple of Female-Male DuPont cables, connect
the LED and a 330 Ω resistor to the GPIO 18 pin, as
shown in the picture on the previous page.
Finally, connect the Pi to your network – ideally via
a network cable rather than WiFi, as you want the
best possible connection to your camera. We’ll use
SSH to access the Pi, which you can set up using the
steps listed here: hsmag.cc/PPbxkq.
Determine the Pi’s IP address on your home
network by opening a Terminal and typing the
command hostname -I.
You can now disconnect the keyboard and monitor
from your Pi, and instead connect to your Pi via PuTTY
from another computer on your network.


INSTALLING THE SOFTWARE
The first step is to install OpenALPR on your
Raspberry Pi, using the precompiled Linux binaries
as described at hsmag.cc/GQGQGs.


To get started, type the following commands:
wget -O - http://deb.openalpr.com/openalpr.gpg.
key | sudo apt-key add -
echo “deb http://deb.openalpr.com/master/
trusty main” | sudo tee /etc/apt/sources.list.d/
openalpr.list
sudo apt-get update
sudo apt-get install openalpr openalpr-daemon
openalpr-utils libopenalpr-dev

Once that’s installed, it is time to test that it’s
working, so go outside and take a photograph of
your car, making sure that the number-plate is
clearly visible. For this initial test, try to take the
photograph in as close to perfect conditions as
you can, i.e. looking straight-on at the car’s front
or back, with the number-plate clearly visible and
large in the frame.
Use WinSCP to transfer the photo of your car to
the pi user’s home directory (/home/pi), and then
run this command to test out the automatic number-
plate recognition:
alpr -c eu mycar.jpg

The -c switch in that command allows you to
specify the country of origin of the number-plate.
It is not essential, but it gives the software a little
helping hand if it knows what style of plate it is
looking at.

Left
The OpenALPR
software installed on
your Raspberry Pi
scans the video feed
from your IP camera,
looking for and
reading car number-
plates. You can test it
out with still photos,
to help with your
camera placement,
at: hsmag.cc/RjUeyH

If you need really fast and
accurate results you can
even configure OpenALPR
to use NVIDIA GPUs


Free download pdf