10-28-2021, 11:21 AM
You won't be able to make 400 requests per second, especially as the web server on the phone is not that efficient. In fact, you would need an even higher frequency to make sure not to miss a value die to "bad timing". You need to request multiple values at once at a lower request rate. To do so, you need to look at the last example "/get?time=30&value=30|time".
For example, let's assume you want to read acceleration data from a buffer "acc" and there is a matching timestamp buffer "t". You will need to request /get?acc=full&t=full first to get all data points that are already there. Then your script needs to take the last entry of "t" and request any data that has been taken since this last "t". For example, if the last data point was acc=7.2 and t=0.34, you would request anything since 0.34s like this: /get?t=0.34&acc=0.34|t which means that you request all values of t larger than 0.34 and all values of acc that correspond to t values larger than 0.34.
This way you can lower the request rate and even if it is limited by your network you will not miss any data point.
For example, let's assume you want to read acceleration data from a buffer "acc" and there is a matching timestamp buffer "t". You will need to request /get?acc=full&t=full first to get all data points that are already there. Then your script needs to take the last entry of "t" and request any data that has been taken since this last "t". For example, if the last data point was acc=7.2 and t=0.34, you would request anything since 0.34s like this: /get?t=0.34&acc=0.34|t which means that you request all values of t larger than 0.34 and all values of acc that correspond to t values larger than 0.34.
This way you can lower the request rate and even if it is limited by your network you will not miss any data point.