How to connect Labvanced.com with external devices (EEGs, Eyetracking..)
Due to the increasing demand in feasibility checks and researchers asking us whether their study can be realized on Labvanced, we decided to create a new format, in which we will explain how to implement a certain type of study, mostly focusing on advanced features. However, if anyone of you has a particular request on how to implement a certain type of study, please reach out to us, and we will consider it for one of the next posts.
So in this first episode here, we would like to explain how to connect Labvanced with external devices (such as EEG systems, eye trackers, forceplates, or other devices recording neuro-physical data). So in short, this is how you can run real lab experiments using Labvanced.
Most importantly, the technology used here is called “websockets”. Websockets offer bidirectional data /network communication. You can enable websockets in the Labvanced study settings and then enter an IP address and a port. In case the machine controlling the external device (e.g. the EEG) is connected to the same computer, the IP address should be set to ``localhost`` and port to 8080. Now you have to run a small server (script) on the same computer (on port 8080) and thereby you can send messages to Labvanced (which can be picked up as a trigger in the event system) or receive messages sent by Labvanced actions (in JSON format). Luckily we have already created a Python example server for you, which is freely available on GitHub: https://github.com/Labvanced/websocket_python_server Now, the only thing left to do, is sending or receiving messages from that Python script to/ from your external device, which we think many of you are familiar with. Also, we have a websocket connection example study in our open-access library: https://www.labvanced.com/page/library/4107
Of course, there is more to tell and there are many more interesting use cases for the websocket API; some of them we will cover in one of the next posts. If you are interested in this use case / possibility and/or have any further questions please email us.
Labvanced Team
team@labvanced.com

Comments
Post a Comment