Skip to content

A system to visualise open/closed state, and the on/off state of various sensors/objects/sockets in Sheffield Hackspace.

Notifications You must be signed in to change notification settings

sheffieldhackspace/space-state-visualiser

Repository files navigation

Space State Visualiser

A system to visualise open/closed state, and the on/off state of various sensors/objects/sockets in Sheffield Hackspace.

illustration of hackspace, showing green and red objects

Visuals

The visuals are generated by nnenov

Development

install

mkdir -p /usr/shhm/.ssh/
ssh-keygen -f /usr/shhm/.ssh/space-state-deploy-key
export GIT_SSH_COMMAND="ssh -i /usr/shhm/.ssh/space-state-deploy-key"
git clone git clone …

python -m venv env
source ./env/bin/activate
pip install -r requirements.txt
echo "[]" > history.json

convert images

# the info beamer Pi does not render images very well, so we crop them
py image_transform.py

Flask debug

flask --app server run

test MQTT commands

mosquitto_pub -h mosquitto.shhm.uk -t "SHHNoT/lights/room_d/command/switch:0" -m on
mosquitto_pub -h mosquitto.shhm.uk -t "state/SS/943CC682D374/input" -m '{"Door Open": false}'

run in 'production'

pip install gunicorn eventlet
gunicorn -b 0.0.0.0 --worker-class eventlet -w 1 server:app

run with systemd

# set up permissions
sudo useradd -r -s /bin/false spacestate
sudo chmod g+w history.json
sudo chown $USER:spacestate history.json

# turn on systemd service
sudo cp space-state-visualiser.service /etc/systemd/system/space-state-visualiser.service
sudo systemctl enable space-state-visualiser.service
sudo systemctl start space-state-visualiser.service
sudo systemctl status space-state-visualiser.service

About

A system to visualise open/closed state, and the on/off state of various sensors/objects/sockets in Sheffield Hackspace.

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •