Currently provides a simple spring boot implementation of a logger for temperature data from 1 or more DB18B20 sensors connected to a Pi or Pi Zero.
This application will only succesfully run on a Rasperry Pi with 1 or more sensors connected.
The data is stored in an H2 database ~/.temperature/data
See http://localhost:8080/swagger-ui.html for documentation of the resources.
These resources are all GET requests and the URL is relative to the base. If running as a spring boot standalone application this will be http://localhost:8080 and will vary if deployed in tomcat.
Get the current temperature recorded by the sensor with the specified ID as a url path parameter.
Get all available IDs
19.625
[
"28-0517602a31ff",
"28-051760a9aaff"
]
Get the temperature readings for all connected sensors.
{
"28-0517602a31ff": 19.625,
"28-051760a9aaff": 18.562
}
Returns the count of the number of records recorded for the named sensor
http://localhost:8080/data/28-051760a9aaff/record/count
6261
To generate an executable jar run (this should be machine agnostic, build your your PC and run on the pi).
$ gradle build
Then to run the application:
$ java -jar pi-temp-sensor-rest-{version}.jar