Compare commits

...

3 Commits

Author SHA1 Message Date
Wolfgang Hottgenroth
02669c0bb5 adjusted for mains switch 2015-09-13 22:05:36 +02:00
Wolfgang Hottgenroth
b688303694 adjust to home env 2015-09-11 13:47:00 +02:00
46da9841f5 Added tag WORK1 for changeset 0531633c9861 2015-09-11 11:32:46 +02:00
3 changed files with 9 additions and 8 deletions

1
.hgtags Normal file
View File

@ -0,0 +1 @@
0531633c9861badfe49895326f72fedf3b758282 WORK1

View File

@ -1,6 +1,6 @@
-- Constants
SSID = "Kinderland"
APPWD = "test1234"
SSID = "MessWLAN"
APPWD = "UNVmpwbr6heQnMQ7ykXT"
CMDFILE = "mqtt.lua"
-- Some control variables

View File

@ -1,12 +1,12 @@
BROKER = "192.168.87.100"
BROKER = "172.16.2.15"
BRPORT = 1883
BRUSER = ""
BRPWD = ""
CLIENTID = "ESP8266-" .. node.chipid()
SWITCH_PIN = 0
SWITCH_PIN = 3
SWITCH_ID = 0
SWITCH_ID = 1
topics = {"IoT/Watchdog", "IoT/Switch" .. SWITCH_ID}
TOPIC_WATCHDOG = 1
@ -82,7 +82,7 @@ function run_main_prog()
switch_state = false
elseif (topic == topics[TOPIC_SWITCH] and data == "switch toggle") then
switch_state = not switch_state
elseif (topic == topics[TOPIC_WATCHDOG] and data == "wauwau") then
elseif (topic == topics[TOPIC_WATCHDOG] and data == "WauWau!") then
print("9")
tmr.alarm(4, 60000, 1, alarm)
end
@ -90,9 +90,9 @@ function run_main_prog()
if (switch_state ~= old_switch_state) then
old_switch_state = switch_state
if (switch_state) then
gpio.write(SWITCH_PIN, gpio.HIGH)
else
gpio.write(SWITCH_PIN, gpio.LOW)
else
gpio.write(SWITCH_PIN, gpio.HIGH)
end
end
end