monkeymademe / piritos

42 stars 6 forks source link

PiRitos

PiRitos is a Raspberry Pi project that hosts the wonderful Star Trek: Lowerdecks inspired LCARS web interface created by the talented Rob @meWho_System47 on twitter. (You can also see Ritos and the rest of his work at mewho.com

PiRitos is using flask for hosting and socketio for websocket communication between the server and clients. What this means is anyone in the local network using their browser, can connect to the PiRitos server and interact with Robs LCARS interface. Each browser window we would refer to as the 'client'.

The magic happens with websocket communication!

SocketIO easily allows flask to talk to all the connected clients at the same time allowing the server to pass variables to the client, and the client to pass variables to the server. This 2 way communication means the all of the clients can be in sync with changes made in one of the clients since the server is the middle man.

An added bonus of having flask written in python is that we can easily add to the experience by adding LED lights or sending sensor data from the SenseHat to the clients.

Thanks to Rob @meWho_System47, he helped connecting socketio to some of the Javascript functions, when a user presses the 'Red Alert' button we have all the clients activating 'Red Alert' and also have a way to display some sensor data from the server.

What do you need for this project:

Usage

python3 -m venv my_env
source my_env/bin/activate
pip3 install -r requirements.txt

Start the server

python app.py

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.