brianinnes / vPiP

A python library with accompanying Arduino code to drive a vertical plotter from a Raspberry Pi. This project is targeted to drive the driver board created by makeBournemouth, but will work with any system capable of running Python and connecting to an Arduino/Genuino to drive the stepper motors
https://github.com/brianinnes/vPiP/wiki
Apache License 2.0
16 stars 11 forks source link

Steppers are glitchy when setShowDrawing & setPlotting are both True #3

Closed MarkJB closed 7 years ago

MarkJB commented 8 years ago

Running test1.py with:

p.setShowDrawing(True)
#p.setSaveDrawing(True)
p.setPlotting(True)

or

#p.setShowDrawing(True)
p.setSaveDrawing(True)
p.setPlotting(True)

This doesn't happen if just have setPlotting true.

The steppers are stop start and there is lots of output on the console.

I captured some (below) and in doing so caused a keyboard interrupt (ctrl-c) and the output stopped and the steppers started working normally.

Step handler thread exception : <type 'exceptions.OSError'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 453, in read buf = os.read(self.fd, size-len(read)) Step handler thread exception : <type 'exceptions.OSError'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 453, in read buf = os.read(self.fd, size-len(read)) Step handler thread exception : <type 'exceptions.OSError'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 453, in read buf = os.read(self.fd, size-len(read)) Step handler thread exception : <type 'exceptions.OSError'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 453, in read buf = os.read(self.fd, size-len(read)) Step handler thread exception : <type 'exceptions.OSError'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 453, in read buf = os.read(self.fd, size-len(read)) Step handler thread exception : <type 'exceptions.OSError'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 453, in read buf = os.read(self.fd, size-len(read)) Step handler thread exception : <class 'serial.serialutil.SerialException'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 460, in read raise SerialException('device reports readiness to read but returned no data (device disconnected?)') Step handler thread exception : <class 'serial.serialutil.SerialException'> File "/home/pi/pycupi/python/Pylargraph/serialHandler.py", line 106, in _stepHandlerThread dataRead = self.serialPort.read()

If setPlotting() should never be true when setShowDrawing() or setSaveDrawing() are True - can this not be done automatically?

brianinnes commented 7 years ago

fixed with #13