# Data streaming

**URL:** <https://forum.qoitech.com/t/data-streaming/289>\
**Category:** Support\
**Created:** [April 25, 2019, 11:14am UTC](https://forum.qoitech.com/t/data-streaming/289 "2019-04-25T11:14:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oulab.mbedcloudtesti](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@oulab.mbedcloudtesti](https://forum.qoitech.com/u/oulab.mbedcloudtesti)\
**Post date:** [April 25, 2019, 11:14am UTC](https://forum.qoitech.com/t/data-streaming/289/1 "2019-04-25T11:14:27Z")

</div>

Hello,

I have been studying the lua API, however could not understand is there a possibility to stream the measured data in the realtime. Every example calls project:start(), then project:stop() and only then analyzes the data.

Our usecase is to capture the data continuously (virtually 24/7) and stream it in the realtime to some time-series database like InfluxDB. For data analysis we can match the measurements with the events registered through different channels by their timestamps.

Does Otii Arc support such feature?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![bjorn.rosqvist](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.qoitech.com/bjorn.rosqvist/32/238_2.png) [@bjorn.rosqvist](https://forum.qoitech.com/u/bjorn.rosqvist)\
**Post date:** [April 25, 2019, 1:24pm UTC](https://forum.qoitech.com/t/data-streaming/289/2 "2019-04-25T13:24:55Z")

</div>

Hi,

It is not possible to steam data in realtime.  
The possibility you have is to, during the recording, access the data and analyse the new data points since last read.

What I try to explain is to iterate something like this:

> number\_of\_new\_samples = project:get\_channel\_count(device, recording\_id, channel)  
> new\_data = project:get\_channel\_data(device,recording\_id,channel,number\_of\_old\_samples+1,number\_of\_new\_samples-number\_of\_old\_samples)  
> number\_of\_old\_samples = number\_of\_new\_samples

Best regards,  
Björn

---

<div class="post-metadata">

**Author:** ![oulab.mbedcloudtesti](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@oulab.mbedcloudtesti](https://forum.qoitech.com/u/oulab.mbedcloudtesti)\
**Post date:** [April 29, 2019, 8:39am UTC](https://forum.qoitech.com/t/data-streaming/289/3 "2019-04-29T08:39:33Z")

</div>

Thanks! Good to hear that recording does not have to be stopped to access the samples. I understand that over the time the recording will eat more and more memory. May I use [Otii Scripting API](https://www.qoitech.com/help/scripting/modules/otii.html#project:crop_data) to drop fetched samples?

---

<div class="post-metadata">

**Author:** ![bjorn.rosqvist](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.qoitech.com/bjorn.rosqvist/32/238_2.png) [@bjorn.rosqvist](https://forum.qoitech.com/u/bjorn.rosqvist)\
**Post date:** [April 30, 2019, 7:06am UTC](https://forum.qoitech.com/t/data-streaming/289/4 "2019-04-30T07:06:45Z")

</div>

Hi,

project:crop\_data function can only be used after recording is stopped.

Best regards,  
Björn

---

<div class="post-metadata">

**Author:** ![oulab.mbedcloudtesti](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@oulab.mbedcloudtesti](https://forum.qoitech.com/u/oulab.mbedcloudtesti)\
**Post date:** [April 30, 2019, 7:22am UTC](https://forum.qoitech.com/t/data-streaming/289/5 "2019-04-30T07:22:38Z")

</div>

Hi,

Is there some other way to contain memory utilization (am I right in my assumption?) and keep recording endlessly?

---

<div class="post-metadata">

**Author:** ![bjorn.rosqvist](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.qoitech.com/bjorn.rosqvist/32/238_2.png) [@bjorn.rosqvist](https://forum.qoitech.com/u/bjorn.rosqvist)\
**Post date:** [April 30, 2019, 8:32am UTC](https://forum.qoitech.com/t/data-streaming/289/6 "2019-04-30T08:32:25Z")

</div>

Hi,

One way is to start a new recording and remove the old when the data is processed.  
The drawback is the small glitch in time when starting a new recording.  
To be creative, you could overlap this glitch by using a second Otii Arc and connect this with a sense resistor to ADC± and use the data from this. However, this might me a lot of work for small amount of data.

Best regards,  
Björn
