Cannot get access to /dev/ttyACM0
Cannot get access to /dev/ttyACM0
I'm trying to program a Pico with Thonny. When I look in the interpreter list inside of Thonny I do not see the Pico as an option. After following some very helpful guides on the web I have learned that this is some kind of permissions thing. I've been able to get access to the Pico via the REPL and can turn an LED on and off. This confirms that the board is good and that I am using the correct port name. What I still cannot do is get Thonny to see the Pico. Does anyone have some advice they might share please? Thank you!
Re: Cannot get access to /dev/ttyACM0
If you add your user to the dialout group then you should have permissions:
After doing that you'll need to at least logout, perhaps reboot. Use the id command to verify that dialout appears in the list of groups.
Code: Select all
usermod -a -G dialout $USER
Re: Cannot get access to /dev/ttyACM0
Thank you for your reply. I've tried this with no success. I have logged out and back in to test. I have not completely rebooted and will give that a try to rule that out.
Re: Cannot get access to /dev/ttyACM0
OK, well apparently a complete reboot was required to get my user account added to the group. If I run the Id command as you recommended I get the following results.dhylands wrote: ↑Wed Mar 10, 2021 11:52 pmIf you add your user to the dialout group then you should have permissions:
After doing that you'll need to at least logout, perhaps reboot. Use the id command to verify that dialout appears in the list of groups.Code: Select all
usermod -a -G dialout $USER
uid=1000(garnold) gid=1000(garnold) groups=1000(garnold),4(adm),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare)
Still no luck seeing the Pico in Thonny. Again, I tested with the REPL and was able to get access.
Here is another link with some instructions but they are for Fedora. I do not know enough about Linux to start mixing and matching thing from different OS's. I just wanted to post this here because possibly someone with more knowledge then I could help me from what is being stated here. https://discussion.fedoraproject.org/t/ ... roup/24147
Re: Cannot get access to /dev/ttyACM0
Very sorry for all the posts. So I decided to give a NodeMCU a try. Flashed just fine and I was able to connect to it perfectly from Thonny. I picked the ESP8266 interpreter and the serial port was in the drop down list. Not sure what's up with the Pico. I was able to program it just fine when I was running a standard Mac OS on this Macbook Pro. Ubuntu seems to be making it tough on me?
- aivarannamaa
- Posts: 171
- Joined: Fri Sep 22, 2017 3:19 pm
- Location: Estonia
- Contact:
Re: Cannot get access to /dev/ttyACM0
@garnold, do I understand correctly that `/dev/ttyACM0` is present but Thonny simply doesn't see it?
Please select the default back-end in Thonny (button at the lower-right corner) and try following commands on the Python 3 REPL:
Tell me whether you get any ports, your PySerial version, Thonny version and how you installed Thonny (apt, pip, or downloading binary bundle)
Please select the default back-end in Thonny (button at the lower-right corner) and try following commands on the Python 3 REPL:
Code: Select all
Python 3.7.9 (bundled)
>>> import serial.tools.list_ports as lp
>>> lp.main()
/dev/ttyACM0
1 ports found
>>> serial.__version__
'3.5'
Aivar Annamaa
https://thonny.org
https://thonny.org
Re: Cannot get access to /dev/ttyACM0
After typing in your commands, here is the response.
Python 3.8.5 (/usr/bin/python3)
>>> import serial.tools.list_ports as lp
>>> lp.main()
/dev/ttyACM0
1 ports found
>>> serial.__version__
Traceback (most recent call last):
File "<pyshell>", line 1, in <module>
NameError: name 'serial' is not defined
>>>
I installed Thonny with apt. Does this information help? Thank you.
Python 3.8.5 (/usr/bin/python3)
>>> import serial.tools.list_ports as lp
>>> lp.main()
/dev/ttyACM0
1 ports found
>>> serial.__version__
Traceback (most recent call last):
File "<pyshell>", line 1, in <module>
NameError: name 'serial' is not defined
>>>
I installed Thonny with apt. Does this information help? Thank you.
Re: Cannot get access to /dev/ttyACM0
It seems as though Thonny does see this port but simply does not have the Raspberry Pi Pico in the interpreter list. See the attached image.
Re: Cannot get access to /dev/ttyACM0
Are you sure Thonny is up to date? The release on the repo is 3.2.7, currently on thonny.org the release is 3.3.6.
Maybe you can load the last release at thonny.org
Maybe you can load the last release at thonny.org
Last edited by fdufnews on Sun Mar 14, 2021 6:35 pm, edited 2 times in total.
- aivarannamaa
- Posts: 171
- Joined: Fri Sep 22, 2017 3:19 pm
- Location: Estonia
- Contact:
Re: Cannot get access to /dev/ttyACM0
From the screenshot I see that you have older Thonny, which doesn't know about Pico.
The "MicroPython (generic)" back-end together with the port it's showing, should work, though.
If you want newer Thonny, then you can `apt remove thonny` and install a Thonny+Python bundle with following command:
The "MicroPython (generic)" back-end together with the port it's showing, should work, though.
If you want newer Thonny, then you can `apt remove thonny` and install a Thonny+Python bundle with following command:
Code: Select all
bash <(wget -O - https://thonny.org/installer-for-linux)
Aivar Annamaa
https://thonny.org
https://thonny.org