Establishment of WSN routing based on ZigBee network

ZigBee is a wireless data transmission network platform composed of up to 65 000 wireless data transmission modules, very similar to the existing mobile communication CDMA network or GSM network. Each ZigBee network data transmission module is similar to a base station of the mobile network. Within the network, they can communicate with each other

The difference is that the ZigBee network is mainly established for automatic control data transmission. Each ZigBee network node can directly collect and monitor data with the monitoring object, and can also automatically transfer the data transmitted by other network nodes.

In addition, each ZigBee network node can also wirelessly connect with multiple isolated child nodes that do not undertake the task of network information relay within the range of their own signal coverage

ZigBee network node can support 31 sensors and controlled devices, each sensor and controlled device have 8 different interface methods for collecting and transmitting digital and analog

1 Basic algorithm of WSN routing

The nodes in ZigBee WSN can be roughly divided into two types: nodes with routing capacity and nodes without routing capacity

For a WSN with a tree cluster topology, the terminal device is usually an RFD reduced device, so there is no routing capacity; and the router and the coordinator are composed of FFD full-function devices, so there is routing capacity

In tree cluster topology WSN, a routing algorithm combining tree cluster algorithm and AODVjr algorithm is usually used. Among them, the tree cluster algorithm refers to an algorithm for messages to be transmitted along the tree topology. It is static and does not need to store routing tables.

This algorithm is suitable for occasions where nodes are stationary or move less

The AODVjr algorithm is an improvement of the Ad Hoc on-demand distance vector routing algorithm. Considering factors such as energy saving and application convenience, some features of AODV are simplified, but the original function of AODV is still retained.

The combination of these two algorithms determines the three modes of WSN routing, namely: disable routing mode, enable routing mode and forced routing mode

Prohibited routing mode is to prohibit the search for the path, so the network in this mode can only use the tree cluster algorithm to route along the tree topology

Enabling the routing mode is to combine the tree cluster algorithm and the AODVjr algorithm, and decide which routing algorithm to use according to the specific situation

The forced routing mode completely uses the AODVjr algorithm. As long as the device has the ability to find a path, no matter whether the path of the message transmission already exists, a path search process must be initiated. When the search is completed, the data packet will be transmitted along the calculated path

2 Routing

There are usually three modes for setting routes: disabling route discovery, enabling route discovery, and forcing route discovery


Suppress route discovery (SUPPRESS): If a network router is found to exist, the packet route points to that router

Otherwise, the data packet advances along the tree

Enable route discovery (ENABLE): If a network router is found to exist, the packet route will point to that router

If the network router cannot be determined, the router can initiate a route discovery process. When the discovery is complete, the data packet will be transmitted along the calculated route

If the router does not have route discovery capabilities, the data packets will advance along the tree

Forced route discovery (FORCE): If the router has route discovery capabilities, a route discovery process will be initiated regardless of whether the route already exists

When the discovery is complete, the data packet will be transmitted along the calculated route

If this router does not have route discovery capabilities, the data packets will advance along the tree

This option must be used with care, as it will result in greater network redundancy

Its main purpose is to repair broken routes

For data forwarding between devices in a tree topology, the source address is usually reduced to an upstream route (route up) or a downstream route (route down)

If LocalAddr <DestAddr <LocalAddr + CSkip (d-1) is a downstream route, otherwise it is an upstream route

Usually, the coordinator or router of the network contains an adjacency device table, which records the devices with adjacencies in a certain area.

If you want to use the adjacency table for routing, as long as the target device is visible in the physical area, you can send the information directly

For mesh topology, routing table is used for routing

Usually the coordinator or router has its own routing table. If the target device has related records in the routing table, the information can be sent according to the records in the routing table, otherwise data will be transmitted along the tree topology

3 Routing process

The routing process consists of the following steps:

(1) A device sends a route request command frame to start the route discovery process;

(2) After receiving the command, the corresponding receiving device replies to the response command frame;

(3) Evaluate and compare potential path costs (jump times, delay time);

(4) The best route record is added to the routing table of each device on this path

in

4 The method of determining the shortest optimal path

Usually the route request and the route reply are created by the router or the coordinator. When the router broadcasts the route request, it is usually not sent only once, but repeatedly sent at intervals, and for broadcast addressing, it has Two characteristics: one is that all devices with wireless RF transceiver enabled can receive the frame; the other is that the broadcast transmission uses a passive response mode, that is, when a device broadcasts a message, it also listens to all neighbors Whether the device broadcasts and forwards the frame, if not, the device will broadcast and send the frame again

In this way, the device on the network may receive the same path request multiple times, and the destination device may also receive the same path request multiple times in a period of time.

Which path request should the destination device respond to? In the implementation of the path algorithm, the author adopts the idea that the first connection is the best, that is, the first valid path request received is the request that the destination device should respond to, which is recorded in the request The path of is the path of message transmission, the reply command will be sent back along the upper level address recorded in the first path request command frame received

5 Experiment

This experiment is based on the TSZ-008 series development kit launched by Microchip, and has conducted experimental tests on the establishment and confirmation of ZigBee wireless sensor network routing.

5.1 ZigBee wireless sensor node hardware

To create a WSN node, the following components were used in this experiment: a PIC18F microcontroller with an SPITM interface; an RF transceiver chip CC2420 with the required external components; an antenna, which can be an antenna or a single wire formed by a lead on the PCB Polar antenna

As shown in Figure 1, the controller is connected to the RF transceiver chip CC2420 through the SPI bus

The controller acts as the SPI master and the CC2420 acts as the slave

The controller implements IEEE 802.15.4 MAC layer and ZigBee protocol layer

It also contains specific application logic and allows the SPI bus to interact with the RF transceiver

The Microchip Stack provides a fully integrated driver that eliminates the task of the main application program managing RF transceiver functions

If necessary, some non-SPI control signals can be reassigned to other port pins to suit the hardware of the application

In this case, the physical layer interface definition must be modified to include the correct pin assignment

5.2 Design steps

Taking Microchip's ZigBee protocol stack as an example, in order to design a ZigBee protocol system, the following steps should be designed: (1) Obtain OUI; (2) Determine the frequency band of wireless communication according to data transmission rate and market needs; Use the TSZ-008 development system for development and design; (4) use the source files provided by the Microchip protocol stack to expand the ZigBee protocol application; (5) conduct RF specification demonstration; (6) conduct ZigBee protocol interoperability specification demonstration

The following steps should be followed in the specific design:

(1) Determine the configuration file that the system needs to use;

(2) Determine the terminal structure of each device;

(3) Create a new project directory and place all specific application source files and project files in this directory;

(4) Use Zena software to generate configuration files based on device type, device configuration and terminal structure and write relevant source code

5.3 Virtual path establishment process

The relevant source code is as follows:

case NLME_START_ROUTER_confirm:

if (! params.NLME_START_ROUTER_confirm.Status)

{

ConsolePutROMString ((ROM char *) "Router Started!

Enabling joins ... rn ");

params.NLME_PERMIT_JOINING_request.PermitDura-

TIon = 0xFF;

currentPrimiTIve = NLME_PERMIT_JOINING_request;

}

else

{

PrintChar (params.NLME_JOIN_confirm.Status);

ConsolePutROMString ((ROM char *) "Router start

unsuccessful. We cannot route frames.rn ");

currentPrimiTIve = NO_PRIMITIVE;

}

break;

5.4 Confirming the path process

The relevant source code is as follows:

case NLME_PERMIT_JOINING_confirm:

if (! params.NLME_PERMIT_JOINING_confirm.Status)

{

ConsolePutROMString ((ROM char *) "Joining permitted.rn");

currentPrimitive = NO_PRIMITIVE;

}

else

{

PrintChar (params.NLME_PERMIT_JOINING_confirm.Status);

ConsolePutROMString ((ROM char *) "Join permission unsuccessful. We cannot allow joins.rn");

currentPrimitive = NO_PRIMITIVE;

}

break;

5.5 Experimental results

The author mainly verified the tree cluster network

In the experiment, the router and the terminal equipment formed a small star network. This star network is centered on the router and the terminal equipment is the child node.

Unlike the standard star network, in a small star network centered on a router, the router does not send any control commands to the terminal equipment, it only acts as a relay, and the actual control commands are issued by the coordinator

In this way, through the relay function of the router connection, the coordinator can control the terminal equipment beyond its energy coverage

The router does not have the function of forming a tree cluster network, but it can receive terminal devices to form a star network, or it can join the coordinator to participate in the tree cluster network.

You can use the development board to locate the router for simple routing and frame forwarding, but the establishment and maintenance of the routing table is not complete

The coordinator and router cannot automatically initiate route inquiry and route repair, so before transmitting data packets at the application layer, it is necessary to manually activate route inquiry by pressing a fixed keyboard

In the routing inquiry waiting, only one data packet waiting to be transmitted is allowed to be stored in the receive buffer

In the future, the routing research of ZigBee wireless sensor network needs to do a lot of work, including the security guarantee of packet routing, the research of more superior routing algorithms and how to maximize the network expansion under the condition of reducing power consumption without affecting routing The establishment and automatic repair, etc.

There is no doubt that the wireless sensor network based on the ZigBee protocol will have greater development space and prospects

Solar Lighting Loudspeaker Box is mainly composed of solar panels, lithium iron phosphate batteries, Bluetooth circuit, audio drive circuit, high-fidelity stereo horn, LED lamp module and other components of the solar integrated lamp, and has Bluetooth audio function of cross-border products. Solar lighting loudspeaker box mainly relies on solar energy to provide working energy. It is usually installed in family yard, outdoor cafe, Park square, commercial square, etc.
Usually used for garden BBQ, Party activities, or music playing. Solar lighting loudspeaker box is mainly used with wireless Bluetooth function of the customer terminal (such as smart phones, PAD tablet computers, or notebooks and other intelligent terminals with Bluetooth function), through the special Bluetooth APP software can directly connect solar Bluetooth Sound Lamp, can achieve high-fidelity music playing, working mode and lighting integrated control. At the same time, the solar Bluetooth stereo lamp can also realize various entertainment and intelligent lighting functions, such as working time adjustment, fault problem monitoring and query function, and microphone real-time voice playing function.

Solar Lighting Loudspeaker Box

Solar Lighting Loudspeaker Box,Best Solar Bluetooth Speaker,Solar Lighting Bluetooth Loudspeaker Box,Portable Solar Lighting Loudspeaker Box

ZHEJIANG FIZZ NEW ENERGY CO.,LTD , https://www.ywfizz.com