Cannot read data using "recvfrom"


I just started with Xbee world, and need your help on this problem. I have a Connectport X4 DM 900, and an Xbee module DP 900. I installed DM firmware on the Xbee module and tried to send api packets to the gateway. When I use command “set trace state=on mask=xbee:*” in a Terminal, I can see the data flows like this:

1704425:xbee:DEBG: 0: 7e 00 1c 92 00 13 a2 00 40 9a 1b 8e ff fe 01 01 ~…@…
1704425:xbee:DEBG: 10: 00 00 3f 13 ff 02 ff 06 ff 02 ff 01 ff 03 ff eb …?..
1704509:xbee:DEBG: 0: 7e 00 1c 92 00 13 a2 00 40 9a 1b 8e ff fe 01 01 ~…@…
1704509:xbee:DEBG: 10: 00 00 3f 01 ff 02 ff 03 ff 03 ff 01 ff 03 ff eb …?..

I opened another terminal and run sample codes in, everything was fine until it reached command “data, addr = zig_sock.recvfrom(255)”, and it seemed to hang forever, even though at that time I can still see the data flows in the other terminal window.

Could you please tell me why?

Thank you

Use the code with Try and Except cluse and print the error. It tells what is wrong with the recv()

Take a look at how you bound the socket, DigiMesh requires either an endpoint of 0xe8 at 2.4ghz or 0x00 at 900mhz.