They/them. PhD student: smart textiles, weaving, computational craft, hardware hacking.
by Shanel
This project was built on top of the first class project, described in this previous post, so these installations were in addition to the ones listed there.
npm
with standard installation of Raspbian on Pi. Make sure it’s the latest version. Use npm install
for the following packages:
ws
implementation, but socket.io
and other versions are out there, too.mysql
) for Node.js.ws
(Node.js Websockets) ReferenceThe biggest issue that we ran into during the project (and up through the demo) was handling the data connection and transportation over the WebSockets. With the Python Websocket server, we were able to establish the server/client connection, but weren’t able to properly transmit different data payloads. The Python QT code from the previous project was already fairly long, so there were some places were we didn’t insert the WebSocket code or break it out into a separate file correctly. For the Node.js WebSocket, we realized that we needed to carefully format the JSON with the MySQL data in order to have a parse-able string on the client side.