Design of wireless multi-band WSN gateway based on Linux kernel

Publisher:caoda143Latest update time:2013-12-27 Source: eccn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

At present, the Internet of Things ( IOT ) is developing rapidly. This paper introduces a wireless multi-band WSN gateway that can monitor the operation of wireless sensor subnet nodes in multiple frequency bands through Ethernet or mobile communication network.

1 System overall structure

The system designed in this paper uses wireless sensor network nodes of four frequency bands in the perception layer. Each frequency band subnet is connected to the network layer through a multi-band gateway device. Users can monitor field data through the monitoring terminal, which can be either a fixed PC or a mobile 3G device. At the same time, the gateway also has good scalability and can access WSN networks of multiple frequency bands at the same time. The block diagram of the multi-band WSN gateway system is shown in Figure 1 .

 Figure 1. Block diagram of multi-band WSN gateway system 
Figure 1 Multi-band WSN gateway system structure diagram

2 Gateway Hardware System Design

The gateway's main control unit uses an ARM9 chip S3C2440A with a main frequency of 400 MHz and external expansion of 64 MB SDRAM and 64 MB NAND Flash . The microprocessor's peripheral data controller ( PDC ) provides a DMA channel for serial peripherals , allowing them to read and write data with on-chip and off-chip memories without passing through the processor.

The 3G network access end of the gateway uses a USB interface to achieve communication with the 3G network; the wireless sensor network subnet access ends are 2.4 GHz subnet access module, 780 MHz subnet access module, 470 MHz subnet access module and 433 MHz subnet access module, and each subnet module communicates with the gateway main control unit through a serial port. The structural block diagram of the entire gateway of the Ethernet control part is shown in Figure 2 .

Figure 2: Structural block diagram of the entire gateway of the Ethernet control part
Figure 2 Structural block diagram of the entire gateway of the Ethernet control part

2.1 Multi - band wireless sensor network subnet access part

Since the S3C2440A chip itself has only 3 channels of serial ports. The subnet access modules of the 4 frequency bands all use serial communication interfaces. The ARM9 chip itself cannot meet the needs of this system, so it is necessary to use peripheral expansion chips and design serial port expansion circuits to meet the needs of the system. This design uses TI 's TL16C554A chip to expand 4 full-function serial ports through parallel data lines and address lines . [page]

The TL16C554A chip has an 8 -bit data width. The D0 to D7 pins of the TL16C554A are directly connected to the ARM9 chip, and the read and write signals are directly connected. The INA , INTB , INTC , and INTD pins of the TL16C554A are respectively connected to the INT0 , INT2 , INT3 , and INT4 pins of the main control chip , so that each extended channel serial port can work independently through interrupts.

The address lines A0 to A3 of S3C2440A are directly connected to A0 to A3 of TL16C554A , and nGCS2 of S3C2440A is used as the chip select signal of decoder 74LS139 . The input end of 74LS139 is connected to address lines A4 to A5 respectively . According to the decoder decoding, the address allocation is realized, and then the address mapping is performed through the ARM chip. The physical address of the external 4- channel serial port is

Channel A - 0x10000000 to 0x10000008

Channel B - 0x10000010 to 0x10000018

Channel C - 0x10000020 to 0x100000028

Channel D —— 0x10000030 ~ 0x10000038 .

The main control chip can access external registers by accessing these addresses, that is, the internal register addresses of the TL16C554A chip. The interface circuit of the multi-band subnet access part is shown in Figure 3 .

http://files.chinaaet.com/images/2013/05/22/5368538378235.jpg
Figure 3 Multi-band subnet access interface circuit

2.2 3G network access interface

The 3G network access part uses Huawei ET128 wireless network card with USB interface . The access interface uses USB - HUB chip AU9254A21 , which is a single-chip USB hub controller. AU92 54A21 uses 12MHz passive crystal oscillator to provide independent clock for chip operation. The interface circuit of 3G network access part is shown in Figure 4 .

Figure 4 3G network access interface circuit
Figure 4 3G network access interface circuit

2.3 Ethernet access part

The principle of the gateway sending data packets through the Ethernet port is: the processor first stores the data to be sent into the internal memory, provides the first address and data length of the sending buffer, and then executes the sending command, and DM9000A sends the data to the physical link in the TCP / IP protocol format.

Because the Ethernet signal level is different from the Ethernet controller signal level, a network transformer needs to be added between the controller and the RJ-45 interface in the hardware circuit implementation. The network transformer uses TRC9016 . The electrical signal is converted by the network transformer and then connected to the Ethernet through the RJ-45 interface to complete the data transmission process. DM9000A mainly completes the mutual conversion between data packets and digital electrical signals.

3. Gateway Software System Design

The software environment of the gateway uses an embedded Linux system. The transplanted Linux 2.6.24 source code already includes drivers for Ethernet controller DM9000A , USB interface chip and other chips. Therefore, the software part only needs to design the driver for the serial port expansion chip TL16C554A and the application program under the Linux environment.

3.1 Implementation of the driver for the serial port expansion chip TL16C554A

The Linux 2.6.24 kernel provides a unified device driver model. The registration process of multi-serial port device drivers is shown in Figure 5 .

The registration process of multi-serial port device driver is shown in the figure

3.2 Management and configuration of PPP under Linux

After modifying and transplanting the general driver code according to the hardware interface of the gateway, customize and compile the kernel image file required by the gateway through relevant configuration. The cross compiler version used for kernel compilation is arm-linux-gcc3.4.1 . Use the makemenuconfig ARCH=arm command to enter the kernel configuration graphical interface, select options related to PPP ( Point-to-Point , point -to-point protocol), and add system support for PPP function. The interface is shown in Figure 6. After the configuration is completed, save the settings and exit the kernel configuration graphical interface. Use the command: makeuImage ARCH=arm CROSS_COMPILE=arm-linux- . After the compilation is completed, the kernel image file uImage will be generated under the arch / arm / boot path of the source code package , as shown in Figure 7. [page]

Management and Configuration of PPP under Linux

3.3 Embedded Linux Network Programming

In this design, the Internet is accessed through the TD - SCDMA network . After a node in the WSN subnet is powered on, the gateway assigns it a 16- bit short address to identify itself in the subnet, and then periodically sends the data it collects. After the gateway receives the data transmitted by the sensor node, it converts the IEEE 802.15.4 protocol to the Ethernet protocol. In order to provide a transparent interface to the network device and distinguish the source of the serial port data, a unified data frame format needs to be formulated. Therefore, after the protocol conversion, the slip frame header is added and sent to the ARM through the serial port device .

After parsing the slip frame header, ARM passes it to the upper layer and MAC layer, parses the Ethernet header, and then passes it to the adaptation layer, which compresses or fragments the complete IPv6 data. The data finds the network to be sent based on neighbor discovery at the IPv6 layer, and performs routing forwarding. After adding the corresponding MAC header at the MAC layer, it is sent to the TD - SCDMA communication network through the TD module. In this way, data forwarding from the subnet to the TD network is completed.

3.3.1 Introduction to PPP protocol

PPP is a link layer protocol designed to provide a link connection for data packet transmission between two entities. This link has full-duplex operation, flow and error control, and transmits data packets in sequence. Through dial-up or dedicated line mode, the client and the server can establish a point-to-point connection to transmit data.

3.3.2 Establishing a dial - up connection

In Linux system, PPP can be used to connect a host to a PPP server and access the network resources connected to the server, just like directly connecting to the network. There are mainly the following steps to establish a PPP connection to the Internet: The first step is to call the session program. Then the session program sends AT commands to the 3G module to complete dialing, identity authentication, configuration and other tasks. Finally, the client's pppd program shakes hands with the server's pppd program to establish a connection and transfer data to each other. The flow chart of the multi-band gateway establishing a network connection is shown in Figure 8 .

The flow chart of establishing a network connection for a multi-band gateway is shown in Figure 8

3.4 Application design

Since the data comes from the serial ports of the four frequency band subnet aggregation nodes, the gateway application program collects the data of the multi-band subnet aggregation nodes using the multi-device reading mechanism select ( I / O multiplexing mechanism) in the Linux system to monitor multiple serial ports. The process of multi-serial port data collection is shown in Figure 9 .

Figure 9 Flowchart of multi-serial port data collection
Figure 9 Flow chart of multi-serial port data collection

4 Example Test

Figure 10 is a screenshot of the Linux system information displayed by the hyperterminal after PPP dial-up is successful . The dial-up target host computer address is 222.182.101.220 . It can be seen from the figure that PPP dial - up is successful and the IPv4 address 10.81.185.15 allocated by the TD network is obtained. The remote server IP is 192.200.1.21 .

Figure 10 Screenshot of Linux system information displayed in HyperTerminal after PPP dial-up is successful
Figure 10 Screenshot of Linux system information displayed in HyperTerminal after PPP dial-up is successful

Conclusion

With the era of Internet of Things, TD - SCDMA will promote the Internet of Things to effectively exert the great power of seamless communication. This solution makes full use of the public network resources of the Internet and wireless communication, organically combines wireless sensor network technology, embedded technology, and TD - SCDMA communication, successfully designs the WSN / TD gateway, realizes the integration of wireless sensor network and TD - SCDMA network, and has achieved good results in practical applications.

EndFragment
Reference address:Design of wireless multi-band WSN gateway based on Linux kernel

Previous article:EFM32 application solution: digital multimeter
Next article:Moving object detection system based on embedded Linux

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号