Moku Go version 3.1.1 error

I updated my Moku Go and Matlab API to version 3.1.1 today and am having problems.
Below is the program code and error.
Please let me know how I can fix this problem.
Or please tell me how to revert Moku Go and Matlab API back to 3.0.0.

The program is shown below.

i = MokuOscilloscope(‘xxx.xxx.xxx.xxx’,force_connect=true);
xmin=0.0005;
xmax=0.0017;
try
i.set_frontend(1, ‘1MOhm’, ‘DC’, ‘10Vpp’);
i.set_trigger(‘type’,“Edge”,‘source’,“Input2”,‘level’,4,‘mode’,“Normal”,‘edge’,“Rising”,‘auto_sensitivity’,true);
i.set_timebase(xmin, xmax);
i.set_source(1,‘Input1’);
i.set_source(2,‘Input2’);
data=i.get_data(‘timeout’,60,‘wait_reacquire’,true);
response = i.save_high_res_buffer();
i.download_file(‘persist’, response.file_name, ‘data/WASC1206.li’);
! mokucli convert data/WASC1206.li --format=csv
i.set_defaults()

catch ME
% End the current connection session with your Moku
i.relinquish_ownership();
rethrow(ME)
end
i.relinquish_ownership();

Errors are listed below.

sun.net.www.protocol.http.HttpURLConnection:http://xxx.xxx.xxx.xxx/api/slot1/oscilloscope/save_high_res_buffer

Response stream is undefined
below is a Java Error dump (truncated):
sun.net.www.protocol.http.HttpURLConnection:http://xxx.xxx.xxx.xxx/api/moku/relinquish_ownership

502

Requests/parse_response
Unexpected error occurred

error: Requests/http_post (line 130)
response = obj.parse_response(output, extras);

error: Moku/relinquish_ownership (line 228)
response = obj.session.http_post(‘moku/relinquish_ownership’, params);

error: (line 27)
rethrow(ME)

Hi @Koki,

This would happen if the trigger condition isn’t met; the save_high_res_buffer would timeout and return the 502 error. Do you have a signal with a rising edge at +4V going to Input 2? If not, it might be better to use the Auto-trigger mode:
i.set_trigger('type',"Edge",'source',"Input2",'level',4,'mode',"Auto",'edge',"Rising",'auto_sensitivity',true);
Please let me know if this helps or is still causing you issues!

Hi @nadia
Thanks for the reply.
I solved the problem, but it was not due to the trigger settings.
I removed “data=i.get_data(‘timeout’,60,‘wait_reacquire’,true)” and added response = “i.save_high_res_buffer(‘timeout’,60)” instead and it ran without error.
Thank you for your cooperation.

1 Like

Hi @Koki

I am trying to make some measurements with my Moku Pro but I keep getting the same error moku.exceptions.MokuException: [‘Timeout before fetching the new frame’] when switching the instrument.
Any updates on this issue?

Thanks!