Moku model: Moku:Lab Operating system: Microsoft Windows 10 Enterprise Version 10.0 (Build 19045) Software version: MATLAB Version: 9.10.0.1602886 (R2021a) / moku-MATLAB 3.0.1
Bug description: I cannot connect to the Moku:Lab using MATLAB.
I have tried with two different Moku:Lab and get the same error.
I am able to connect when using a Moku:Go.
I am sharing the code below:
%%
clc
clear
close all
%% Connect to your Moku
ip = '192.168.73.1';
% Connect to your Moku and deploy the desired instrument
m = MokuOscilloscope(ip, force_connect='True');
m.relinquish_ownership()
I get the following error:
sun.net.www.protocol.http.HttpURLConnection:http://192.168.73.1/api/moku/claim_ownership
404
Error using Requests/parse_response (line 40)
Unexpected error occurred
Error in Requests/http_post (line 128)
response = obj.parse_response(output, extras);
Error in Moku/claim_ownership (line 219)
response = obj.session.http_post('moku/claim_ownership', params);
Error in Moku (line 180)
obj.claim_ownership('force_connect', force_connect, 'ignore_busy',
ignore_busy, ...
Error in MokuOscilloscope (line 84)
obj@Moku(IpAddr, force_connect, ignore_busy, persist_state, read_timeout,
mimInited);
Error in MokuPhaseExmaple (line 17)
m = MokuOscilloscope(ip, force_connect='True');
We recently updated the Moku:Lab firmware so that it now uses the same API as Moku:Go and Moku:Pro. Have you recently updated your Moku:Lab firmware to 580? If so then it will use the moku-MATLAB toolbox which should work for both devices given the code you posted above (except of course changing the IP address). If not, then it will use the legacy MATLAB toolbox which you can download from here under the Legacy section.
Can confirm which firmware both devices are on to see if there is an issue with the API toolbox version?
I just updated the firmware to 580.
I ran the same code with the new firmware and the same moku-MATLAB toolbox, and I got a different error message:
Error using Moku/load_instrument_resources (line 323)
Cannot find bitstream C:\Users\xxxx\AppData\Roaming\MathWorks\MATLAB
Add-Ons\Toolboxes\moku-MATLAB\data\moku20\01-000, please run moku_download(580) to download
instrument data
Error in MokuOscilloscope (line 87)
obj.load_instrument_resources('01-000');
Error in MokuPhaseExmaple (line 17)
m = MokuOscilloscope(ip, force_connect='True');
Then, I uninstall the toolbox and installed the legacy MATLAB toolbox.
It got a different error message for the Moku:Lab and for the Moku:Go:
Error using moku/check_compatibility (line 172)
input file does not exist
Error in moku (line 71)
[compat, py_vers] = obj.check_compatibility();
Error in MokuOscilloscope (line 36)
obj@moku(IpAddr, 'oscilloscope');
Error in Test (line 10)
m = MokuOscilloscope(ip);
Type āmoku_download(580)ā in Matlab command window and hit enter (you should be connected to the Internet). Thatās what I had to do after updating the Moku Matlab API yesterday.
Iām having the same problem connecting MatLab to the Moku:Lab device. I sent the Moku out for cal and it came back with the firmware updated to version 600. I updated my ipad app and Iām able to connect to the Moku just fine. When I connect to the Moku over Wifi, I can access it within my browser and see the following info:
Hardware Version: 2.0 Moku:Lab
Firmware Version: 600
In MatLab (R2004b), I download the Moku-MatLab AddOn package version 3.3.1. It says online that it is compatible with firmware version 600. I then typed āmoku_download(600)ā in the MatLab command window and downloaded the instrument data. Everything seems to be updated as far as I can tell. When I try to run the command āMokuOscilloscope(ā192.168.73.1ā)ā , I get the following error:
Can you check what API Server is loaded on your device, there may be an issue there? To do this right-click on your device in the App and readout what it says under āDevice info > API serverā. It should look something like the screenshot.
That fixed the issue. The API server was listed as Not Loaded. I also didnāt have the Windows app loaded on my computer. I purchased my Moku Lab unit when the windows app was still being developed so I never bothered to download it. Since I was able to control the unit with MatLab, I was all set until the calibration house upgraded the firmware in the Moku unit. With the API server loaded, Iām able to communicate with the Moku Lab now. Looks like I need to update some of the instrument configuration commands in MatLab because those are no longer working. I tried updating a few of them and got those working so itās just a matter of updating the rest of my MatLab code to work with the updated hardware/firmware. Thanks for your help!
Iām glad that fixed the issue for you. Iām sorry that your firmware was updated unexpectedly but that is a necessary part of the calibration process. Hopefully youāre able to take advantage of the updated features on the new firmware!
If we can help with any of the MatLab parameters that have changed dont hesitate to post them.