2022-10-05 11:19:47 +00:00
|
|
|
# Raspberry Pi calendar/temperature monitoring station
|
2021-07-24 19:46:52 +00:00
|
|
|
|
2022-10-05 11:19:47 +00:00
|
|
|
For more details see https://fliegendewurst.github.io/raspberry-pi-temperature-monitoring.html
|
|
|
|
|
|
|
|
The used OLED display is from [Waveshare](https://www.waveshare.com/wiki/1.5inch_RGB_OLED_Module)
|
2022-05-06 09:03:11 +00:00
|
|
|
|
2021-07-24 19:46:52 +00:00
|
|
|
## Quick start
|
|
|
|
|
2022-05-06 08:48:38 +00:00
|
|
|
```bash
|
2021-07-24 19:46:52 +00:00
|
|
|
> nix-shell
|
|
|
|
> rustup target add arm-unknown-linux-musleabihf
|
|
|
|
> cargo build --release --target arm-unknown-linux-musleabihf
|
2022-06-20 13:35:05 +00:00
|
|
|
> scp target/arm-unknown-linux-musleabihf/release/{display_all,display_off,refresh_json,take_measurement,status_check_example} 'pi@raspberrypi:~'
|
2022-05-06 08:51:30 +00:00
|
|
|
> # on the Pi, create sensors.db and events.json
|
2022-06-20 13:35:05 +00:00
|
|
|
> ./status_check_example > /run/user/1000/status.json
|
2023-10-03 13:07:10 +00:00
|
|
|
> patchelf --set-interpreter /lib/ld-musl-armhf.so.1 display_all
|
2022-05-06 08:48:38 +00:00
|
|
|
> ./display_off on
|
|
|
|
> ./display_all sensors.db events.json temps
|
|
|
|
```
|
2021-07-24 19:46:52 +00:00
|
|
|
|
2023-10-03 13:07:10 +00:00
|
|
|
### Cross compile from NixOS x86_64
|
|
|
|
|
|
|
|
Make sure to configure nixpkgs and [nur](https://github.com/nix-community/NUR) below.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
> nix-build -I nixpkgs=.../nixpkgs -I nur=.../nur-packages --arg crossSystem '(import <nixpkgs/lib>).systems.examples.muslpi' .../nur-packages -A raspi-oled-cross
|
|
|
|
> mkdir /tmp/nixstore
|
|
|
|
> nix copy --extra-experimental-features nix-command --extra-experimental-features flakes --no-check-sigs --to /tmp/nixstore $(readlink -f result)
|
|
|
|
> rsync -r --links --info=progress --compress /tmp/nixstore/nix pi@himbeere-null:~/
|
|
|
|
```
|
|
|
|
|
|
|
|
On the Pi:
|
|
|
|
```bash
|
|
|
|
> sudo mv nix /
|
|
|
|
> sudo patchelf --set-interpreter /lib/ld-musl-armhf.so.1 /nix/store/*-raspi-oled-*-infdev-*/bin/*
|
|
|
|
```
|
|
|
|
|
2021-07-24 19:46:52 +00:00
|
|
|
## Example
|
|
|
|
|
2022-05-06 09:03:11 +00:00
|
|
|
![temperature graph](./images/temps.png)
|
|
|
|
|
|
|
|
![events](./images/events.png)
|
2021-07-24 19:46:52 +00:00
|
|
|
|
2022-09-24 18:54:48 +00:00
|
|
|
(the blue text seen in the second image is bright enough on the real OLED display)
|
2023-10-03 12:35:45 +00:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
Copyright 🄯 2022-2023 FliegendeWurst
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
See [`LICENSE`]. Applies to all files except the ones listed below.
|
|
|
|
|
|
|
|
`src/rpi.raw` is the Raspberry Pi logo. Raspberry Pi is a trademark of Raspberry Pi Ltd.
|