Xbee (S2C) serial communication



Xbee devices allow you to enable wireless connectivity to your projects creating a network of connected devices. As WIFI, BLE communication protocol…Xbee is different type of communication protocol from RF category, it is industrial certified protocol to give convenience of internal communication with high security. There are many products in market developed around xbee, in industry it was been used to connect multiple machines as called Machine 2 machine (M2M) communication and now it is being adopted in consumer market as a IOT device. Some of the live example, Philips hue light with hub, Samsung smart device and many more. Considering the current market requirements companies have launched multiple upgraded products with inbuilt, Analog lines, digital lines, UART, serial, memory, antenna, sleep mode etc.
Here I’m going to use two xbee S2C module for internal serial communication with help of XCTU software.

You can download software from below link,
https://www.digi.com/products/xbee-rf-solutions/xctu-software/xctu

Network types.

Co-ordinator: 
It is Master of network and required in every network. (Never go to sleep mode)
Router: 
It is intermediator, it could be multiple of them in single network with capabilities of internal
communication. (Never go to sleep mode)
End-point: 
End device, may exist multiple of them in network, it can go to sleep mode and ideal for battery operated device.

Command mode:
AT: It sends a command thru xbee with AT command mode Like GSM/GPS module. It is called transparent mode.
API (Application Programming Interface): It can send a command and receive command from xbee itself with set of binary protocol. Each of these frames starts with the 0x7E byte to indicate the start of the frame and contains a frame length, a checksum, a frame type, and extra type-specific data.

To start with XCTU software, Added xbee click on left top corner of XCTU software to add device in it.
Make sure you have connect xbee with computer first.




Click on update firmware for available updates

Select latest firmware and update Xbee first
Once you set with update computer code, we need one Xbee as co-ordinator and other as router to make inter communication.
For co-ordinator, you need to change three elements,

In network setting column,
1) ID Pan ID: Set/Read the ZigBee extended PAN ID
This can be any number but need to be same for all the devices to communicate in same network.
2) CE Co-ordinator enable
Set/read if this device is a coordinator (1) or not (0)


Addressing setting,
Please write destination Xbee address to define link between two of them.

1) DH Destination Address High:
It is known xbee address number written in SH format.
2) DL Destination Address Low:
it is known xbee address number written in SL format.
3) NI Node identifier
It could be any name to identify Xbee, in my case I mentioned as co-ordinator.
rest remains same in default mode.

Serial interfacing,
1) BD Baud rate:
Make sure you xbee talks in same speed by keeping baud rate same for all.
2) AP API Enable:
By changing this column, we can set xbee for API mode and AT mode, for serial communication you keep this in AT mode. (transparent mode)
Repeat same for Router by changing these values,
If process is done and Xbee sets properly, you will see R and C logo on Xbees. That is indication of Both Xbee are set for inter communication.


Now you are set for communication,
First open terminal window by clicking desktop icon on left top and connect device for communication.
Now write in any console log and you can check data is been transfer to other xbee device, Blue is sending code colour and red is received code colour.
Now connect Rx, Tx line of xbee to Tx, Rx line of Arduino for inter communication.



Comments

Popular Posts