Data acquisition without sd card!

**Moku model: Moku:lab
Operating system: Ubuntu
Software version: 601

Bug or support request description: Dear all, I would like to know, if there is any opportunity to log or stream data without downloading the .li file neither in the local computer nor in the moku SD card. I use python API for data streaming or logging.
best
Saman

Hello @Saman,
Streaming is available without an SD card. To use streaming you will need to first install mokucli which is available for download here. To get the data from the Moku, you can use get_stream_data() in a loop which will constantly pull in the streamed data. To log and download you will need an SD card. Hope this helps!

Hi Saman, I’ve had success using stream_to_file and specifying the destination as a temp csv on my local machine, then immediately reading and then deleting the temp file. It’s a little hacky but it gets around having to manually open and convert a .li file. I found repeatedly calling get_stream_data() to occasionally drop data if latency is poor. Maybe I’m doing something wrong there.

Hello @JackAttack720 and @Saman ,
Yes, streaming to file is another good choice! For this, you can choose to stream to a csv to avoid having to convert any .li files. You typically only have to convert the .li file if you are logging, not streaming. Calling get_stream_data() in a loop shouldn’t cause any data loss as the data is first stored in a buffer before it is streamed to your local machine. Here is a simple script where you can essentially collect all of the streamed data, add it to a list, and plot it and/or process it.

i=Datalogger('192.168.##.###', force_connect=True)

i.start_streaming(10,1e6)

time_data=[]
volt_data=[]

while True:
    data=i.get_stream_data()
    x=data['time']
    y=data['ch1']
    time_data.extend(x)
    volt_data.extend(y)

Once that is finished running, time_data will have all of the time data and the volt_data will have all the voltage data points.

1 Like