Configuring Wifi Xbee (S6B)
This tutorial will help to setup Xbee SB6 or other wifi Xbee to work with the transmitted data using a client.
Considering the lack of documentation and code support for Xbee S6B,
this would be a good template for general usage. Using Xbee wifi modules to communicate to a computer using python, also to gather and use the data in general. The code included with this project is tested on Xbee S6B, but should work on most raw feed wifi hardware, including other wifi Xbee models.
Hardware:
In this test, the Xbee S6B is connected to the (Rx,Tx) serial of a Arduino. The Xbee transmits user defined data printed to the serial, this data is read by a client connecting to the Xbee, using the code included. The Xbee is configured in SoftAp mode.The IP address, socket,ssid and other parameters of the Xbee may be changed by using the XCTU software.
Lets begin
Hardware Setup
First, connect the Xbee to the computer to set it for operation. You may do this in different ways. Two of which,are the following :
1>Use Arduino to program the Xbee
2>Use a Adapter Board
1>
Procedure:
Using an Arduino, program it with a default blank sketch. Should be similar to this.
void setup() {
}
void loop() {
}
Note: In some older Arduinos, having the RX and TX port connected while programming the Arduino, may result in errors. In that case, please disconnect the RX and TX pins of the Arduino, program it and then reconnect them after programming.
download the latest version of XCTU software and install.
Connect RX(pin 0) and TX(pin 1) pins on the Arduino to the RX(pin 3) and TX (pin 2)of the Xbee.(Opposite)
Connect the Arduino to USB port on the computer.
Execute XCTU, locate your Arduino COM port and read the Xbee.
2>
Procedure:
Plug Xbee to the adapter.
Connect the adapter to the computer.
Execute XCTU, locate your COM port and read the Xbee.
.
Xbee Configuration
Change these values to your specifications:
Mode = SoftAP
Destination IP: IP of your computer.
Module IP: IP of your Xbee.
Destination port (Port for computer) = Source port (Port for Xbee) (both should be same)
Gateway IP: (should be same on both Xbee and computer)
SSID: Name of your Xbee Broadcast.
Save these settings.
Computer Network Config
On your computer ,
Go to control panel>Network>Xbeessid>Properties.>TPC/IPv4>Properties
change your IP to Destination IP on Xbee.
change your gateway to Gateway IP on Xbee.
Connect to Xbee AP
Search the wifi on your computer , connect to the Xbee ssid .
Once connected ,
go the the following link and download the .py file .
https://github.com/Serpent999/Xbee-S6B-Wifi-Commun...
Download the .py file. If you do not have socket module for python , please download and install that.
Replace the IP with the IP of your Xbee and port with the port of your Xbee. The port is in HEX in XCTU, convert it in decimal , then input that in the code. Program the Arduino to print to the serial.
Connect RX(pin 0) and TX(pin 1) pins on the Arduino to the TX(pin 2) and RX (pin 3)of the Xbee. (Normal)
Run the code. you will find the data printed on the python GUI. The connection will take a while to initialize , please wait for a minute or two. This template is generic and the data can be then operated specifically.