Github Repo Url: https://github.com/asarm/websocket-example
Youtube Demo Url: https://youtu.be/wEzvr50AKkM
An app that simulates an IoT ecosystem. The server-side was written in C. It functions by periodically reading data from five different sensors across 30 different rooms. The server aggregates this data and sends it through a WebSocket. I developed a middleware that listens to the socket, and when new data arrives, it sends this information to the web application. The web app is written using Flask, JavaScript, and HTML. It lists the available rooms on the home page, and the room detail page displays the latest data of the selected room, including a real-time updating CO2 chart.
Follow these steps to run locally:
- Run the web app (using "python web_app.py")
- Run the consumer side (using "python consumer.py")
- Build the server code (using "gcc -o server.exe main.c -lws2_32")
- Run the server.exe