Giter Club home page Giter Club logo

raspi-pool's Introduction

raspi-pool

Raspi-pool is a swimming pool manager service to control devices (lights, water & heating pump, ...). It's also using sensors to get some data (e.g. temperate of the water).

⚡️ Quick start

  1. Clone and enter the repo.

    git clone [email protected]:rv2e/raspi-pool.git
    cd raspi-pool
  2. Install dependencies.

    nvm use
    yarn install
  3. Run the backend.

    1. Create You Env The backend needs some credentials to work. They are directly taken from the .env file that you have to create. Feel free to copy the .env-sample file which contains a basic setup.

    2. Create Postgres Database You can use the db:create command to directly create the database:

      yarn db:create
    3. Apply The Migrations Before starting the application, your database needs the latest migrations. You can run this command:

      yarn db:migration:run
    4. Start The App You can use the start command or the start:dev (with hot reload) to run the application:

      yarn start[:dev]

      Now the server should listen to the port 3000.

  4. Load the Jest tests in watch mode.

    Use the test command to run the tests in watch mode.

    yarn test:watch

    Notes:

    • The tests use another dotenv configuration. You can take a look at this file .env.test. Make sure to also create a database for the e2e tests.
  5. Other useful commands.

    • Run the linter: yarn lint
    • Build the app: yarn build
    • Generate migrations: yarn db:migration:generate -n <migration_name>
    • Seed the database: yarn db:seed

Raspberry

Once docker and postgres are installed correctly, the image can be built then ran:

  nohup docker build -t raspi-pool . &

  nohup docker run --rm --device /dev/mem --device /dev/gpiomem -p 3000:3000  --privileged -t raspi-pool &

GPIO

  • BCM 4: water temperature (1-wire protocol - ds18b20) with 4.7k Ohm.
  • BCM 26: outside temperature (1-wire protocol - ds18b20) with 4.7k Ohm.
  • BCM 22: box temperature (am2320) with 10k Ohm.
  • Pin 29 & 31: vertical actuator 1
  • Pin 33 & 35: vertical actuator 2
  • Pin 32: pool light
  • Pin 38: tree light
  • Pin 40: water pump
  • Pin 36: heating pump

Useful Resources

raspi-pool's People

Contributors

rv2e avatar

Watchers

 avatar  avatar  avatar

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.