I want to know how to send bigger chunk of data from the IMP to cloud.
For example: a buffer of 50-100K data
One buffer of that size is not a solution (the current firmware crashes anyway if I try to declare big arrays, probably with out of memory).
It could be sent chunk by chunk (of 100-256 bytes) but for that I would need to be sure that a chunk was received by the IMP service before overwriting the buffer with the new chunk.
I know the speed would be slow but that is not an issue here (if it does not takes hours) just to get it through in a few seconds.
Can this be achieved somehow?
If it does not possible right now, will it be later on?
This would be some kind of streaming (low speed but still streaming) which will force through IMP service so I really need to know if this is something what we will have or what we will never have with IMP's. I remember some blog entries with walkie-talkie over imp so I am pretty sure the idea is not new :)
Right now, you have to assume data has been received by the service; we do not drop data on a good connection (ie, the squirrel code will block, vs dropping the data).
As soon as you do the set() call, the data is copied out of your buffer into the BSON packet that gets encrypted and sent to the server, so you don’t have to worry about local overwrites… however, if the squirrel code blocks on a set(), there’s always the possibility of not processing incoming data from your hardware interface. Obviously, we have limited RAM and hence if the internet connection cannot support the throughput things can go wrong.
We’re working on some applications that require audio streaming (hence 8-16kB/second) in a reliable fashion. This includes APIs to implement double-buffering and have callbacks when the OS switches buffers. We also have transparent serial pipes on the wishlist (where the flow is configured by the squirrel code, but then serviced entirely by the imp OS).
The audio streaming is a good news - one suggestion would be to permit anything else to be streamed via the same mechanism. 16kb is kinda enough for most of our needs so I would like to use that stuff for transmitting other data as well.
The audio streaming isn’t done with any particular magic - it’s just double buffering (in squirrel).
The magic being added is fixed-rate ADC sampling with callbacks and automatic buffer switch. Where is your 16kB of data coming from? ADC or a digital interface?
Digital interface (SPI most probably).
But we also want to play with audio so looking forward to the ADC magic