The system is divided into more parts:
- The door sensor (connected to the receiver by radio)
- The receiver (connected to the PC via serial)
- The PC with the WebSocket server and the node site.
In the flask.py file, you can view the first prototype with a single web server that gets door status and displays that when the page is loaded.
Then I made a website that updates live when the door is open or closed with a WebSockets server.
To run it you need to install pyserial, websockets, and flask.
To run the website, go to the site directory and run npm install
to install dependencies and npm run dev -- --open
for running the website.