Chapter 8 Websockets
Occasionally, it is desirable to control the data acquisition hardware directly from an internet browser where the user interface is realized as an interactive webpage using JavaScript. In this way, even smartphones connected to the network can control the acquisition and display data in real time. Unfortunately, due to security concerns can normal sockets, such as those used the second example in Section 4.6.3, not be accessed from a browser. Instead, however, we can use a simpler interface called websockets, which allows us to exchange simple text-based messages between microcontrollers and browsers.
The text-based messages are formatted using the JavaScript object notation (JSON) where all ...
Get A Hands-On Course in Sensors Using the Arduino and Raspberry Pi, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.