Outdoor is a daemon that pipes current weather information from OpenWeatherMap
into BigClown Hardwario IoT stack. It complements home climatic sensors.
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.
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
Compilation produces a mostly static binary (openssl may be required in runtime).
- Optionally strip debug information:
strip target/release/outdoor
- Copy
target/release/outdoor
to/usr/local/bin/outdoor
- 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
-
Configure the service in
/etc/systemd/system/outdoor.service.d/local.conf
. See all the options by running/usr/local/bin/outdoor --help
. -
Refresh systemd and start the service
systemctl daemon-reload
systemctl start outdoor.service
systemctl status outdoor.service
- If everything works, allow
outdoor.service
to run on start
systemctl enable outdoor.service
Some parts of the code are covered by tests. To check them, run:
cargo test
- how to run on Turris Omnia?
- Test with
cross test --target armv7-unknown-linux-musleabihf
. - Compile with
cross build --target armv7-unknown-linux-musleabihf --release
- 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
This project is licensed under the MIT License - see the LICENSE.md file for details
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.
- 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
BigclownHardwario 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.