Pyboard.py raw repl bug

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
zaord
Posts: 53
Joined: Fri Jan 31, 2020 3:56 pm

Pyboard.py raw repl bug

Post by zaord » Fri Dec 11, 2020 11:46 am

Hi,
I am playing with raw repl, and this is a so good tool.
But if I run two time this file :

Code: Select all

import sys
from rshell import main
from rshell import pyboard

pyb = pyboard.Pyboard('COM4')

pyb.enter_raw_repl()
sys.stdout.write(pyb.exec("print(1+1)"))
pyb.exit_raw_repl()
I get a error : raise PyboardError('failed to access ' + device)

PyboardError: failed to access COM4

if I run twice the script.
I need to reset the Pyboard to have the script running right again.

Any information about this ?

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

Re: Pyboard.py raw repl bug

Post by jimmo » Sun Jan 10, 2021 11:21 pm

zaord wrote:
Fri Dec 11, 2020 11:46 am
I need to reset the Pyboard to have the script running right again.
I wonder if you need to explicitly close the connection at the end of the script?

Code: Select all

pyb.close()
(I would have assumed Windows would do this for you on termination, but worth trying)

zaord
Posts: 53
Joined: Fri Jan 31, 2020 3:56 pm

Re: Pyboard.py raw repl bug

Post by zaord » Thu Jan 21, 2021 12:08 pm

this works !

Post Reply