Issue setting up Python with Moku:Go using pymoku libraries - SOLVED

Hi Sam,

doing a python setup with Moku:Go and ran into some glitches:

my context:
Moku:Go Demo version (under the unit label):
Version 0.2
21W13_0222
70:69:79:B9:03:78
F8:33:21:DE:C1:2C
DUT_TYPE M2
HW_REV 1.2

from: Desktop MokuGo app
Moku Desktop App: version 1.0.1 (build 8793)

Device info:

Serial number: 000222
Hardware version: 4.0
Firmware version: 548

My Laptop:
MacOS Big Sur (Version 11.4)
Python 3.3.8

ISSUE:

while following the instructions at:

first-the -good-news:

  1. I have a wifi connection to the Moku:GO over the direct Moku based wifi, and able to bring up instruments just fine
  2. was able to confirm pymoku installation in the above instructions by executing the pymoku import in python “import pymoku” without any errors.

not-so-good-news:

at the MacOS shell prompt
aps-MacBook-Pro:lib ap$ moku --ip=192.168.x.xxx update install
PyMoku 2.8.3
Traceback (most recent call last):
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 129, in init
self.serial = self.get_serial()
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 1052, in get_serial
self.serial = self._get_property_single(‘device.serial’)
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 579, in _get_property_single
r = self._get_properties([prop])
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 514, in _get_properties
reply = self._conn.recv()
File “zmq/backend/cython/socket.pyx”, line 781, in zmq.backend.cython.socket.Socket.recv
File “zmq/backend/cython/socket.pyx”, line 817, in zmq.backend.cython.socket.Socket.recv
File “zmq/backend/cython/socket.pyx”, line 191, in zmq.backend.cython.socket._recv_copy
File “zmq/backend/cython/socket.pyx”, line 186, in zmq.backend.cython.socket._recv_copy
File “zmq/backend/cython/checkrc.pxd”, line 22, in zmq.backend.cython.checkrc._check_rc
zmq.error.Again: Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/anaconda3/bin/moku”, line 8, in
sys.exit(main())
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/tools/moku.py”, line 290, in main
args.func(args)
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/tools/moku.py”, line 64, in update
moku = connect(args, force=True)
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/tools/moku.py”, line 304, in connect
moku = Moku(args.ip, force=force)
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 143, in init
self.serial = self.get_serial()
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 1052, in get_serial
self.serial = self._get_property_single(‘device.serial’)
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 579, in _get_property_single
r = self._get_properties([prop])
File “/opt/anaconda3/lib/python3.8/site-packages/pymoku/init.py”, line 514, in _get_properties
reply = self._conn.recv()
File “zmq/backend/cython/socket.pyx”, line 781, in zmq.backend.cython.socket.Socket.recv
File “zmq/backend/cython/socket.pyx”, line 817, in zmq.backend.cython.socket.Socket.recv
File “zmq/backend/cython/socket.pyx”, line 191, in zmq.backend.cython.socket._recv_copy
File “zmq/backend/cython/socket.pyx”, line 186, in zmq.backend.cython.socket._recv_copy
File “zmq/backend/cython/checkrc.pxd”, line 22, in zmq.backend.cython.checkrc._check_rc
zmq.error.Again: Resource temporarily unavailable
aps-MacBook-Pro:lib ap$

Hello Leat,

Thank you for contacting me about this issue and for providing plenty of details about the Moku:Go you are having problems with.

The Pymoku library is used with our Moku:Lab product. The Moku python library is the one that is used with our Moku:Go product. Please try “pip install moku” instead and let me know if you run into any issues. You can find more info about the Moku python setup here on our APIs page.

We understand it is a bit confusing having two different python APIs and are working to merge the two, but here is another forum post with more information about the two python libraries.

Last thing, the first line in your MacOS shell prompt (aps-MacBook-Pro:lib ap$ moku --ip=192.168.5.136 update install) is not necessary unless you are trying to update the devices firmware through Python. I would recommend just updating the firmware through the desktop app.

Hi Sam

Thanks for the detailed response…and highlighting the distinction between the moku (Moku:Go) and pymoku (Moku:Lab).

I cleaned up my moku:Go python API installation (my anaconda3 based site-package) and it was straight forward, and all is good now!

Here is an attempt to reconstruct my initial confusion:

  1. Just following the links Products->APIs->Python API->Get Started(button)->Getting Started ->For Moku:Pro & Moku:Go( section) must have confused me, given that the both Moku:Pro/Moku:Go are covered under the same section, given that there is no separate button/link to “Download for Moku:Go”. Additionally, the “Download for Moku:Pro” button points to pymoku repository.

The “Documentation” button/link next to “Download for Moku:Pro” button/link does address the Moku:Go python API installation and checkout procedure, consistent with your suggested link.

ps: It would be good to have a dedicate button/link for Moku:Go “Documentation”

  1. And the other confusion I had with my original wrong installation (pymoku instead of moku) was that I didn’t check the installed…/bin/moku script, which was pointing to the “pymoku” internally (Moku:Lab/Moku:Pro?), and not the “moku” API that I needed for my Moku:Go. The fact that the bin/moku file was named moku, I wrongly “assumed” it was good to :Go :slight_smile:

ps: feel free to post it on the forum, after whatever cleanup you see fit.