/okupando

Single-page application with single-task focus โ€” checking if the toilet is occupied or not. Also a pun. ๐Ÿšฝ๐Ÿผ

Primary LanguageJavaScriptISC LicenseISC

okupando ๐Ÿšฝ๐Ÿผ

๐Ÿ“ข No longer actively maintained.

Single-page application with single-task focus -- checking if the toilet is occupied or not.

Running

You need to run it on Raspberry Pi.

After usual cloning and npm installing, run

npm start -- --button-gpio-channel BUTTON_GPIO --light-gpio-channel LIGHT_GPIO

where BUTTON_GPIO is Broadcom pin number (BCM/GPIO) where you have your microswitch plugged in and LIGHT_GPIO is your status indicator diode. You may use e.g. pinout (from python3-gpiozero) to see the layout or visit https://pinout.xyz/.

By default server will run with no HTTPS and push notifications, run npm start -- --help to see how to configure those.

Physical installation

Our microswitch is shoved in a hole in the wall where toilet doorโ€™s lock slides in. Itโ€™s padded with some folded paper and kept in place with hot glue.

We are professionals.

If you donโ€™t have a good place to put your Raspberry Pi next to your toilet door, it may make sense to solder ethernet cable to your microswitch and use ethernet sockets to connect it to your Pi. Connection cannot go through the router, but ethernet switch is fine. If that setup does not work, it may mean that distance between microswitch and Pi is too great and signal fades. Experiment with that.

Microswitch setup

As of now, GPIO channel is set up in INPUT mode with PULL UP and change interval of 200ms.

Developing

Running server with no --button-gpio-channel and NODE_ENV=development will start debug mode when you can change status with keypresses. Run npm run dev to run server that restarts on every file change. No browser reload at this point, though. To make push work on localhost use something like site.js for HTTPS.

Run npm start -- --help for all available options.

Contributing

See our contributing guidelines.

Code of conduct

We have adapted Contributor Covenant code of conduct.

License

Code licensed under ISC.

Graphics licensed under Creative Commons BY-NC-SA.