Giter VIP home page Giter VIP logo

outdoor's Introduction

Outdoor

Outdoor is a daemon that pipes current weather information from OpenWeatherMap into BigClown Hardwario IoT stack. It complements home climatic sensors.

Warning

This an educational project. It helps me to learn Rust while doing a project that makes sense. Most likely you know rust much better than I do.

Getting Started

A recent cargo is required to compile the project. It uses async therefore circa a version 1.40 is necessary. Just run:

cargo build --release

Installing

Compilation produces a mostly static binary (openssl may be required in runtime).

  1. Optionally strip debug information: strip target/release/outdoor
  2. Copy target/release/outdoor to /usr/local/bin/outdoor
  3. Install the systemd service file:
cp resources/outdoor.service /etc/systemd/system/outdoor.service
cp -r resources/outdoor.service.d/ /etc/systemd/system/outdoor.service.d
  1. Configure the service in /etc/systemd/system/outdoor.service.d/local.conf. See all the options by running /usr/local/bin/outdoor --help.

  2. Refresh systemd and start the service

systemctl daemon-reload
systemctl start outdoor.service
systemctl status outdoor.service
  1. If everything works, allow outdoor.service to run on start
systemctl enable outdoor.service

Running the tests

Some parts of the code are covered by tests. To check them, run:

cargo test

Cross compiling

  • how to run on Turris Omnia?
  1. Test with cross test --target armv7-unknown-linux-musleabihf.
  2. Compile with cross build --target armv7-unknown-linux-musleabihf --release
  3. Strip the binary:
docker run --rm -it \
    -v $PWD/target/armv7-unknown-linux-musleabihf/release/:/project \
    rustembedded/cross:armv7-unknown-linux-musleabihf-0.2.0 \
    /usr/local/arm-linux-musleabihf/bin/strip /project/outdoor

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Contributing

You may submit pull requests, it is open source ๐Ÿ˜ƒ

  • Please respect the limited scope of this project. The use case is fairly limited.
  • Explain the reasoning behind the PR. It may not be obvious to novice rustaceans such as me.
  • Please dedicate the pull request to single change. It makes no sense to change dependecies, do refactoring and change code style at once.
  • Write tests for fragile pieces of code.
  • Structure your commits, name them clearly.
  • Run rustfmt where possible.
  • Try to avoid creating new clippy warnings.
  • Be nice ๐Ÿ˜ƒ and have fun.

Acknowledgments

  • Thanks Broderick Carlin for the openweather crate. As it has not been updated to async yet, I took the liberty of copying essential parts of the weather API client code for outdoor.
  • Thanks Bigclown Hardwario IoT platform for its open and well documented design. It allowed me to focus on the rust part of development.
  • Thanks OpenWeather for the weather information and a free API tier.

outdoor's People

Contributors

dependabot[bot] avatar radekdvorak avatar

Watchers

 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.