📜 ⬆️ ⬇️

The monitoring system in the car for him on the Raspberry Pi. Part 2

In the last article I described:

This time we set up and connect a GPS receiver and a WEB camera via a USB hub.

Connecting and setting up a GPS receiver


For this purpose, I purchased the ND-100S GPS DONGLE
Check if the device is defined:

Our device is Prolific Technology.
Install packages for our device to get the coordinates and reboot:
sudo apt-get install gpsd gpsd-clients python-gps -y sudo reboot 

Now let's see and see that the gpsd service is loading, but without specifying an input device (this option does not work):

Disable this daemon:
 sudo dpkg-reconfigure gpsd 

The first question is answered “No”:

On the second, too, “No”:

You can manually fix the file / etc / default / gpsd , but it says that it is better to use the package reconfigurator, which I did.
Run the daemon to work with the receiver:
 sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock 

Now let's try to get the coordinates:

It happens that the room for a long time can not catch the coordinates or when you first start - for familiarization you can read about the cold and hot start.

Fine! Now let's add the correct launch of the daemon to autoload:
 crontab -e 



Connect and configure WEB-camera


For this purpose, I found an old Logitech WEB camera.
Actually connect our camera and check:

 pi@raspberrypi ~ $ ls /dev/video* /dev/video0 

Because of the speed of the channel, I chose to transfer the image rather than the video.
After searching and testing different packages, I stopped at fswebcam, with which I got the image in a couple of seconds.
Install and immediately try to get a snapshot:
 sudo apt-get install fswebcam -y fswebcam —save /home/pi/test.png 


Now we will take and check:
 scp pi@192.168.2.6:/home/pi/test.png ./ 

Where 192.168.2.6 is the IP address obtained from the OpenVPN server.
')
Depending on the transmission speed, you can adjust for a lower resolution of images and an image processing format.

Source: https://habr.com/ru/post/202334/


All Articles