Giter Site home page Giter Site logo

radlikewhoa / happyflowers Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 1.0 77.33 MB

happyflowers is an IP5 project at the University of Applied Sciences and Arts Northwestern Switzerland.

Home Page: https://sacha.me/happyflowers/

HTML 0.30% JavaScript 53.70% CSS 11.83% Haskell 33.55% PLpgSQL 0.61%
react haskell rapsberrypi automation redux

happyflowers's People

Contributors

radlikewhoa avatar rinesch avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kk4ito

happyflowers's Issues

[Web] Input placeholders are buggy in Safari

  • Input placeholders remain visible on name field even if input is present
  • Input placeholders are visible even if number fields are focused when value is deleted / invalid

screen shot 2016-10-13 at 19 11 12

Both are resolved if the user moves the cursor into / out of the input. Seems really weird and I'm not really sure what possible solution there could be.

[Web / API] Extend API configuration

Currently the configuration contains only the password to use for authentication. We should extend that to also contain a setting to determine the time period to use for the history view. Maybe in the end we can include further options if we write the configuration reading code as flexibly as possible.

[RPi / Docs] Connect Chirp! sensor

  • Connect the Chirp! sensor to the RPi and use I2C tools to check if it's working correctly.
  • Read data from the sensor.
  • The connection then needs to be documented in the project report

[RPi / Docs] Connect USB water pump

  • Connect the pump via USB and allow triggering via GPIO. This has already been tested with an LED so it's just a matter of connecting the pump and giving it enough power.
  • The connection then needs to be documented in the project report.

[RPi] Read data from moisture sensor

The moisture sensor needs to be connected to the RPi. Measurements need to happen at a defined interval. Ideally, this process should look as follows:

  1. The procedure is started, an initial measurement is taken. This measurement is an average of measurements from a defined period, e.g. 1 measurement per second over 10 seconds.
  2. The data is added to the database.
  3. The RPi triggers a WS event that informs all connected web clients about the new measurement. (This is something we'll do as part of Milestone 2.)
  4. Get database entries for settings. Check if the latest measurement falls below the lower threshold. If so, initiate automatic watering procedure. This is a separate procedure.
  5. Schedule the procedure itself to run after the interval taken from the settings.

[Web] Listen to data about new measurements, waterings

Subscribe to web socket events raised from new data (e.g. measurements, waterings.) These updates then dispatch Redux actions which in turn update the data on the front end. This communication is entirely one sided, updates from the RPi are only pushed to the web front end, not the other way around.

[Web] Consider adding additional tooling

[Web / RPi] Integrate livestream

In order to provide a livestream we need to have several things ready:

  • Aquire a USB web camera. Any model will do so we can get a rather inexpensive one.
  • Set up and run the server on the RPi. This seems quite simple as motion will do most of the work for us. See this tutorial for more info.
  • Display the livestream on the web front end. The stream is a MJPEG stream. I'm still researching about browser support. We can either include is as an img or we might have to use a wrapper around it. There's multiple JS implementations for such a wrapper, so I think this is a non-issue.

[RPi] Measure temperature using Chirp! sensor

The sensor allows not only measuring moisture levels, but also the current temperature. In the code we need to read from register 5.

This is an enhancement that we could possibly implement if there's enough time.

[RPi] Document setup process in README

This includes all required tools and components, requirements about the environment, and how to install dependencies. After reading this guide, users need to be able to set up the device and start all required processes.

[RPi] Improve mockMoisture

The function currently returns a fixed value, thus preventing the pump procedure from being tested properly. We could possibly implement some sort of RNG to create random numbers, but they'd need to follow a structure so that the process does not keep running indefinitely.

[Web / API] Settings

  • Web: Layout for settings page
  • Web: Pull data from API and display
  • Web: Submit data to API
  • Web: Display information about progress when loading / submitting (see #6)
  • Web: Display notifications for errors / success (see #5)
  • API: GET request to retrieve settings data from sqlite DB
  • API: PUT request to store changed data in sqlite DB

[Web] Integrate loading indicators

This helps the user better understand if there's any loading / processing going on. In the end, this also prevents them from submitting content again.

In the same area we also need to disable submission buttons if a submission is already in progress to avoid duplicate submissions.

[Web] Enable manual pump activation

Users need to be able to activate the pump manually. This is mostly just for demonstration purposes, but it needs to work without errors regardless.

[RPi] Build and run GHC 7.10.3

I figured it might not be too much of an issue, running an older version of GHC, but it turns out that our current codebase doesn't compile against this version of GHC. So we either have to rewrite a lot of code in our codebase or try and get the latest version of GHC running on the RPi.

In theory, this should be as simple as installing the latest version of the Haskell Platform, but there seem to be some bugs surrounding this release.

As long as this issue is not resolved we're unable to install all dependencies, thus not allowing us to build the project on the RPi itself.

[API] Serve web front end as static files through Scotty

Ideally we'd just have to start up the server and it runs both the API and the web front end. Routes for API methods could then be prefixed with "/api/" or something and all other request just redirect to "/index.html" unless a file with that name exists.

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.