https://github.com/albertus82/raspberrypi-cpu-logger
Send Raspberry Pi CPU frequency and temperature to ThingSpeak.
https://github.com/albertus82/raspberrypi-cpu-logger
clock cpu-frequency cpu-monitoring cpu-temperature frequency log logger raspberry-pi raspberrypi temperature thingspeak
Last synced: 4 months ago
JSON representation
Send Raspberry Pi CPU frequency and temperature to ThingSpeak.
- Host: GitHub
- URL: https://github.com/albertus82/raspberrypi-cpu-logger
- Owner: albertus82
- License: mit
- Created: 2020-03-14T12:41:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T19:15:58.000Z (about 2 years ago)
- Last Synced: 2024-05-21T20:29:22.747Z (about 2 years ago)
- Topics: clock, cpu-frequency, cpu-monitoring, cpu-temperature, frequency, log, logger, raspberry-pi, raspberrypi, temperature, thingspeak
- Language: Java
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Raspberry Pi CPU Logger
=======================
[](https://github.com/albertus82/raspberrypi-cpu-logger/actions)
[](https://snyk.io/test/github/albertus82/raspberrypi-cpu-logger?targetFile=pom.xml)
Log [Raspberry Pi](https://www.raspberrypi.org) CPU frequency and temperature to [ThingSpeak](https://thingspeak.com).
## Requirements
* Java Runtime Environment 11 (either OpenJDK 11 included in Raspbian Buster or [BellSoft Liberica](https://bell-sw.com) JRE 11 is good)
* [ThingSpeak](https://thingspeak.com) account (available for free)
## Download
`git clone https://github.com/albertus82/raspberrypi-cpu-logger.git`
## Configuration
Put the **Write API Key** associated with your ThingSpeak channel (e.g. `1234567890ABCDEF`) into a text file named `api.key` in the `conf` directory.
## Usage
Launch the program via the shell script `start.sh` and use CTRL+C to terminate, or [install the program as a service](#install-as-a-service).
## Example
:warning: **Don't forget to replace `WRITE_API_KEY` with your actual ThingSpeak Write API Key!**
```sh
git clone https://github.com/albertus82/raspberrypi-cpu-logger.git
cd raspberrypi-cpu-logger
echo WRITE_API_KEY > conf/api.key
./start.sh
```
## Install as a service
:warning: **Don't forget to replace `WRITE_API_KEY` with your actual ThingSpeak Write API Key!**
```sh
cd /opt
sudo git clone https://github.com/albertus82/raspberrypi-cpu-logger.git
cd raspberrypi-cpu-logger
echo WRITE_API_KEY | sudo tee conf/api.key
sudo chmod 640 conf/api.key
printf '[Unit]\nDescription=CPU Logger\nAfter=network.target\n\n[Service]\nExecStart=/opt/raspberrypi-cpu-logger/start.sh\nUser=root\nTimeoutStopSec=5min\n\n[Install]\nWantedBy=multi-user.target\n' | sudo tee /etc/systemd/system/raspberrypi-cpu-logger.service
sudo systemctl enable raspberrypi-cpu-logger
sudo service raspberrypi-cpu-logger restart
```