Raw API Frames over Ethernet to the ConnectPort X2

I’ trying to transfer raw API frames via TCP/UDP to the CPX2, as described here: http://www.digi.com/wiki/developer/index.php/Raw_API_Over_Ethernet_to_CPX2

The firmware in CPX2 is version (82001631_D1 11/21/2008).

Can somebody tell me what port to connect to (a portscan revealed nothing…) or what configuration is required on the CPX2 for this to work?
Is there any documentation on the subject?


Ok, I made some progress.
With firmware there’s an option under Configuration->XBee network->Gateway access->Enable serial access to the gateway radio
After enabling it and rebooting the CPX2, there’s a new option under Configuration->Serial ports->Port 1
When clicked on Port 1, one can change the port profile settings to TCP sockets (or realport/UDP sockets/custom).
Choosing TCP sockets, Configuration->Serial ports->Port 1 now shows some TCP server settings:
[li] Enable Telnet access using TCP Port: 2001
[/li][li] Enable Raw TCP access using TCP Port: 2101
[/li][li] Enable Secure Shell (SSH) access using TCP Port: 2501
[/li][li] Enable Secure Socket access using TCP Port: 2601
So at least the port numbers are known now :wink:
Telnetting to 2001 or 2101 gives a connection, but the XBee in the CPX2 doesn’t seem to reply to commands sent to it (both API or AT commands).
The serial port diagnostics (Administration->System information->Serial->Port 1) shows bytes coming in and going out, but I don’t get a response on the TCP connection.

Anyone know the difference between telnet access and raw TCP access?

There are some more serial/TCP settings that can be played with, I’ll keep you informed!

Try setting the baud rate of your application to 115,200. Also, “Serial Access” is an API interface, so any data sent to that serial interface will need to be in API packet form (i.e. “raw” AT commands won’t work).

Regarding telnet vs. raw access, telnet does interpretation of the datastream, whereas raw just passes it through.

Try setting the baud rate of your application to 115,200.

Ah! That seems to do the trick!

Now I can send simple query commands (e.g. request firmware version/PAN ID etc.) and the CPX2 immediately responds!

The node discovery command ‘ND’ however doesn’t seem to get a response…

Any ideas?

Keep in mind that serial interface is still an API interface, so your ND command will need to be formatted into an API packet, and your application will need to understand the reply. If these conditions have been met I’m not sure why your ND command didn’t get any response, unless there were no other modules seen from the module you ran the command from.

ConnectPort gateways are always configured at 115200 baud in API mode.