Need help to fix the Error: OSError: Unable to communicate with found ChipWhisperer. Check that another process isn't connected to it and that you have permission to communicate with it

when I execute the code an error pops up saying it is unable to communicate with found chipwhisperer.
The code:
PLATFORM=“NOTHING”
%run Setup_Scripts/Setup_Generic.ipynb

The Error code:

NameError Traceback (most recent call last)
File ~\AppData\Local\Temp\ipykernel_17192\2799263322.py:4
3 try:
----> 4 if not scope.connectStatus:
5 scope.con()

NameError: name ‘scope’ is not defined

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
File ~\AppData\Local\Temp\ipykernel_17192\2799263322.py:7
5 scope.con()
6 except NameError:
----> 7 scope = cw.scope()
9 try:
10 if SS_VER == “SS_VER_2_1”:

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer_init_.py:384, in scope(scope_type, name, sn, idProduct, bitstream, force, prog_speed, **kwargs)
381 raise ValueError
383 if scope_type is None:
→ 384 scope_type = get_cw_type(**kwargs)
385 rtn : scopes.ScopeTypes = scope_type()
386 try:

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\common\utils\util.py:522, in get_cw_type(sn, idProduct, hw_location, **kwargs)
519 possible_ids = [0xace0, 0xace2, 0xace3, 0xace5]
521 cwusb = NAEUSB_Backend()
→ 522 device = cwusb.find(serial_number=sn, idProduct=possible_ids, hw_location=hw_location)
523 name = device.getProduct()
524 cwusb.usb_ctx.close()

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:342, in NAEUSB_Backend.find(self, serial_number, idProduct, hw_location)
339 def find(self, serial_number : Optional[str]=None, idProduct : Optional[List[int]]=None,
340 hw_location : Optional[Tuple[int, int]]=None) → usb1.USBDevice:
341 # check if we got anything
→ 342 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
343 if len(dev_list) == 0:
344 raise OSError(“Could not find ChipWhisperer. Is it connected?”)

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:466, in NAEUSB_Backend.get_possible_devices(self, idProduct, dictonly, attempt_access)
463 dev_list.remove(dev)
465 if len(dev_list) == 0:
→ 466 raise OSError(“Unable to communicate with found ChipWhisperer. Check that
467 \nanother process isn’t connected to it and that you have permission to communicate with it.”)
469 return dev_list

OSError: Unable to communicate with found ChipWhisperer. Check that
another process isn’t connected to it and that you have permission to communicate with it.


NameError Traceback (most recent call last)
File ~\AppData\Local\Temp\ipykernel_17192\2799263322.py:4
3 try:
----> 4 if not scope.connectStatus:
5 scope.con()

NameError: name ‘scope’ is not defined

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
Cell In[4], line 2
1 PLATFORM=“NOTHING”
----> 2 get_ipython().run_line_magic(‘run’, ‘Setup_Scripts/Setup_Generic.ipynb’)

File E:\Chipwhisperer\ChipWhisperer5_64\cw\home\portable\WPy64-31080\python-3.10.8.amd64\lib\site-packages\IPython\core\interactiveshell.py:2369, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
2367 kwargs[‘local_ns’] = self.get_local_scope(stack_depth)
2368 with self.builtin_trap:
→ 2369 result = fn(*args, **kwargs)
2370 return result

File E:\Chipwhisperer\ChipWhisperer5_64\cw\home\portable\WPy64-31080\python-3.10.8.amd64\lib\site-packages\IPython\core\magics\execution.py:717, in ExecutionMagics.run(self, parameter_s, runner, file_finder)
715 with preserve_keys(self.shell.user_ns, ‘file’):
716 self.shell.user_ns[‘file’] = filename
→ 717 self.shell.safe_execfile_ipy(filename, raise_exceptions=True)
718 return
720 # Control the response to exit() calls made by the script being run

File E:\Chipwhisperer\ChipWhisperer5_64\cw\home\portable\WPy64-31080\python-3.10.8.amd64\lib\site-packages\IPython\core\interactiveshell.py:2875, in InteractiveShell.safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
2873 result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
2874 if raise_exceptions:
→ 2875 result.raise_error()
2876 elif not result.success:
2877 break

File E:\Chipwhisperer\ChipWhisperer5_64\cw\home\portable\WPy64-31080\python-3.10.8.amd64\lib\site-packages\IPython\core\interactiveshell.py:266, in ExecutionResult.raise_error(self)
264 raise self.error_before_exec
265 if self.error_in_exec is not None:
→ 266 raise self.error_in_exec

[... skipping hidden 1 frame]

File ~\AppData\Local\Temp\ipykernel_17192\2799263322.py:7
5 scope.con()
6 except NameError:
----> 7 scope = cw.scope()
9 try:
10 if SS_VER == “SS_VER_2_1”:

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer_init_.py:384, in scope(scope_type, name, sn, idProduct, bitstream, force, prog_speed, **kwargs)
381 raise ValueError
383 if scope_type is None:
→ 384 scope_type = get_cw_type(**kwargs)
385 rtn : scopes.ScopeTypes = scope_type()
386 try:

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\common\utils\util.py:522, in get_cw_type(sn, idProduct, hw_location, **kwargs)
519 possible_ids = [0xace0, 0xace2, 0xace3, 0xace5]
521 cwusb = NAEUSB_Backend()
→ 522 device = cwusb.find(serial_number=sn, idProduct=possible_ids, hw_location=hw_location)
523 name = device.getProduct()
524 cwusb.usb_ctx.close()

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:342, in NAEUSB_Backend.find(self, serial_number, idProduct, hw_location)
339 def find(self, serial_number : Optional[str]=None, idProduct : Optional[List[int]]=None,
340 hw_location : Optional[Tuple[int, int]]=None) → usb1.USBDevice:
341 # check if we got anything
→ 342 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
343 if len(dev_list) == 0:
344 raise OSError(“Could not find ChipWhisperer. Is it connected?”)

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:466, in NAEUSB_Backend.get_possible_devices(self, idProduct, dictonly, attempt_access)
463 dev_list.remove(dev)
465 if len(dev_list) == 0:
→ 466 raise OSError(“Unable to communicate with found ChipWhisperer. Check that
467 \nanother process isn’t connected to it and that you have permission to communicate with it.”)
469 return dev_list

OSError: Unable to communicate with found ChipWhisperer. Check that
another process isn’t connected to it and that you have permission to communicate with it.

The same message occur when I when through the tutorial - Connecting to Hardware and try to run a similar code:

The code:
import chipwhisperer as cw
scope = cw.scope()

The Error Message:
OSError Traceback (most recent call last)
Cell In[2], line 2
1 import chipwhisperer as cw
----> 2 scope = cw.scope()

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer_init_.py:384, in scope(scope_type, name, sn, idProduct, bitstream, force, prog_speed, **kwargs)
381 raise ValueError
383 if scope_type is None:
→ 384 scope_type = get_cw_type(**kwargs)
385 rtn : scopes.ScopeTypes = scope_type()
386 try:

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\common\utils\util.py:522, in get_cw_type(sn, idProduct, hw_location, **kwargs)
519 possible_ids = [0xace0, 0xace2, 0xace3, 0xace5]
521 cwusb = NAEUSB_Backend()
→ 522 device = cwusb.find(serial_number=sn, idProduct=possible_ids, hw_location=hw_location)
523 name = device.getProduct()
524 cwusb.usb_ctx.close()

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:342, in NAEUSB_Backend.find(self, serial_number, idProduct, hw_location)
339 def find(self, serial_number : Optional[str]=None, idProduct : Optional[List[int]]=None,
340 hw_location : Optional[Tuple[int, int]]=None) → usb1.USBDevice:
341 # check if we got anything
→ 342 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
343 if len(dev_list) == 0:
344 raise OSError(“Could not find ChipWhisperer. Is it connected?”)

File e:\chipwhisperer\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:466, in NAEUSB_Backend.get_possible_devices(self, idProduct, dictonly, attempt_access)
463 dev_list.remove(dev)
465 if len(dev_list) == 0:
→ 466 raise OSError(“Unable to communicate with found ChipWhisperer. Check that
467 \nanother process isn’t connected to it and that you have permission to communicate with it.”)
469 return dev_list

OSError: Unable to communicate with found ChipWhisperer. Check that
another process isn’t connected to it and you have permission to communicate with it.

I have read through the forum to see how others solve these issues, but none of the other people’s solution works. I tried updating the firmware, I tried Zadig software to install the latest driver for the chipwhisperer.

This is what I see in my device manager:

another problem is that, on the chipwhisperer lite, it is blinking blue lights and only that light is on the D9 square.

Hi,

Try the following:

  1. Uninstall and delete all the drivers you have installed via Zadig.
  2. Short the erase pins on your ChipWhisperer Lite, then unplug/replug your ChipWhisperer
  3. Run the following code:
import chipwhisperer as cw
cw.program_sam_firmware(hardware_type='cwlite')

He Alex, i did as you instructed, but the same error still occurs.
The Error:
OSError: Unable to communicate with found ChipWhisperer. Check that
another process isn’t connected to it and that you have permission to communicate with it.

But in the device manager, I see 2 chipwhisperer Lite devices.
image

Did you make sure to check the box that deletes the driver when uninstalling? Also, did you do this for both interfaces?

I didn’t at first but I just did them now and the same error still occurs when I try to run the code.
The Error:

Do you still see both interfaces under Universal Serial Bus devices or libusbk? If the drivers are uninstalled and everything gets properly auto-assigned, you should see a single chipwhisperer-lite under Universal Serial Bus devices and a serial port.

Sorry for replying late. But I was able to get it working by using a virtual machine and doing everything from there. Thank you for helping