decoding-contour-next-link icon indicating copy to clipboard operation
decoding-contour-next-link copied to clipboard

Error running on Win 10 for first time.

Open formlinksystemslimited opened this issue 6 years ago • 9 comments

having completed the specified setup steps, when it comes to running the read_minimet_next24 I get the following message:

Python\Python37-32\lib\runpy.py:125: RuntimeWarning: 'decoding-contour-next-link.read_minimed_next24' found in sys.modules after import of package 'decoding-contour-next-link', but prior to execution of 'decoding-contour-next-link.read_minimed_next24'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) Traceback (most recent call last): File "C:\Users\steamatt\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\steamatt\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 1333, in downloadPumpSession(pumpDownload) File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 1227, in downloadPumpSession mt.openDevice() File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 759, in openDevice self.device.open( self.USB_VID, self.USB_PID ) File "hid.pyx", line 66, in hid.device.open OSError: open failed

Its running in an admin console I've checked the VID and PID are equal. The orange light on the Contour next link 2.4 flashes, but nothing happens.

I've increased the timeout on line 772 data = self.device.read( self.USB_BLOCKSIZE, timeout_ms = 10000 ) to be data = self.device.read( self.USB_BLOCKSIZE, timeout_ms = 100000 ) as I know that when submitting blood results it can take a while to transmit to the pump, but I get the same result.

Have I missed something?

Matt

formlinksystemslimited avatar Dec 18 '18 11:12 formlinksystemslimited

It baffles me that you get the "open failed" and still have the orange LED flashing. Does this happen in one and the same interaction session with the receiver (Contour NextLink) device?

mortlind avatar Dec 18 '18 11:12 mortlind

Sorry i'm not quite sure what you mean by the same interaction session with the receiver (Contour NextLink) device. I assume you mean when the receiver is operating.

having plugged the receiver into my computer and fired up a new admin command prompt, executing the script again i get:

python -m decoding-contour-next-link.read_minimed_next24 C:..\Local\Programs\Python\Python37-32\lib\runpy.py:125: RuntimeWarning: 'decoding-contour-next-link.read_minimed_next24' found in sys.modules after import of package 'decoding-contour-next-link', but prior to execution of 'decoding-contour-next-link.read_minimed_next24'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) 2018-12-18 14:06:51,489 WARNING [main] Timeout waiting for message 2018-12-18 14:06:51,518 ERROR [main] ### checkControlMessage: Expected to get an 0x5 control character, got message with length 295 and control char 0x127 Traceback (most recent call last): File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 807, in getDeviceInfo msg = self.readMessage() File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 783, in readMessage raise TimeoutException( 'Timeout waiting for message' ) main.TimeoutException: Timeout waiting for message

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:..\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:..\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 1333, in downloadPumpSession(pumpDownload) File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 1229, in downloadPumpSession mt.getDeviceInfo() File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 819, in getDeviceInfo self.checkControlMessage( ascii['ENQ'] ) File "C:\repo\personal\decoding-contour-next-link\read_minimed_next24.py", line 826, in checkControlMessage raise RuntimeError( 'Expected to get an 0x{0:x} control character, got message with length {1} and control char 0x{1:x}'.format( controlChar, len( msg ), msg[0] ) ) RuntimeError: Expected to get an 0x5 control character, got message with length 295 and control char 0x127

The light flashes 3 times before timing out.

Matt

formlinksystemslimited avatar Dec 18 '18 14:12 formlinksystemslimited

Alternatively the flashing light could be the charging light no the basis that its still flashing and the script is longer running..

formlinksystemslimited avatar Dec 18 '18 14:12 formlinksystemslimited

By a session, i mean operating the device, though one session can be composed of several operations. The point is, that each session opens the HID-device, and if it fails to open, no operation will be running, and thus the LED should not flash. I am not certain though.

I also once in a while get the "open failed" as well as a variety of other communication errors, like the one you show above. Do you never get a successful operation?

mortlind avatar Dec 18 '18 15:12 mortlind

This is the first time I've been able to deploy all the pre-req's on a laptop and get the received connected to it. I've tried a number of times today, but end up with the 2 outcomes above. I've never had a successful opening or any data returned by running the script.

so in terms of sessions - I've plugged in the reader, open command prompt as admin, run the script, 2 or 3 times adjusted the timeout as mentioned earlier, tried again, then posted here.. The second time around I repeated the cycle one time to validate the error message..

formlinksystemslimited avatar Dec 18 '18 16:12 formlinksystemslimited

I fear that I can not be of much help here. I have gotten to the level of using the library, which works well for me, but I am not too deep into it. Does the receiver work well otherwise? Does it connect to the pump, and can you send calibration BGs and remotely administer bolus'es?

One thought about the USB power: When I use the receiver from my laptop, I rarely get failure on opening or communication errors during operations. However, when I use the receiver from a Raspberry Pi, the frequency of errors increases. I have always thought that this was about USB power; i.e. how much current the different USB ports can provide. You should try a different port on your laptop, try a different laptop, and finally try using a powered USB hub.

mortlind avatar Dec 18 '18 16:12 mortlind

@formlinksystemslimited Does it work okay in CareLink personal?

pazaan avatar Dec 18 '18 23:12 pazaan

Yes it works ok with carelink on the same machine, without needing externally powered usb hubs.

formlinksystemslimited avatar Dec 19 '18 06:12 formlinksystemslimited

It looks like the HID module is not working properly on your machine. Unfortunately I don't have a 32-bit Python installation on Windows to troubleshoot this.

pazaan avatar Dec 19 '18 07:12 pazaan