Page 1 of 1

Pyboard.py raw repl bug

Posted: Fri Dec 11, 2020 11:46 am
by zaord
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 ?

Re: Pyboard.py raw repl bug

Posted: Sun Jan 10, 2021 11:21 pm
by jimmo
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)

Re: Pyboard.py raw repl bug

Posted: Thu Jan 21, 2021 12:08 pm
by zaord
this works !