Cannot connect via Python with an InvalidRequestException "may be using this device"

I’m having difficulty connecting to Moku:Go, but I can connect via wifi by manually specifying the IP address. Connectivity issues are on a separate topic.

Even when I can connect via wifi using the Moku app, I cannot do so via Python.

>>> Oscilloscope('')
moku.exceptions.InvalidRequestException: ['[PC NAME]::17832 may be using this device.']

I of course closed the Moku app and even rebooted the computer but still get the same exception.

This is on Windows 10 Enterprise 22H2. Moku v3.2.0. Python v3.10.2.

Hi @lukask,

Adding force_connect=True should should fix this issue for you:

i = Oscilloscope(IP, force_connect=True)

force_connect overrides any existing connections to connect to your device. Make sure you are also using i.relinquish_ownership() at the end of your script to ensure network resources are released correctly.

I’m trying to reproduce your other issues and will get back to you when I have a solution.

Thanks @indira, using force_connect did the trick, I can now use Moku:Go via Python.

I only had to set force_connect=True once, subsequent connections worked fine without it.

I still cannot use the Moku app or connect via USB-C as explained in the other topic.

1 Like