When I run zb_tcp_serial.py on my ConnectPort X2, I get a list of XBee nodes, and their associated port_number values.
I have a RS232 module XBIB-R-DEV Rev 4 with a null-modem and loopback plug attached.
When I use telnet to connect to this device, I get connected, and when I type, I see the RD/TD LEDs on the module blink appropriately. I would expect to see the characters I type echo back to me, due to the loopback connector, but nothing appears.
I used an IP sniffer to monitor the telnet packets to see if anything was being sent back via zb_tcp_serial.py. I see the outbound packets containing the characters I sent, and the acknowledgments from the server, but no return packets containing the looped-back characters.
If you’re doing this on an 802.15.4 ConnectPort X2 and RS232 adapter, you’ll need to set the RS232 adapter to unicast.
To find the 64-bit address of the radio embedded in your ConnectPort X2 gateway, go to the Web UI of the CP-X2, and open the Administration > System Information > XBee Network page. You’ll see the address of the radio within the CP-X2 listed as Gateway Address at the very top of that page, along with the PAN ID and channel the X2’s radio is using. Copy the extended address.
To setup your RS232 adapter for unicast:
Go to the Web UI of your CP-X2 > Configuration > XBee Network.
Click on the extended address of the RS232 adapter.
Near the bottom of the configuration page, click on “Advanced Settings”
Paste in the 64-bit address of the CP-X2’s embedded radio (see earlier paragraph) in the field " Destination address (DH)" and apply the setting.
Scroll down to the "Network address (MY) field, and change this to 0xffff, then apply that setting as well.
You should be able to receive your looped back data now.
Sorry, a cut-paste error on my post – from “Scan Channels” down, the information should read
Scan channels (SC): 0x1ffe bitfield (0x1-0xffff)
Scan duration (SD): 4 exponent (0-15)
Serial interface parity (NB): 1 (0-4)
Serial interface data rate (BD): 0 (0-115200)
Disassociated cyclic sleep period (DP): 1000 x 10 msec (0-26800)
Sleep mode (SM): 0 (0-5)
Sleep options (SO): 0x0 bitfield (0x0-0x1)
Cyclic sleep period (SP): 0 x 10 msec (0-26800)
Time before sleep (ST): 5000 msec (1-65535)
I/O samples before transmit (IT): 1 (1-255)
XBee retries (RR): 0 (0-6) _______________________________________________________________
Also, I noticed that on the network view the network address of the RS232 module is 0xfffe, not 0xffff, even though the advanced configuration page shows 0xffff. Any significance to this?