Code by Scott שאול בן ישוע
README.md 1.12 KB
Newer Older
Sha'ul ben Yeshua's avatar
Sha'ul ben Yeshua committed
1
2
3
4
# Monitor & Information Rest API for Raspberry PI

This is a very lean little project based on SpringBoot 2.0M7 and [Pi4J](http://pi4j.com).

Scott Grayban's avatar
edits    
Scott Grayban committed
5
6
Git Clone in /root

Sha'ul ben Yeshua's avatar
Sha'ul ben Yeshua committed
7
8
# Pre-requisites

Scott Grayban's avatar
edits    
Scott Grayban committed
9
10
* [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) - apt install oracle-java8-jdk
* [Maven 3x](https://maven.apache.org/download.cgi) - apt install maven
Sha'ul ben Yeshua's avatar
Sha'ul ben Yeshua committed
11

Scott Grayban's avatar
edits    
Scott Grayban committed
12
# Build as root
Sha'ul ben Yeshua's avatar
Sha'ul ben Yeshua committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

Simply

```bash
mvn clean install
```

# Install on Pi to Start at Boot Up

```bash
sudo nano /etc/rc.local
```

Then add the below line above the last one (that exits)

```bash
Sha'ul ben Yeshua's avatar
Sha'ul ben Yeshua committed
29
java -jar /root/raspberrypi.monitor/target/raspberrypi.janipi-0.0.1-SNAPSHOT.jar &
Sha'ul ben Yeshua's avatar
Sha'ul ben Yeshua committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
```

# Usage

```
http://raspberrypi:8080/api/pi
```

Would yield something like this:

```json
{
"cpuTemperature": 52.1,
"serialNumber": "0000000000000000",
"cpuCoreVoltage": 1.2,
"modelName": "ARMv7 Processor rev 4 (v7l)",
"boardType": "RaspberryPi_3B",
"totalMemory": 967700480,
"usedMemory": 221253632,
"freeMemory": 401907712,
"sharedMemory": 14475264,
"javaVersion": "1.8.0_152",
"hostname": "raspberrypi",
"ipAddresses": [
"192.168.1.40",
"172.17.0.1"
],
"cpuFrequency": 600000000
}
```