I used to use the RPi 2b and had no problems with my Xbee codes but this new RPi3 is killing me. I can not read from my XBee model S2 Pro anymore.
Following instructions from other forums I have changed the TTY to S0 with
SERIALPORT = '/dev/ttyS0'
I have changed the UART in /boot to:
and in rasps-config I have enabled the login shell on serial. My simply code is as follows:
import serial, time, datetime, sys from xbee import XBee #from xbee import ZigBee #import subprocess #import pprint #import MySQLdb #import chat SERIALPORT = '/dev/ttyS0' BAUDRATE = 9600 ser = serial.Serial(SERIALPORT, BAUDRATE) xbee = XBee(ser) print 'Starting Up XBee Monitor' # Continuously read and print packets while True: try: response = xbee.wait_read_frame() print response except KeyboardInterrupt: break ser.close()
An so my error is also as follows:
Starting Up XBee Monitor Traceback (most recent call last): File "wetter.py", line 21, in <module> response = xbee.wait_read_frame() File "/usr/local/lib/python2.7/dist-packages/xbee/base.py", line 412, in wait_read_frame frame = self._wait_for_frame() File "/usr/local/lib/python2.7/dist-packages/xbee/base.py", line 130, in _wait_for_frame if self.serial.inWaiting() == 0: File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 518, in inWaiting return self.in_waiting File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 433, in in_waiting s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str) IOError: [Errno 5] Input/output error
I am simply not having any luck with this. I am using Jessie Lite and Python 3. Does anyone have any other ideas?