I am trying to send and receive radio signals using my Raspberry, but I am already stuck at the first step :)
My Radio module uses UART for communication but I have failed to set up my serial communication correctly. I found out Bluetooth is somehow interfering, so I disabled it. Now my program is at least able to step over read
and write
functions of my python script. Jippie :)
To test if UART works I connected Pin 14 and 15 (RX and TX) with each other and would now expect that when I send something, I will receive the same string?!? That should be right, shouldn't it?
But on the receiving end I never get something... readline()
return with no string.
I would be very very thankful if somebody could shed some light for me :) Or even a hint to a working tutorial. I already followed that tutorial: http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two but it didn't get me much further... :(
Btw.: I am using Raspbian Version May 2016 (2016-05-10).
Here's my sample code:
#!/usr/bin/env python
import serial
ser = serial.Serial(
port='/dev/ttyAMA0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
print "Serial is open: " + str(ser.isOpen())
print "Now Writing"
ser.write("This is a test")
print "Did write, now read"
x = ser.readline()
print "got '" + x + "'"
ser.close()
{}
button is for in the compose/edit interface. – goldilocks May 15 '16 at 17:25raspi-config
. – Georg May 15 '16 at 18:19