GithubHelp home page GithubHelp logo

danielfireman / temp-to-go Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 3.0 6.4 MB

Small IoT project: written in #go and fully based on free, open source libs and infrastructure.

License: MIT License

C++ 7.52% Go 89.28% HTML 3.20%
iot iot-cloud full-stack

temp-to-go's Introduction

Temperature to go

Would you always wanted to know when to turn on the fan or the air conditioner during the night? Good news is that your problem will be solved soon!

Besides solve this very important problem, our small projects has some other goals:

  • Fully implemented in Go (yes, from the device to frontend)
  • Use only free, open source libraries
  • Cheap devices
  • Run on free infrastructure

Status

  • Device configuration and software: Done 😁
  • HTTP API for storing bedroom temperature (crypto): Done 😁
  • Fetch Current Weather Worker: Done 😁
  • Fetch Weather Forecast and Prediction Worker: Done 😁
  • Public HTTP FE: Done 😁
  • Authorzed area: Done 😁
  • Fan control HTTP FE (authorized area): Done 😁
  • Prediction: Done 😁
  • Prediction graphs: Not Started πŸ˜’

Stack

temp-to-go's People

Contributors

danielfireman avatar elisiofilho avatar lucasgomide avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

temp-to-go's Issues

Store decrypted message in a database

The database schema could be very simple and the database technology easily replaceable (not much think in advance exchanged by good software design). The only requirement is that it should be fast to query by date/time range.

Environment variable mandatory

There are some environment variable mandatory for starting web project. Most of them, shouldn't mandatory tough. I'd like to propose addition a fallback for each one env that is not really mandatory to start the application, such as PUBLIC_HTML=/public, MONGODB_URI=mongodb://127.0.0.1:27017/db and PORT=8080

@danielfireman What do you think ? Is it makes sense ?

Move documentation to Wiki

Currently, it is scattered through the code structure. Let's tie stuff together using the github wiki.

Landing page

Now the server is already on Heroku, it would be awesome if we could a cool landing page describing the project and the purpose :)

Fetch weather forecast

Open Weather Maps has an API which allows us to forecast the next 5 days. We could have another worker, which will run daily and fetch this forecast.

Two things to pay attention:

  • Most of our stuff is showed/fetched hourly: the current weather, the prediction
  • There will be an overlap, which should result in an update at the database: for instance, the forecast for tomorrow I got yesterday could be different from the one I get today. Let's assume the difference is more accuracy and update the database straight away.

That said, one could key all our entities by UTC time, always flooring to the zero minute of the current hour. With that, we could roll-up the tuple (weather_current, bedroom_info) keyed by timestamp.

The bedroom temperature forecast for each case could be calculated and stored in a different collection, using the same key.

As we are running free, lets used capped collections to having mong automatically cleaning things up for us.

Create worker

Create a Heroku worker, which should get the current forecast for the following geolocation: @-9.6602869,-35.7059512

OpenWeatherMap accepts geolocated queries and it is the one which has the biggest limit of queries and so on. It also has special conditions for opensource projects.

Send temp-to-go encrypted message

Send an encrypted message to the temp-to-go server. The message can as simple as:

base64 encoded(user_token + device token): 64 bits | op : 8 bits | temperature: 32 bits

Whoever gets this issue should choose the appropriate encryption algorithm (bearing in mind it must run in the device and be unencrypted at the server);

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.