Tested on C-863-11 controller, with firmware 11.0.1.3.0,
If no serial number is detected (maybe after a firmware update), then getdevinfo() function in the piusb.py module fails to regexp.
I suggest to change
try:
return re.sub('[^a-zA-Z0-9-_*. ]', '', usb.util.get_string(dev, stringid))
except ValueError:
PIError('probably you do not have permission to access USB descriptors')
raise
with
try:
try:
return re.sub('[^a-zA-Z0-9-_*. ]', '', usb.util.get_string(dev, stringid))
except:
return usb.util.get_string(dev, stringid)
except ValueError:
PIError('probably you do not have permission to access USB descriptors')
raise
so it can take None as serialnumber.
However, the example:
from pipython.pidevice.gcscommands import GCSCommands
from pipython.pidevice.gcsmessages import GCSMessages
from pipython.pidevice.interfaces.piusb import PIUSB
with PIUSB() as gateway:
print(gateway.enumerate())
gateway.connect(serialnumber=None, pid=0x1007)
messages = GCSMessages(gateway)
pidevice = GCSCommands(messages)
print(pidevice.qIDN())
get stuck on the self.flush() method on connect.
The same controller works with the PISerial interface if the ftdi_sio kernel module is loaded.
Thank you for the detailed description of the issue. We will look into this as soon as possible and will let you know when an update of PIPython is available.
Tested on C-863-11 controller, with firmware 11.0.1.3.0,
If no serial number is detected (maybe after a firmware update), then
getdevinfo()
function in thepiusb.py
module fails to regexp.I suggest to change
with
so it can take None as
serialnumber
.However, the example:
get stuck on the
self.flush()
method on connect.The same controller works with the
PISerial
interface if theftdi_sio
kernel module is loaded.