-
Notifications
You must be signed in to change notification settings - Fork 1
/
create-garden-monitor-uno.sh
52 lines (38 loc) · 1.32 KB
/
create-garden-monitor-uno.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
echo ""
echo "Creating garden monitor ESP8266 configuration"
echo ""
# Example:
# sh create-garden-monitor-esp.sh [Label] [DeviceName] [Port]
# sh create-garden-monitor-esp.sh "Monitor1" monitor1 ttyUSB0
DIR=$PWD
DEVICE_LABEL=$1
DEVICE_NAME=$2
DEVICE_PORT=$3
if [ ! $DEVICE_LABEL ]; then
DEVICE_LABEL="Monitor1"
fi
if [ ! $DEVICE_NAME ]; then
DEVICE_NAME="monitor1"
fi
if [ ! $DEVICE_PORT ]; then
DEVICE_PORT="ttyUSB0"
fi
echo "Device label: $DEVICE_LABEL"
echo "Device name: $DEVICE_NAME"
echo "Device port: $DEVICE_PORT"
# Set up mobile UI
#echo "Setting up Linear MQTT Dashboard UI..." && \
# TODO: Remove if not needed. Supervisor now takes care of creating the Linear MQTT Dashboard UI
#sh create-garden-monitor-ui.sh $DEVICE_LABEL $DEVICE_NAME $DEVICE_PORT && \
# Create device info
sh create-device-info.sh uno monitor SoilMoistureSensorCalibratedSerial $DEVICE_LABEL $DEVICE_NAME $DEVICE_PORT && \
# Set up MQTT bridge service
sh create-mqtt-bridge-service.sh monitor $DEVICE_NAME $DEVICE_PORT && \
# Set up update service
#sh create-updater-service.sh monitor uno $DEVICE_NAME $DEVICE_PORT && \
# Uploading sketch
#sh upload-monitor-uno-sketch.sh $DEVICE_PORT && \
# Display the device details
#echo "Device info:"
#sh view-garden-device.sh $DEVICE_NAME && \
echo "Garden monitor created with device name '$DEVICE_NAME'"