With the development of computer, network and communication technology, as well as the continuous improvement of multimedia video technology, the third generation of remote network video monitoring system based on the network has made great progress. The new generation of monitoring system is based on the network, with the compression, transmission, storage and playback of digital video as the core. The system adopts an embedded multi-task operating system, an efficient video compression chip and a powerful embedded processor, and all the video compression and transmission processing work is built into the chip. The video signal sent by the front-end camera is digitized and compressed and packaged to become a video stream of the basic network protocol. The video stream is sent to the receiving end through the network transmission. The video receiving end can use software to decode and display and process it on the PC.
System hardware platform
This system is composed of an ARM development platform with PXA270 as the microprocessor. PXA270 is a 32-bit processor that can run at four different clock frequencies: 312MHz, 416MHz, 520MHz and 624MHz. It is used in high-performance, low-power, portable and handheld devices. It incorporates Intel Xscale technology, has the ability to adjust dynamic voltage and frequency and perfect power management functions, and provides industry-leading MIPS/mw performance. The external network card interface is directly connected to the processor to achieve Ethernet communication, and the TFTP protocol can be used to quickly download the kernel and root file system images. There are 3 UARTs, namely standard, Bluetooth and full-function UARTs, which can be connected to GPRS DTU for signal transmission through the full-function UART. There are 3 USB interfaces that can be connected to USB cameras for image acquisition. The USB camera uses the Mesh V2000 camera with OV511 as the chip.
GPRS DTU is a wireless data transmission terminal device based on GPRS network, providing a fully transparent data channel. The network coverage is wide and can be used wherever a mobile phone can be used. It supports transparent data transmission and protocol conversion, backup data center, point-to-point interconnection function, and three working modes: always online, idle offline and idle power off. It has SMS and phone wake-up functions and supports automatic reconnection after disconnection.
Overall system design
The whole monitoring system is mainly composed of ARM, GPRS DTU, USB camera and PC. The ARM development board is driven by Linux operating system. The USB camera is used for image acquisition through instruction scheduling. The acquired images are wirelessly transmitted through GPRS DTU. The PC is connected to the Internet and receives the images transmitted by GPRS DTU. The host computer is written through VC++, and the images transmitted by the monitoring point can be seen. The operator can control the monitoring terminal through SMS or phone calls, and the monitoring terminal can be in working or closed at any time. In this way, the monitoring terminal can be controlled at will and traffic can be saved. It is economical and affordable, especially suitable for some environments with low requirements for dynamic images. The system structure diagram is shown in Figure 1.
Figure 1 System structure diagram
System software design
This system uses Linux as the operating system, which is a multi-user, multi-tasking operating system; it has good openness and follows world standards, especially the international standards of Open System Interconnection (OSI). It has a complete built-in network. Linux is superior to other operating systems in terms of communication and network functions. It provides users with powerful and complete network functions. According to the needs of program development, the Linux operating system is cut and compiled, and the prepared Linux operating system is downloaded to the ARM development board through JTAG, and then arm-linux can be used to control the ARM development board. [page]
Image acquisition is performed by scheduling Video4Linux and image device drivers through ARM-Linux. Video4Linux is the basis of Linux image system and embedded image, and is a set of APIs in the Linux kernel that support image devices. The application of Linux in multimedia is currently a very popular research field, and the most critical technology is Linux's Video4Linux. Configure Video4Linux in the Linux kernel, as shown in Figure 2. After configuration, download it to ARM-Linux through the bootloader. The USB camera uses the Mesh V2000 camera with the OV511 chip. Configure the driver of the OV511 chip in the Linux operating system, as shown in Figure 3.
Figure 2 Configuring Video for Linux
Figure 3 Configuring the USB OV511 camera
Download it to ARM-Linux through the bootloader, so that image acquisition can be performed through the USB camera. The image acquisition process is shown in Figure 4.
The collected images are in BMP format. The images are too large to be transmitted over the network, so JPEG compression is required. JPEG compression technology is very advanced. It uses lossy compression to remove redundant image data. While achieving a high compression rate, it can also display very rich and vivid images, which is very suitable for video network transmission. The basic JPEG algorithm is completed by the following steps: (1) eliminating data redundancy through discrete cosine transform (DCT); (2) using the quantization coefficient matrix to quantize the discrete cosine transform coefficients; (3) encoding the quantized coefficients to minimize their entropy. Entropy coding usually uses Huffman variable word length coding. The reason for lossy image compression mainly occurs in the second step. The JPEG standard is based on transform coding and combines DCT and Huffman coding to achieve a good image compression effect. The coding method based on discrete cosine transform DCT is the core content of the JPEG algorithm [5]. The JPEG library is needed when collecting images, so it is necessary to install the JPEG library first.
Figure 4 Image acquisition flow chart
Six files, cjpeg.l, djpeg.l, jpegtran.l, rdjpgcom.l, wrjpgcom.l, snapscreenshop.l, will be generated in the /usr/local/man/manl directory. Five function libraries, libjpeg.a, libjpeg.la, libjpeg.so, libjpeg.so.62, libjpeg.so.0.0, will be generated in the /usr/local/arm/3.4.3/arm-linux/lib directory. libjpeg.so.62 and libjpeg.so.0.0 are the libraries we need. Copy them to arm-linux, so that ARM supports images in JPEG compression format. Some important functions of image compression are as follows:
The captured image is shown in Figure 5. If continuous frame capture is required, the number of frames to be captured is determined by grab_fd.frams, and a maximum of 32 frames can be captured at a time. [page]
Figure 5: The collected images
GPRS DTU is connected to the ARM development board through a full-function serial port. Under the instruction scheduling of arm-linux, the image collected by ARM is transmitted to GPRS DTU through serial communication. arm-linux accesses the serial port through device files. When accessing a specific serial port, you only need to open the corresponding device file. The device files corresponding to serial ports Port1 and Port2 are /dev/ttyS0 and /dev/ttyS1 respectively. If you want to use the serial port for communication, you must set the properties of the serial port at both ends of the communication, including the baud rate of data transmission, the format of the transmitted data, whether there is a parity bit, flow control method, etc. Serial port settings under Linux involve an important data structure struct termios, setting the serial port baud rate struct termios Opt, setting the serial port data bit
The serial port uses the open function to perform the opening operation. The open() function has two parameters, parameter 1 is the device file name to be opened, and parameter 2 is the opening method. Their meanings are as follows.
O_RDWR: Both readable and writable.
O_NOCTTY: Tells embedded Linux that the program does not want to be the "controlling terminal" of this port. If the application does not emphasize this, then any input will affect the execution of the program.
O_NDELAY: Indicates that the program does not care about the state of the DCD signal line, that is, it does not matter whether the other device is running or suspended. If this flag is not set, the program will be set to sleep until the DCD signal is low.
Use the close(fd) system call to close the serial port. Closing a serial port usually sets the DTR signal to a low level. If an external GPRS DTU is connected, the GPRS DTU will be suspended. Use the write() function to write data to the serial port. If the write call is correct, it returns the number of bytes sent, otherwise it returns -1. Read data from the serial port If the port is operated in raw data mode, the read() function call will return all the data in the serial port input buffer. If there is no data, the process will be blocked and wait until data arrives, or until the specified time is reached or an error occurs. The following method can make the read() function call return immediately.
System Implementation
The monitoring center server of this system is implemented by PC, using Windows operating system, using VC++ to write the host computer program, using TCP/IP communication, after entering the IP address of the monitoring terminal, the host computer can communicate with the monitoring terminal and receive the transmitted image, as shown in Figure 6. The system transmits an image in about 3 to 5 seconds.
Figure 6 Received image
This monitoring system supports SMS and phone wake-up functions, that is, the monitoring system can be remotely controlled through SMS and phone dialing, so that it can enter the working state and transmit information. It has a controllable connection timing function and supports three working modes: always online, idle offline and idle power off. When no data transmission is performed, the monitoring system can enter the offline state, which greatly saves communication costs. When data transmission needs to be restarted, you can use your mobile phone to send SMS to the monitoring system or call to wake it up and restore the connection with the data center. You can also send SMS to configure the monitoring system anytime and anywhere for easy management.
Previous article:Design of Touch Screen Interface for Embedded Microprocessor ARM7202
Next article:Design of smart home controller based on ARM and ZigBee technology
Recommended ReadingLatest update time:2024-11-16 20:23
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Flower carving hands-on] Interesting and fun music visualization series of small projects (01) --- LED rhythm lights
- Understanding Delta-Sigma (Δ) ADCs
- 【Qinheng RISC-V core CH582】 6-Hardware I2C reads DHT12 data
- [Discussion] Is there any antenna expert who can tell me in detail how difficult satellite communications are?
- C++ Generate a random number between 0 and 1
- Too strict post review affects the user experience
- ADI Design Tools and Calculators ADI Precision Studio
- Award-winning live broadcast: The main forum of the 2021 STM32 China Summit kicks off!
- Analysis of methods based on ARM abnormal interrupt processing
- What are the applications of microcontrollers in medical equipment?