I am using Moku:Go and would like to connect it to MATLAB via a USB connection. I have already downloaded the required Add-ons and API for MATLAB. However, when I attempt to communicate with Moku:Go using the IP address obtained from the Moku App, an error occurs.
Is it possible to use a USB connection for communication between Moku:Go and MATLAB, or is Wi-Fi the only available option? If Wi-Fi is the only option, can I use my personal Wi-Fi network with internet access instead of the hotspot provided by Moku:Go?
Alternatively, you can connect to a Moku by USB, wifi or ethernet via its serial number. This is the format for connecting to MokuGo with serial # 000600
Thank you for your response. However, I am still experiencing issues with establishing a communication connection. I’ve attached some pictures for your reference, and I would appreciate it if you could provide guidance on connecting Moku:Go via USB.
I have tried accessing the device using IPv6, IPv4, and the serial number, but none of them worked. One issue I suspect is that the IP address shown in the Moku App is different from the IP address displayed in the Command Prompt (cmd). Even after setting the PC’s IP address to match the one shown in the Moku App, the connection between MATLAB and Moku:Go still fails.
Additionally, when I check the device information in the Moku App, it shows “API Server: Not Installed.” Could this be causing the issue? If so, I would appreciate any guidance on how to resolve this as well.
“Thanks to your help, the IP connection seems to have been successfully established. However, a bitstream issue has occurred. While downloading the MATLAB API, the .bar files were automatically downloaded to the path C:\Users\onyou\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\moku-MATLAB\data, and all folders (mokugo, moku20, mokupro) now contain the .bar files. Could you please provide a solution to resolve this issue? Thank you.”
Hello, and thank you for your kind and helpful responses, which have enabled me to successfully connect the Moku:Go to MATLAB via USB. However, I’ve encountered some additional issues and would appreciate your assistance.
External Trigger for Data Logging
I would like to use an external trigger to control the data logging functionality of Moku:Go. Specifically, I want to start and stop data logging from MATLAB and save the logged data. However, after reviewing the user forum, I noticed mentions that controlling Moku:Go’s data logging via an external trigger is not supported. Is this still the case, or are there any updates or workarounds available?
Saving and Verifying Logged Data
My ultimate goal is to save the data obtained from two channels of the Moku:Go as a MATLAB (.mat) file. Before converting to the MATLAB format, I attempted to save the data as a CSV file to verify its contents. Unfortunately, the CSV file appears to contain no logged data, as shown in the attached image. Could you provide guidance on how to resolve this issue?
Thank you for your time and support. I look forward to your response
However, you cannot stop the datalogging via an external trigger.
Saving logged data
The downloaded data will be in a Liquid Instrument .li format; you can convert this with “mokucli” or the GUI file converter.
I am attaching a MATLAB script that implements this conversion.
Thank you for your previous response. I followed your advice and successfully saved the .li file. However, I am encountering an issue during the conversion of the .li file to a .mat file. Additionally, upon examining the .li file, the amount of data seems insufficient compared to what I expected. Specifically, for a sampling rate of 125,000 over 10 seconds across two channels, the data recorded appears to be less than anticipated.
I have recently downloaded and installed the latest version of mokucli, and its path is C:\Program Files\Liquid Instruments\Moku CLI\mokucli.exe.
Currently, I am acquiring data through two input channels. Are there any specific considerations or best practices when using two channels for data acquisition? Furthermore, I would like to understand how the .li file organizes the data from two channels. For example, does the file save data for Channel 1 in row 1 and Channel 2 in row 2, or is it structured differently?
I am attaching the MATLAB code I used for this process. Below is the error message I received:
The reason why the conversion from .il to .mat files was not successful was because the file path for saving the .il files in MATLAB was set to a non-English language directory.
Additionally, I would like to ask about another issue. When obtaining data using Moku through MATLAB, the data inside the Moku device is not deleted but continues to accumulate. This eventually fills up the storage and causes errors. Is there a way to implement an automatic file deletion feature within the Moku device using MATLAB code?
m = MokuOscilloscope(‘[fe80::7269:79ff:feb9:12be]’, force_connect=true)
never worked for me. It is returning a lengthy error message starting with the following:
Error using urlread2 (line 200)
Java exception occurred:
java.net.SocketException: Protocol family unavailable
In order to connect to the Matlab API via USB, I need to set a proxy in the admin mode and then connect to Moku by writing “localhost” instead of the IP address:
!powershell “netsh interface portproxy set v4tov6 listenport=8090 connectaddress=[fe80::7269:79ff:feb9:12be] connectport=http”
m = MokuOscilloscope(‘localhost:8090’);
The good thing is that I need to do this only once, and the next times the settings are remembered both on the PC and the Moku (which is kind of surprising). This issue has been bugging me for a long time, and when I saw Onyu’s reply that it worked for him/her, I thought it was resolved after the software/firmware updates. But unfortunately that’s not the case, every time I try to connect using the command that Paul provided at the beginning of this thread, I get that Java exception error.