2013年4月28日 星期日

XBee Configuration: Coordinator and Router (Circle Network)


XBee Configuration: Coordinator and Router (Circle Network)

Posted on Monday, 7 January 2013 | No Comments
After trying a point to point network, and a point to multipoint network, it was decided that a circle network would be implemented. 
Circle network
For this, one XBee needed to be set up as a coordinator and two XBees needed to be set up as routers. 

WHICH ONE TO BE THE COORDINATOR?

For this circle network, the XBees were configured several times until the network worked. Trial and error was used, changing which robot or games master should be a coordinator or router. In order to test the system, a simple test was done by sending integers around the circle, which were read and retransmitted by the correct XBees. Eventually, the setup that worked was:
Coordinater - Robot 2
Router 1 - Games Master
Router 2 - Robot 1
Coordinator and Router Setup for Circle Network

CONFIGURING XBEE TO BE A COORDINATOR

First, the XBee shield was connected to an Arduino with an empty sketch (void setup(){} void loop(){}), with the XBee jumpers in the USB position. The Arduino was then connected to the computer and the X-CTU software was started. 

In the PC settings tab, the COM port that the Arduino was connected to was selected and then select the "Test/Query" button. A window popped up stating the the connection was fine. Next, the Modem Configuration tab was selected and the "Read" button was selected, which then read the parameters and firmware settings from the XBee. Some of these parameters need to be changed to set up the XBee as a coordinator. Thissite helped with which parameters needed changing. Since the coordinator is robot 2, the XBee needs to received from router 2, and transmit to router 1. 

Firstly, to set up the XBee to be a coordinator,in the Modem Configuration tab, Function Set is selected and the ZNET 2.5 COORDINATOR AT firmware was found and selected. Below is a list of parameters and what they were changed to:

PAN ID: 1234
SC: 1FFE
SH: 13A200
SL: 4032075A
DH: 13A200
DL: 4031F56F

The DL is the destination address of the Games Master, as this is what Robot 2 will be communicating with.

This can also be seen in the following screenshot. 
Robot 2 XBee Setup

CONFIGURING XBEE TO BE A ROUTER

Again, the XBee shield was connected to an Arduino with an empty sketch, with the XBee jumpers in the USB position. A different XBee radio was put into the shield and then the Arduino was connected to the computer and X-CTU was started up.

The Arduino port was selected and the connection was tested, before selecting the Modem Configuration tab and reading the parameters from the XBee. Some of these parameters need to be changed to set up the XBee as a router. 

ROUTER 1

For router 1, it is the Games Master therefore it needs to transmit to router 2 and receive from the coordinator. 


Firstly, to set up the XBee to be a router,in the Modem Configuration tab, Function Set is selected and the ZNET 2.5 ROUTER/END DEVICE AT firmware was found and selected. Below is a list of parameters and what they were changed to:

PAN ID: 1234
SC: 1FFE
SH: 13A200
SL: 4031F56F
DH: 13A200
DL: 4031F55E

The DL is the destination address of Robot 1, as this is what the Games Master will be communicating with.

Below is a screenshot of the parameters:
Games Module XBee Setup

ROUTER 2

For router 2, it is robot 1, so it needs to transmit to the coordinator, and receive from router 1. 

The XBee was set up as a router in the same way as router 1 above and the parameters were changed to the following:

PAN ID: 1234
SC: 1FFE
SH: 13A200
SL: 4031F55E
DH: 13A200
DL: 4032075A

The DL is the destination address of Robot 2, as this is what Robot 1 will be communicating with.


Again, a screenshot below shows the parameters:
Robot 1 XBee Setup
That is the XBees set up to talk in a circle network (Games Master talks to Robot 1, Robot 1 talks to Robot 2, Robot 2 talks to Games Master). All that needs to be done now is to change the Arduino code to deal with this network setup. 

沒有留言:

張貼留言

Messaging API作為替代方案

  LINE超好用功能要沒了!LINE Notify明年3月底終止服務,有什麼替代方案? LINE Notify將於2025年3月31日結束服務,官方建議改用Messaging API作為替代方案。 //CHANNEL_ACCESS_TOKEN = 'Messaging ...