msoon / PyMonsoon

Monsoon Power Monitor Python Library
MIT License
55 stars 23 forks source link

I disconnected power consumption on linux and found an error.I disconnected power consumption on linux and found an error. #26

Open lycfr opened 6 years ago

lycfr commented 6 years ago

Traceback (most recent call last): File "StopCollection.py", line 11, in stop() File "StopCollection.py", line 6, in stop Mon.setup_usb() File "/usr/local/lib/python3.4/dist-packages/Monsoon/HVPM.py", line 39, in setup_usb Protocol.Connect(op.HardwareModel.HVPM,serialno) File "/usr/local/lib/python3.4/dist-packages/Monsoon/pmapi.py", line 65, in Connect self.DEVICE.set_configuration() File "/usr/local/lib/python3.4/dist-packages/usb/core.py", line 869, in set_configuration self._ctx.managed_set_configuration(self, configuration) File "/usr/local/lib/python3.4/dist-packages/usb/core.py", line 102, in wrapper return f(self, *args, **kwargs) File "/usr/local/lib/python3.4/dist-packages/usb/core.py", line 148, in managed_set_configuration self.backend.set_configuration(self.handle, cfg.bConfigurationValue) File "/usr/local/lib/python3.4/dist-packages/usb/backend/libusb1.py", line 794, in set_configuration _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value)) File "/usr/local/lib/python3.4/dist-packages/usb/backend/libusb1.py", line 595, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 16] Resource busy

lycfr commented 6 years ago

import Monsoon.HVPM as HVPM import Monsoon.sampleEngine as sampleEngine

def stop(): Mon = HVPM.Monsoon() Mon.setup_usb() engine = sampleEngine.SampleEngine(Mon) engine.periodicStopSampling()

if name == 'main': stop()

lycfr commented 6 years ago

I am a script capture, a script stops collecting