zb_tcp_serial.py

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.

Anybody have any ideas?

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:

  1. Go to the Web UI of your CP-X2 > Configuration > XBee Network.
  2. Click on the extended address of the RS232 adapter.
  3. Near the bottom of the configuration page, click on “Advanced Settings”
  4. 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.
  5. 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.

Thanks for the reply

No joy yet.

Here’s the python page:

File Name Size
Python.zip 144321 bytes
zb_tcp_serial.py 2967 bytes
zb_tcp_serial.zip 361441 bytes
zigbee.py 1147 bytes
xbee_sensor.py 5860 bytes
_____________________________________________________
Here’s my XBee configuration now:

Node ID Network Address Extended Address Node Type
X2#1 [0000]! 00:13:a2:00:40:52:46:8c! end node
BB [fffe]! 00:13:a2:00:40:53:64:e0! end node

_________________________________________________________________________
The X2’s XBee (00:13:a2:00:40:52:46:8c!, firmware 0x10c8) advanced settings are:

CCA threshold (CA): 44 -dBm (36-80)
Operating channel (CH): 0xc (0xb-0x1a)
Coordinator association (A2): 0x0 bitfield (0x0-0x7)
Coordinator enable (CE): 0 (0-1)
Random delay slots (RN): 0 (0-3)
Node discovery timeout (NT): 25 x 100 msec (1-252)
Encryption enable (EE): 0 (0-1)
End device association (A1): 0x0 bitfield (0x0-0xf)
Link encryption key (KY): (0-16 bytes)
MAC mode (MM): (0-3) 0
Network address (MY): 0x0 (0x0-0xffff)
Node identifier (NI): X2#1 (0-20 chars)
PAN identifier (ID): 0x3332 (0x0-0xffff)
Transmit power level (PL): 4 (0-4)
Scan channels (SC): 0x1ffe bitfield (0x1-0xffff)
Scan duration (SD): 4 exponent (0-15)
Cyclic sleep period (SP): 0 x 10 msec (0-26800)
XBee retries (RR): 0 (0-6)
_________________________________________________________________________
Here are the Advanced Settings for the RS232 Module (00:13:a2:00:40:53:64:e0!, Firmware 0x10cd)

CCA threshold (CA): 44 -dBm (36-80)
Operating channel (CH): 0xc (0xb-0x1a)
Command sequence character (CC): + (char)
Command mode timeout (CT): 100 x 100 msec (2-65535)
Coordinator association (A2): 0x0 bitfield (0x0-0x7)
Coordinator enable (CE): 0 (0-1)
D0 output timeout (T0): 255 x 100 msec (0-255)
D1 output timeout (T1): 255 x 100 msec (0-255)
D2 output timeout (T2): 255 x 100 msec (0-255)
D3 output timeout (T3): 255 x 100 msec (0-255)
D4 output timeout (T4): 255 x 100 msec (0-255)
D5 output timeout (T5): 255 x 100 msec (0-255)
D6 output timeout (T6): 255 x 100 msec (0-255)
D7 output timeout (T7): 255 x 100 msec (0-255)
Random delay slots (RN): 0 (0-3)
Destination address (DH): 00:13:a2:00:40:52:46:8c! (address)
DIO5/Assoc configuration (D5): 1 (0-5)
DIO7 configuration (D7): 0 (0-7)
DIO change detect (IC): bitfield (0x0-0xff)
Node discovery timeout (NT): 25 x 100 msec (1-252)
Encryption enable (EE): 0 (0-1)
End device association (A1): 0x0 bitfield (0x0-0xf)
Guard times (GT): 1000 msec (2-3300)
I/O input address (IA): (address)
I/O output enable (IU): ff:ff:ff:ff:ff:ff:ff:ff! (0-1)
Link encryption key (KY): (0-16 bytes)
MAC mode (MM): 0 (0-3)
Network address (MY): 0xffff (0x0-0xffff)
Node identifier (NI): BB (0-20 chars)
Packetization timeout (RO): 0 chars (0-255)
PAN identifier (ID): 0x3332 (0x0-0xffff)
Transmit power level (PL): 4 (0-4)
PWM0 configuration (P0): 1 (0-1)
PWM0 output level (M0): 0 (0-1023)
PWM1 configuration (P1): 0 (0-2)
PWM1 output level (M1): 0 (0-1023)
PWM output timeout (PT): 0 x 100 msec (0-255)
RSSI PWM timer (RP): 255 x 100 msec (0-255)
I/O sample rate (IR): 40 msec (0-65535)
Scan channels (SC): 0 bitfield (0x1-0xffff)
Scan duration (SD): 0x1ffe 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): 1 (0-6

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?