In this section, we will try to build a simple IoT app for sending data from an XD-80 light sensor module to a receiver device, using a Raspberry Pi hub and the WebSocket protocol:
Data flow from an XD-80 sensor to a receiver device
WebSocket is most widely used in the case that one needs to enable fast transfer of real-time data. The protocol allows for two-way interaction between a client and a server, and for streaming multiple messages using the same TCP connection, which lowers the communications overhead.
In the following table, you can find a more detailed description of the protocol to understand whether it is suitable for your needs:
Key |
Value |
Open source |
Yes |
The OSI layer |
Application |
Data types |
String |
Limitations |
Not suitable for large amounts of binary data |
Possible operations |
Send... |