Developers Club geek daily blog

2 years ago
In last article I described:
creation on one Raspberry Pi of the home VPN server;
installation and setup on the second Raspberry Pi OpenVPN-client, Node.JS and the 3G-modem.
This time we will configure and we will connect the GPS receiver and the Webcam (both devices – USB).

Connection and setup of the GPS receiver


For this purpose I purchased

Let's check whether the device was defined:
Observation system in the car behind it on Raspberry Pi. Part 2
Our device — Prolific Technology.
Let's set packets for our device to receive coordinates and we will reboot:
sudo apt-get install gpsd gpsd-clients python-gps -y
sudo reboot

Now we will look and we will see that we load the gpsd service, but without indication of the input device (this option does not work):
Observation system in the car behind it on Raspberry Pi. Part 2
Let's disconnect this demon:
sudo dpkg-reconfigure gpsd

We answer the first question with "No":
Observation system in the car behind it on Raspberry Pi. Part 2
On "No" second too:
Observation system in the car behind it on Raspberry Pi. Part 2
It is possible to correct manually file/etc/default/gpsd, but there it is written that it is better to use a packet rekonfigurator that I also made.
Let's start the demon for work with the receiver:
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock

Now we will try to receive coordinates:
Observation system in the car behind it on Raspberry Pi. Part 2
Happens that indoors cannot long catch coordinate or at the first start — for acquaintance it is possible to esteem about cold and hot start.

It's cool! Now we will add right start of the demon to automatic loading:
crontab -e

Observation system in the car behind it on Raspberry Pi. Part 2

Connection and Webcams setup


Because of speed of the channel I preferred image transfer, but not video.
After search and testing of different packets I stopped on fswebcam by means of which I received the image for couple of seconds.
Let's set and at once we will try to receive a picture:
sudo apt-get install fswebcam -y
fswebcam —save /home/pi/test.png

Observation system in the car behind it on Raspberry Pi. Part 2
Let's take away now and we will check:
scp pi@192.168.2.6:/home/pi/test.png ./

Where 192.168.2.6 — the IP address received from server OpenVPN.

This article is a translation of the original post at habrahabr.ru/post/202330/
If you have any questions regarding the material covered in the article above, please, contact the original author of the post.
If you have any complaints about this article or you want this article to be deleted, please, drop an email here: sysmagazine.com@gmail.com.

We believe that the knowledge, which is available at the most popular Russian IT blog habrahabr.ru, should be accessed by everyone, even though it is poorly translated.
Shared knowledge makes the world better.
Best wishes.

comments powered by Disqus