The hardware location engine is also based on RSSI technology。 The localization system includes reference nodes and blind nodes。 The reference node is a fixed node that located in a known position, the node know their place and send a packet notify to other nodes。 The blind node receives packets from reference nodes, which can obtains reference nodes’ location and the corresponding RSSI value and put them
into the hardware location engine, and then the blind node’s location can be read from the engine [11]。
On the surface, using the CC2431 hardware location engine targeting the program as a good choice, but considering the practical application, it will encounter the following problems。 First of all, we have choose the CC2530 as the main chip of fixed nodes of the system, its internal programs is running in ZigBee2007 protocol, but CC2431 as a early chip, it applies only to ZigBee2006 protocol。 In the communications between CC2431 and CC2530 that will have compatibility problems。 Secondly, CC2431 hardware location engine use the distributed computing, all mobile nodes’ location are calculated by themselves, and then they upload information to the gateway node, this will not only occupy the mobile node processing time, still it can take up more network resources。 For this reason, we have to shelve this approach, consider how to implement location by using CC2530 chip。
B。Software Location Engine
If we want to use CC2530 to implement location function, that we must write software location engine by ourselves。 Because that chip do not have a hardware location engine inside of it。 This software location engine is still used RSSI technology; meanwhile mobile node position is calculated by the PC software, so as to reduce the burden of mobile node computing。 To calculate the mobile node location, there must be at least three reference nodes。 We will regard router nodes as reference nodes in network, and record the X, Y coordinates of every reference node。
Then we let the mobile node send signal to each reference node, so that each reference node can obtain a RSSI values, with these parameters, we can use trilateral measurement method to calculate the specified location of the mobile node。 The simpler way give the
mobile node to broadcast way to send data, then around it every router node would receive the data from the mobile node, thus obtains RSSI values。 Once the mobile node number increasing network, this method will make router nodes more burden, because the every radio message that the router node receives will transmit from the low layer to the top layer。 Finally the application layer will analyze data packets。 In fact, the mobile node need not to broadcast transmitted data, other routing node can also receive the mobile node packets。
Only child mobile nodes of the router node will continue to transmit the packet forwarding upward, the other router nodes will shield out the packet in the bottom of the protocol。
In order to let all router nodes can receive the packet which sending by mobile nodes, and send its RSSI values up to the gateway node, we need to modify the relevant function in Z- Stack protocol which is provided by TI。 First we find the function named afIncomingData, it deals with the received data from the bottom of protocol, in which we add some code that can obtain packet’s RSSI value。
Then through the osal_set_event function to add and send an event MY_RSSI_REPORT_EVT of RSSI
value task to OSAL polling system。 This event’s corresponding function will be executed in the task of OSAL
interrupt-driven function, thus the mobile node corresponding RSSI values will be sent to gateway node。 Through this method, the packet will only be processed by bottom function of the protocol。 According to this method we can obtain corresponding RSSI value and save the computation time of mobile nodes。
In fact, this software location engine is not implementing with a single mobile node, but through the operation of the whole system to achieve。 By which the mobile node is only