Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use raspberry pie to build local area network monitoring

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use raspberry pie to build LAN monitoring. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Camera detection

Raspberry pie supports many common USB cameras, such as the one used by Liangxu:

This type of camera can be directly powered by USB and communicate with data through USB lines. Its connection to the raspberry pie is also very simple, just insert it directly into the USB hole of the raspberry pie.

How do you know if it's recognized by raspberry pie when you plug it in? We have two ways to determine:

Method 1: check whether there is a video0 file in the / dev/ directory

Pi@raspberrypi:~ $ls / dev/video*

/ dev/video0

Method 2: check the USB device to see if there is any new device

Pi@raspberrypi:~ $lsusb

Bus 001 Device 004: USB camera identified by ID 0458 KYE Systems Corp. (Mouse Systems) Genius iSlim 2000AF V2 #

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

two。 Install the motion program

Here we take the official system Raspbian as an example. To install motion, simply enter the following command:

Sudo apt-get install motion

If you cannot install, you may have to execute the following two commands first:

Sudo apt-get update

Sudo apt-get upgrade

3. Configure the daemon for motion

Use vim to modify / etc/default/motion. If the system does not have vim installed, it needs to be installed in advance, or you can use the nano editor.

Sudo vim / etc/default/motion

Let's change the no inside to yes so that the daemon runs in the background all the time:

# set to 'yes' to enable the motion daemon

Start_motion_daemon=yes

4. Modify the configuration file of motion

First, open the configuration file for motion with vim or nano:

Sudo vim / etc/motion/motion.conf

The configuration file is a bit long, but there are several options that must be changed, and the rest can be changed by default.

We need to change daemon off to daemon on and stream_localhost on to stream_localhost off. The two are not in the same location and need to be determined by search.

# Start in daemon (background) mode and release terminal (default: off)

Daemon on

# Restrict stream connections to localhost only (default: on)

Stream_localhost off

Of course, we can also change its screen size:

# Image width (pixels). Valid range: Camera dependent, default: 352

Width 800

# Image height (pixels). Valid range: Camera dependent, default: 288

Height 600

After the change, use: wq to save and exit.

5. Startup configuration

First, start the motion service:

Sudo service motion start

Then, open motion:

Pi@raspberrypi:~ $sudo motion

[0:motion] [NTC] [ALL] conf_load: Processing thread 0-config file / etc/motion/motion.conf

[0:motion] [NTC] [ALL] motion_startup: Motion 4.0 Started

[0:motion] [NTC] [ALL] motion_startup: Logging to file (/ var/log/motion/motion.log)

Thank you for reading! This is the end of the article on "how to use raspberry pie to build LAN monitoring". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report