Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to send data from a device to the web #98

Open
AntonelloBS opened this issue Apr 7, 2022 · 5 comments
Open

Best way to send data from a device to the web #98

AntonelloBS opened this issue Apr 7, 2022 · 5 comments

Comments

@AntonelloBS
Copy link

Hello,
for a project of mine I would like to send data acquired from a device with LSL to the Web.
Right now I am pulling data from the device with a timeout of 0 and sending them to the web via HTTP post request (I am using HTTP connection pooling instead of classic HTTP). It is somehow a slow process, I can't get a good timing, so I have 2 questions:

  1. Do you know a better way to send data to the web at a high rate?
  2. Is there a possibility to make the outlet and inlet communication happening on localhost and then using the internet connection just to send the data to the web? I red that I can use the configuration file to do something like that, but I don't know how to.

Thanks

@cboulay
Copy link
Collaborator

cboulay commented Apr 7, 2022

LSL can communicate between processes on localhost, within a subnet, and even across the internet (the latter is maybe what you read w.r.t. configuration file changes). I'm not sure if this is what you meant by "web".

As for getting it in the browser -- whether that's on localhost or on another computer -- as far as I know there is currently no good way to pull data from an LSL stream into a javascript process. websockets aren't implemented. So you would probably need a webserver that reads in data from LSL then serves it to browsers.

@AntonelloBS
Copy link
Author

OK,
can I force the inlet and outlet to communicate only on localhost? Do I have to use the knowPeers or the ResolveScope?

@cboulay
Copy link
Collaborator

cboulay commented Apr 7, 2022

I've never used this feature so I don't know off-hand. I think KnownPeers is more of a fallback rather than a limiter. In addition to ResolveScope, you might want to look into LinkAddresses. Sorry I can't be more helpful at the moment.

@AntonelloBS
Copy link
Author

What is link Adresses used for?

@cboulay
Copy link
Collaborator

cboulay commented Apr 7, 2022

The most reliable way to understand what the different lsl_api.cfg entries do is to look at the code. In this case: https://github.com/sccn/liblsl/blob/master/src/api_config.h#L87-L103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants