Code: Select all
import serial
port = serial.Serial("/dev/ttyAMA0", baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=3.0)
I am a complete newbie to python by the way.
Code: Select all
import serial
port = serial.Serial("/dev/ttyAMA0", baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=3.0)
You need to log out and log back in for user permission changes to take effect.boylesg wrote:Still get permission denied.
Do you need to restart the Pi or something for the change to take effect?
Pi 2 B+ I think it is.bensimmo wrote:Is it not serial0 now, especially if using the Pi3?
Would the Bluetooth deny access to ttyAMA0 ?
Of course it could be the other Pi's?
I never had to alter any groups (but I am 'pi') to get serial working.
crw--w---- 1 root tty 204, 64 Jul 3 23:48 /dev/ttyAMA0joan wrote:You need to log out and log back in for user permission changes to take effect.boylesg wrote:Still get permission denied.
Do you need to restart the Pi or something for the change to take effect?
If it doesn't work could you say what ls -l /dev/ttyAMA0 reports?
That's an ugly temporary hack. Add user pi to the tty group or your program will break next time you reboot your RPi.boylesg wrote:sudo chown pi:pi /dev/ttyACM0
This did the trick.
'sudo adduser pi dialout' does nothing to solve the problem in python.DougieLawson wrote:That's an ugly temporary hack. Add user pi to the tty group or your program will break next time you reboot your RPi.boylesg wrote:sudo chown pi:pi /dev/ttyACM0
This did the trick.
Option g is ambiguous (gecos, gid, group)DougieLawson wrote:How about sudo adduser -G tty pi ? Or you've got to write a udev rule to change the ownership every time you reboot.
Found the above except there no such file as /etc/inittab on my pi.Raspberry Pi Serial GPIO Configuration
0. if you have not seen my article on how to remote access your Raspberry Pi, take a look here:
https://oscarliang.com/setup-raspberry- ... te-access/
1. In order to use the Raspberry Pi’s serial port, we need to disable getty (the program that displays login screen) by find this line in file /etc/inittab
Try...boylesg wrote:I have my arduino uno connected to my pi tx/rx pins on the pi and D5 and D6 on the uno.
I am using SoftwareSerial on the Uno. I seem to be getting a bit of garbage in ArduinIDE serial monitor. I am wondering if software serial on the UNO is a problem for the Pi - I was reading some where that software serial on the Pi is not possible because it is not a real time operating system.
All I want to do at this stage is write some text to the serial port in Python and then see that text in the ArduinoIDE serial monitor.
I am getting a serial write exception Errno 5 in python though.
But I am getting a rapsberry pi password request (as well as the garbage) in the arduino serial monitor.
WTF is going on here?
Actually what had happened here is that I disabled login over serial in raspi-config which apparently also disables the UART serial port as well.boylesg wrote:Don't know how but it appears my serial port has renamed from ttyAMA0 to tty0.
And I still get permission denied when I try to open it in python.
Any further suggestions.