-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·40 lines (32 loc) · 862 Bytes
/
run
File metadata and controls
executable file
·40 lines (32 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
HOST=mqtt.openchirp.io
export LOG_LEVEL=5
export FRAMEWORK_SERVER=https://openchirp.io
export MQTT_SERVER=tls://$HOST:8883
# Set the following two lines to your OpenChirp device id and device token
export DEVICE_ID=ffffffffffffffffffffffff
export DEVICE_TOKEN=ffffffffffffffffffffffffffffff
#export INTERVAL=60s
#export DISK_PATH="/"
#export PLUGIN_PATHS=plugins/raspberrypi.so
export PLUGIN_PATHS="plugins/raspberrypi.so;plugins/network.so"
#export SYSTEMD=true
# Install a fake vcgencmd to test the raspberrypi plugin
tempbin=$(mktemp -d)
cat > $tempbin/vcgencmd <<EOF
#!/bin/bash
case \$1 in
measure_temp)
echo "temp=51.0'C"
;;
*)
echo "Error - Unknown command"
;;
esac
EOF
chmod +x $tempbin/vcgencmd
export PATH="$tempbin:$PATH"
# Build the binary first
go build -o sysmonitor-device main.go
./sysmonitor-device
rm -rf $tempbin