serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied:...
up vote
0
down vote
favorite
I have a Raspberry that I am trying to connect to a Ubidots IOT cloud but I got this error:
pi@raspberrypi:~/Downloads/raspbiDaniela/Ver 2016/ZonrProject $ python main.py
Traceback (most recent call last):
File "main.py", line 124, in <module>
main()
File "main.py", line 21, in main
ser = serial.Serial(port=port, baudrate=baud)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'
python raspberry-pi serial-port raspbian pyserial
New contributor
add a comment |
up vote
0
down vote
favorite
I have a Raspberry that I am trying to connect to a Ubidots IOT cloud but I got this error:
pi@raspberrypi:~/Downloads/raspbiDaniela/Ver 2016/ZonrProject $ python main.py
Traceback (most recent call last):
File "main.py", line 124, in <module>
main()
File "main.py", line 21, in main
ser = serial.Serial(port=port, baudrate=baud)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'
python raspberry-pi serial-port raspbian pyserial
New contributor
1
run with sudo ?
– themadmax
Nov 19 at 13:39
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Raspberry that I am trying to connect to a Ubidots IOT cloud but I got this error:
pi@raspberrypi:~/Downloads/raspbiDaniela/Ver 2016/ZonrProject $ python main.py
Traceback (most recent call last):
File "main.py", line 124, in <module>
main()
File "main.py", line 21, in main
ser = serial.Serial(port=port, baudrate=baud)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'
python raspberry-pi serial-port raspbian pyserial
New contributor
I have a Raspberry that I am trying to connect to a Ubidots IOT cloud but I got this error:
pi@raspberrypi:~/Downloads/raspbiDaniela/Ver 2016/ZonrProject $ python main.py
Traceback (most recent call last):
File "main.py", line 124, in <module>
main()
File "main.py", line 21, in main
ser = serial.Serial(port=port, baudrate=baud)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'
python raspberry-pi serial-port raspbian pyserial
python raspberry-pi serial-port raspbian pyserial
New contributor
New contributor
edited Nov 19 at 15:23
machnic
526415
526415
New contributor
asked Nov 19 at 13:23
adi epsicom
32
32
New contributor
New contributor
1
run with sudo ?
– themadmax
Nov 19 at 13:39
add a comment |
1
run with sudo ?
– themadmax
Nov 19 at 13:39
1
1
run with sudo ?
– themadmax
Nov 19 at 13:39
run with sudo ?
– themadmax
Nov 19 at 13:39
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
You don't need to run the script every time with sudo as suggested in the comments but you need to make sure that you have read/write permissions for /dev/ttyAMA0
. You can modify the permisions using:
sudo chmod 666 /dev/ttyAMA0
If the device is detachable, you may also consider creating an udev
rule which will apply correct permissions each time you connect it. You can read more about udev
rules at Debian's wiki.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
You don't need to run the script every time with sudo as suggested in the comments but you need to make sure that you have read/write permissions for /dev/ttyAMA0
. You can modify the permisions using:
sudo chmod 666 /dev/ttyAMA0
If the device is detachable, you may also consider creating an udev
rule which will apply correct permissions each time you connect it. You can read more about udev
rules at Debian's wiki.
add a comment |
up vote
0
down vote
accepted
You don't need to run the script every time with sudo as suggested in the comments but you need to make sure that you have read/write permissions for /dev/ttyAMA0
. You can modify the permisions using:
sudo chmod 666 /dev/ttyAMA0
If the device is detachable, you may also consider creating an udev
rule which will apply correct permissions each time you connect it. You can read more about udev
rules at Debian's wiki.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
You don't need to run the script every time with sudo as suggested in the comments but you need to make sure that you have read/write permissions for /dev/ttyAMA0
. You can modify the permisions using:
sudo chmod 666 /dev/ttyAMA0
If the device is detachable, you may also consider creating an udev
rule which will apply correct permissions each time you connect it. You can read more about udev
rules at Debian's wiki.
You don't need to run the script every time with sudo as suggested in the comments but you need to make sure that you have read/write permissions for /dev/ttyAMA0
. You can modify the permisions using:
sudo chmod 666 /dev/ttyAMA0
If the device is detachable, you may also consider creating an udev
rule which will apply correct permissions each time you connect it. You can read more about udev
rules at Debian's wiki.
answered Nov 19 at 15:03
machnic
526415
526415
add a comment |
add a comment |
adi epsicom is a new contributor. Be nice, and check out our Code of Conduct.
adi epsicom is a new contributor. Be nice, and check out our Code of Conduct.
adi epsicom is a new contributor. Be nice, and check out our Code of Conduct.
adi epsicom is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375587%2fserial-serialutil-serialexception-could-not-open-port-dev-ttyama0-errno-13%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
run with sudo ?
– themadmax
Nov 19 at 13:39