Home/Support/Support Forum/XBEE S6 TCP connection with Python
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

XBEE S6 TCP connection with Python

0 votes
I'm trying to connect Xbee S6 with Raspberry Pi & Python socket client. Xbee is not connected to processor/serial device. Only one sensor is conected to Xbee. I want check the state of this sensor with AT IS -command (transparent mode, serial communication service). When I'm trying to enter into the AT-command mode, Xbee closes the connection (socket.error: [Errno 104] Connection reset by peer). Why?

Code:

#!/usr/bin/env python

import socket
import time

TCP_IP = '192.168.0.106'
TCP_PORT = 9750
BUFFER_SIZE = 1024
MESSAGE = "+++"
delay = 1

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))

time.sleep(delay)
s.send(MESSAGE)
time.sleep(delay)

data = s.recv(BUFFER_SIZE)
s.close()
asked Sep 21, 2014 in Python by chrisrose New to the Community (0 points)

Please log in or register to answer this question.

...