-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.h.local
46 lines (37 loc) · 1.54 KB
/
Config.h.local
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
// Print debug logs to Serial {TRUE/FALSE}
#define DEBUG TRUE
// Enable Dallas Temperature {TRUE/FALSE}
#define TEMP_SENSOR_ON FALSE
// WiFi Network configuration
#define STAHOSTNAME "esp8266-moisture-sensor-01"
#define STASSID ""
#define STAPSK ""
// Static network configuration
#define IPADDRESS_CONFIG ip(192, 168, 0, 101)
#define GATEWAY_CONFIG gateway(192, 168, 0, 1)
// Network mask
#define SUBNET_CONFIG subnet(255, 255, 255, 0)
#define WIFI_RECONNECT_ON_FAILURE_MS 500
// MQTT server configuration
#define MQTTSERVER "192.168.0.54"
#define MQTTPORT 1883
#define MQTT_CLIENT_NAME "arduino_moisture_sensor_01"
#define CONNECT_MQTT_TIMEOUT_MS 5e3
// wait timeout in micro seconds to let Moisture sensor booting after being powered on
#define DHT_INITIALIZE_TIMEOUT_MS 500
// Digital pin connected to the base of NPN transistor
#define DHT_KEY_PIN 12
#define TEMP_SENSOR_PIN D5
#define DEEP_SLEEP_MS 600e3
#define SERIAL_SPEED_BAUD 115200
#define SERIAL_TIMEOUT_MS 200
#define DEEP_SLEEP_TOPIC "device/name/moistureSensor01/deepSleep"
#define MQTT_VALUE_TOPIC "moistureSensor01/level"
#define MQTT_TEMP_TOPIC "moistureSensor01/temp"
#define NUMBER_OF_MEASUREMENTS 20
#define DELAY_BETWEEN_MEASUREMENTS_MS 50
// Updates Moisture Sensor readings every X micro seconds when in NON deep sleep mode
#define DHT_READ_INTERVAL_NON_SLEEP_MODE_MS 5e3
// Timeout before publishing sensors data and going into sleep mode in deep sleep mode.
// This timout is required to be able to get MQTT message to switch sleep mode off
#define START_STATION_TIMEOUT_IN_SLEEP_MODE_MS 1500