I have a problem with using the UART on RPi2.
I tried every program found on the internet but nothing works. I checked every baud rate of my two BT modules but whatever code I use I've got errors like this:
Error 1:
Traceback (most recent call last): File "Serial2.py", line 6, in
<module>
serial_line = ser.readline() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 449, in
read
buf = os.read(self.fd, size-len(read)) OSError: [Errno 11] Resource temporarily unavailable
Error 2:
Traceback (most recent call last):
File "Serial2.py", line 6, in <module>
serial_line = ser.readline()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 449, in read
buf = os.read(self.fd, size-len(read))
OSError: [Errno 11] Resource temporarily unavailable
Error 3:
Traceback (most recent call last): File "Serial.py", line 7, in
<module>
rcv = port.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 456, in
read
raise SerialException('device reports readiness to read but returned no data (device disconnected?)')
serial.serialutil.SerialException: device reports readiness to read
but returned no data (device disconnected?)
Err1 code:
import serial
port = serial.Serial("/dev/ttyAMA0", baudrate=115200, timeout=3.0)
while True:
port.write("\r\nSay something:")
rcv = port.read()
port.write("\r\nYou sent:" + rcv)
Err2&3 code:
import serial, time
ser = serial.Serial('/dev/ttyAMA0', 9600)
while 1:
serial_line = ser.readline()
print(serial_line)
time.sleep(300)
ser.close()
I'm using ArduinoRC app (Terminal) to send data.
Would you help me and/or send a link to a good command list please ?