Cannot connect using python

**Moku model:Pro and win10
I followed the python install steps but when i type the following I get a [‘API Connection already exists’] error

from moku.instruments import Oscilloscope
osc = Oscilloscope(‘192.168.137.230’)

This error code refers to the Moku:Pro already having a connection either to the iPad App, Desktop App, or one of the APIs. To fix this from popping up everytime you try to run the python script, change your instrument deployment call to the following:

osc = Oscilloscope('192.168.137.230', force_connect=True)

It may also help to add the following line at the very end of your script so that the API server disconnects properly.

osc.relinquish_ownership()

Please let me know if this fixes the issue for you!

1 Like