forked from tsymbaliuk/ESP8266-Tiny-Door-and-Window-Sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.lua
83 lines (71 loc) · 2.89 KB
/
config.lua
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
--------------------------------------
-- NodeMCU I/O Index vs. ESP GPIO
--------------------------------------
-- I/O ESP GPIO I/O ESP GPIO
-- 0 GPIO16 7 GPIO13
-- 1 GPIO5 8 GPIO15
-- 2 GPIO4 9 GPIO3
-- 3 GPIO0 10 GPIO1
-- 4 GPIO2 11 GPIO9
-- 5 GPIO14 12 GPIO10
-- 6 GPIO12
----------------------------------------------------------
-- Wifi config
----------------------------------------------------------
SSID = "xxxxx"
PASSWD = "xxxxx"
----------------------------------------------------------
-- Sensor ID - Unique identifier
----------------------------------------------------------
SENSOR_ID = "1"
----------------------------------------------------------
-- The service to use (choose one and configure the corresponding "..._request.lua" script)
----------------------------------------------------------
api_request = "arrestdb_request"
--api_request = "openhab_request"
--api_request = "iftft_maker_request"
--api_request = "thingspeak_request"
--api_request = "pushingbox_request"
----------------------------------------------------------
-- Pin for the switch signal
-- Pin1=GPIO5
----------------------------------------------------------
switch_pin = 1
----------------------------------------------------------
-- Pin that signals the ATtiny to shut down the vreg
-- Pin2=GPIO4
----------------------------------------------------------
shutdown_signal_pin = 2
----------------------------------------------------------
-- Activity, Error and OK LED
-- Pin5=GPIO14, Pin6=GPIO12, Pin7=GPIO13
----------------------------------------------------------
act_led_pin = 5
ok_led_pin = 6
error_led_pin = 7
----------------------------------------------------------
-- OPTIONAL FEATURES
-- To activate a feature set it to true
----------------------------------------------------------
----------------------------------------------------------
-- Get the Wifi strength (OPTIONAL)
-- note: it takes about 1-2 second longer to connect to the ap if activated
----------------------------------------------------------
GET_WIFI_STRENGTH = false
----------------------------------------------------------
-- Get the Temperature (OPTIONAL)
----------------------------------------------------------
GET_DS_TEMPERATURE = false
----------------------------------------------------------
-- ds18b20 data pin - Pin3=GPIO0
tempsensor_pin = 3
----------------------------------------------------------
-- Get the Battery voltage (OPTIONAL)
----------------------------------------------------------
GET_BATTERY_VOLTAGE = false
----------------------------------------------------------
-- resistor values for the voltage divider
r1 = 47000 -- (r5 in the schematic)
r2 = 10000 -- (r4 in the schematic)
-- internal reference voltage of the adc (turns out the reference voltage isn't exactly 1.0V)
vref = 0.984 -- reference voltage on one of my ESP-12 modules