Open peterhinch opened 9 years ago
A further observation. This effect is PC/distro/timing dependent. On my laptop, if I start rshell and then plug in the pyboard, it initially reports that it is waiting for /dev/ttyACM0 and then throws the exception. On my desktop this scenario doesn't produce the fault which only occurs if I start rshell soon after plugging in the Pyboard.
@peterhinch If you're running linux, it would be interesting to see if usb-ser-mon.py behaves the same way. usb-ser-mon.py hooks in with udev to detect when serial ports come and go. https://github.com/dhylands/usb-ser-mon It needs pyudev to be installed.
I started usb-ser-mon with the Pyboard connected (it had been connected for some time) and it detected it. I then unplugged the Pyboard and plugged it back in again. This was the outcome of the sequence described.
$ ./usb-ser-mon.py
USB Serial device with vendor 'Micro_Python' serial '000000000011' connected @/dev/ttyACM0
Use Control-X to exit.
USB Serial device @/dev/ttyACM0 disconnected.
Waiting for USB Serial Device ...
USB Serial device with vendor 'Micro_Python' serial '000000000011' connected @/dev/ttyACM0
Use Control-X to exit.
Traceback (most recent call last):
File "./usb-ser-mon.py", line 293, in main
debug=args.debug, echo=args.echo)
File "./usb-ser-mon.py", line 148, in usb_serial_mon
log(data, end='')
File "./usb-ser-mon.py", line 28, in log
if str[-1] == '\r':
IndexError: string index out of range
[adminpete@axolotl]: ~/qnap/python/usb_ser_mon/usb-ser-mon
$
ok - I'll have to fix that - that looks like a logic error
This is arguably trivial, but if /dev/ttyACM0 has only just been instantiated when rshell is started the following occurs: