I currently have my connectport x2d programmed to receive a frame and then reply to the sender of the frame. The x2 receives every packet completely fine and then supposedly replies to the sender but my sender never gets the frame. Here is my code:
import sys, os
from socket import *
# ConnectPort's address
addr = "0013a20040c042dd"
# Create the socket, datagram mode, proprietary transport:
sd = socket(AF_XBEE, SOCK_DGRAM, XBS_PROT_TRANSPORT)
# Bind to endpoint 0xe8 (232):
sd.bind(("", 0xe8, 0, 0))
# Block until a single frame is received, up to 72 bytes:
payload, src_addr = sd.recvfrom(8192)
# If packet was commission
# Send ConnectPort Address and current time
newPayload = addr + ";" + time.strftime("%Y-%m-%d %H:%M:%S")
print newPayload, src_addr
print sd.sendto(newPayload, 0, src_addr)
I followed the example xbee_echo.py then just added some logic.
The output of the code:
#> python dpdsrv.py
Launching Python application 'test.py' ...
('[00:13:a2:00:40:ac:6f:23]!', 232, 49413, 149, 194, 0)
Any help would be great. Thanks!