[SOLVED] can't connect to REPL

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
vince
Posts: 15
Joined: Wed May 06, 2020 9:23 am

[SOLVED] can't connect to REPL

Post by vince » Fri Jul 17, 2020 12:39 pm

Hello everybody,

unfortunately I can't connect to REPL.
(my user is already in uucp and dialout groups)

if I try picocom /dev/ttyACM0, I get:

Code: Select all

picocom v2.2

port is        : /dev/ttyACM0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Type [C-a] [C-h] to see available commands

Terminal ready

*EMRDY: 1
an that's it. No REPL.

Did I miss something?

Thank you in advance!
All the best,

Vince
Last edited by vince on Mon Aug 31, 2020 12:47 pm, edited 1 time in total.

Online
User avatar
Roberthh
Posts: 2185
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: can't connect to REPL

Post by Roberthh » Fri Jul 17, 2020 1:03 pm

I use the baud rate 115200, but for the ACM0 device it may not matter.

User avatar
aivarannamaa
Posts: 74
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: can't connect to REPL

Post by aivarannamaa » Fri Jul 17, 2020 1:52 pm

Did you try any of following:

* ENTER
* Ctrl+B
* Ctrl+C

?
Aivar Annamaa
https://thonny.org

vince
Posts: 15
Joined: Wed May 06, 2020 9:23 am

Re: can't connect to REPL

Post by vince » Fri Jul 17, 2020 2:25 pm

I don't know how I did it, but now it works. :shock: :?:

What I do know:

Code: Select all

sudo picocom /dev/ttyACM0
then when "Terminal ready" is showing, press Enter several time to access to REPL.

Maybe it is the sudo and the many Enter press...

Online
User avatar
Roberthh
Posts: 2185
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: can't connect to REPL

Post by Roberthh » Fri Jul 17, 2020 2:33 pm

I guess it is the sudo. Try adding your user name to the 'dialout' group. Then it should work without sudo.

sudo usermod -a -G dialout <your_user_name>

User avatar
dhylands
Posts: 3467
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: can't connect to REPL

Post by dhylands » Fri Jul 17, 2020 3:08 pm

Note that you need to logoff and log back in again (or reboot) after changing groups.

You can use the id command to confirm your group membership.

User avatar
jimmo
Posts: 1938
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: can't connect to REPL

Post by jimmo » Mon Jul 20, 2020 4:35 am

Rather than guessing which group (dialout, uucp, etc), just check. For me it's uucp:

Code: Select all

$ ls -la /dev/ttyACM0 
crw-rw---- 1 root uucp 166, 0 Jul 20 13:55 /dev/ttyACM0

vince
Posts: 15
Joined: Wed May 06, 2020 9:23 am

Re: can't connect to REPL

Post by vince » Thu Aug 27, 2020 3:22 pm

Hi everyone,

now I still have the same problem again... (I don't know how I solved it last time and I don't know how it came back).
I'm in the dialout group, so everything should work actually.

If I start picocom WITHOUT sudo, I get:

Code: Select all

FATAL: cannot open /dev/ttyACM0: Device or resource busy
Any hint? :idea:

here my group(s):

Code: Select all

ls -la /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Aug 27 17:18 /dev/ttyACM0

Online
User avatar
Roberthh
Posts: 2185
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: can't connect to REPL

Post by Roberthh » Thu Aug 27, 2020 3:39 pm

You can try accessing as sudo, or you have to add yourself as user to the dialout group.
There might also be another process still using the device.

vince
Posts: 15
Joined: Wed May 06, 2020 9:23 am

Re: can't connect to REPL

Post by vince » Thu Aug 27, 2020 3:44 pm

Well, with sudo I don't get the error message, but I can't access to the REPL neither...
And I am in the dialout group.

:arrow: How can I figure out which process is using the device, and how to stop it?

Thanks in advance,

Vince

Post Reply