Posts

Showing posts with the label websocketd

Use websockets to build a browser-based Digital Voltmeter

Image
This is the third and final part of a series about building a browser-based six-channel Digital Voltmeter (DVM) using an Arduino and a Raspberry Pi. Part one covered the software on the Arduino and the USB connection to the Raspberry Pi. Part two showed you how to use the pyserial package to read that data into a Python program and print the results as they arrived. In this final part you'll see how to use Joe Walnes ' brilliantly simple websocketd . You'll see how you can turn the Python program into a server without writing any additional code! Finally, you'll view a web-page that displays the voltages in more or less real-time. Web sockets with websocketd HTTP makes it easy for a web browser to ask for data from a web server. That approach is known as client pull because the client (the web browser) pulls (requests) the data from the server. For the DVM application you want to use server push; in other words, you want to send changes in the voltages...