Coder Social home page Coder Social logo

marek-saji / okupando Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 4.0 586 KB

Single-page application with single-task focus β€” checking if the toilet is occupied or not. Also a pun. 🚽🐼

License: ISC License

JavaScript 76.54% CSS 3.77% HTML 15.86% Shell 0.60% Makefile 3.23%
toilet occupied raspberry-pi gpio

okupando's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.