colinoflynn / pico-python

PicoScope Python Interface
Other
97 stars 78 forks source link

Error opening a 5xxxD picoscope #198

Closed elechapt closed 5 months ago

elechapt commented 5 months ago

Problem : I'm using a new picoscope, that turned out to be a 5xxxD. By reading the programmers' guide, it is supposed to behave the same way as the 5xxxxA, except for a few things, including this error :

OSError : Error calling _lowLevelOpenUnit: PICO_USB3_0_DEVICE_NON_USB3_0_PORT (You must connect the device to a USB 3.0 port, or call ps4000aChangePowerSource to switch the device into non-USB 3.0-power mode)

That is thrown when trying to open the Picoscope.

Solution: After some search, I found that ps5000aOpenUnit returns a value indicating if another instruction has to be used (ps5000aChangePowerSource). It was not implemented in the picoscope package. I've changed that for the ps5000a lib (I can't test on another picoscope, because I don't have any other) and it works fine. I'll do a pull request for that.

hmaarrfk commented 5 months ago

is there a reason you can't use USB 3.0?

elechapt commented 5 months ago

Yes. I'm not the only one using the equipment. I'm the low-level guy making things for non-programmers && non-electronicians in the lab. I have to make sure things work no matter what, even if someone uses the wrong wire or another computer, so I handle the warnings for low datarates. And the picoscope is embedded in another device, no one is supposed to know what's inside the box. Those people know how to use the official "Picoscope 6" software, which handles the low datarate for USB2.

elechapt commented 5 months ago

Pull request accepted to fix the issue : Branch at that time : master (#199) Tag : 0.7.29