Why does my REPL session always have this output

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.
Post Reply
rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

Why does my REPL session always have this output

Post by rhubarbdog » Wed Mar 27, 2019 10:24 am

When a program terminates and I have a serial terminal open why do I always have this output. I have other micropython devices they just print Micropython version details and the >>> prompt.

Code: Select all

Type "help()" for more information.
>>> AT^SQPORT?
Traceback (most recent call last):
  File "<stdin>", line 1
SyntaxError: invalid syntax
>>> AT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'AT' isn't defined
>>> AT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'AT' isn't defined
>>> AT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'AT' isn't defined
>>> ~x~~x~

ThomasChr
Posts: 121
Joined: Sat Nov 25, 2017 7:50 am

Re: Why does my REPL session always have this output

Post by ThomasChr » Wed Mar 27, 2019 10:31 am

Does ist also loose characters if you type? Then I also have this problem... resetting and reconneting a few times helps.
As to the cause: I have no idea!

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

Re: Why does my REPL session always have this output

Post by Roberthh » Wed Mar 27, 2019 10:44 am

That's most likely the modem manager on your PC, which tries to activate what it takes as a modem. Please deactivate or better deinstall the modem manager.

kapoira
Posts: 5
Joined: Sun Mar 17, 2019 12:29 pm

Re: Why does my REPL session always have this output

Post by kapoira » Wed Mar 27, 2019 11:52 am

it happens to my with linux in fedora 30

but i think i have only see it, in micropython 1.10, in micropython 1.8 i don't remember it, (perhaps it's my memory, or that i was using fedora 25/26)

ThomasChr
Posts: 121
Joined: Sat Nov 25, 2017 7:50 am

Re: Why does my REPL session always have this output

Post by ThomasChr » Wed Mar 27, 2019 1:02 pm

@Roberthh: Thats a great tip. Yes, sounds like something is trying to access the port and modem manager is very plausible. Will check that. Thanks a lot!

cefn
Posts: 230
Joined: Tue Aug 09, 2016 10:58 am

Re: Why does my REPL session always have this output

Post by cefn » Thu Mar 28, 2019 5:36 pm

See https://github.com/adafruit/circuitpython/issues/611 for a bit more detail and workarounds, at least for Debian-based and Ubuntu-based Linuxes.

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

Re: Why does my REPL session always have this output

Post by dhylands » Thu Mar 28, 2019 6:03 pm

Another source of mysterious AT sequences can happen when you use minicom. Some versions may send out init or reset sequences (minicom thinks its talking with a modem) which will confuse Micropython. It's possible to configure your setup to not send these.

I prefer to use picocom over minicom as I find picocom is much easier to get up and running.

cefn
Posts: 230
Joined: Tue Aug 09, 2016 10:58 am

Re: Why does my REPL session always have this output

Post by cefn » Thu Mar 28, 2019 8:44 pm

Potentially could use 'vanguard shell' to connect.

It wraps pyserial's miniterm with a micropython-specific terminal configuration and has never spoken to a modem in its life :)

https://pypi.org/project/vgkits-vanguard/

Post Reply