Thursday, 18 April 2019
Wednesday, 17 April 2019
Sonoff restart concerns
I just posted this to the WhatsApp "Kilnageer CH 2019" for Bren and Liam to consider.
"I have concerns regarding what state the sonoffs power up into and/or restore after a reboot or wifi drop. See this excellent article:
http://www.thesmarthomehookup.com/end-random-ghost-switching-for-good-by-fixing-your-retain-settings-in-tasmota-and-home-assistant/
I think the safest but least elegant solution is to configure the sonoffs to power up/restart in off but for their controllers (Node-Red web MQTT Dash android app) to publish retained to a shadow topic. And for a Node-Red script to loop every 5 secs to ensure the sonoffs follow these user defined shadow values.
This script can also check for safety concerns and take action. For example, if burner is on but no zones/cylinder to turn it off and e-mail registered users.
I'm setting up a spare router in Shannon to mimic the Kilnageer set-up so I can experient with this solution here before deploying in Kilnageer next visit.
Any questions/suggestions?"
"I have concerns regarding what state the sonoffs power up into and/or restore after a reboot or wifi drop. See this excellent article:
http://www.thesmarthomehookup.com/end-random-ghost-switching-for-good-by-fixing-your-retain-settings-in-tasmota-and-home-assistant/
I think the safest but least elegant solution is to configure the sonoffs to power up/restart in off but for their controllers (Node-Red web MQTT Dash android app) to publish retained to a shadow topic. And for a Node-Red script to loop every 5 secs to ensure the sonoffs follow these user defined shadow values.
This script can also check for safety concerns and take action. For example, if burner is on but no zones/cylinder to turn it off and e-mail registered users.
I'm setting up a spare router in Shannon to mimic the Kilnageer set-up so I can experient with this solution here before deploying in Kilnageer next visit.
Any questions/suggestions?"
Tuesday, 16 April 2019
Will demo sonoff/tasmota light switch in the Men's Shed this morning
https://github.com/arendst/Sonoff-Tasmota/wiki/Button-usage
So three short presses gets the SSID menu up on SSID sonoff_3536-3536 and IP 192.168.4.1
Then got tablet and sonoff to connect to MensShed hotspot (no internet) provided by phone.
192.168.43.103 is the sonoff when its using the MensShed SSID
So three short presses gets the SSID menu up on SSID sonoff_3536-3536 and IP 192.168.4.1
Then got tablet and sonoff to connect to MensShed hotspot (no internet) provided by phone.
192.168.43.103 is the sonoff when its using the MensShed SSID
Sunday, 14 April 2019
Switching from Lua to micro Python to get MQTT connect on NodeMcu to work..
(7:48) rad 11.5 / 10.6 manually turn on zone and burner
(8:11) rad 49.8 / 12.8
Why isn't MQTT Dash updating the icon status every few minutes?
Current Eir router LAN map
5C:CF:7F:40:CD:D0_Wireless 5C:CF:7F:40:CD:D0 192.168.1.100 Tony's Lamp (3536)
2C:3A:E8:07:B8:4F_Wireless 2C:3A:E8:07:B8:4F 192.168.1.103 Extension zone MV (6223)
2C:3A:E8:0F:4D:99_Wireless 2C:3A:E8:0F:4D:99 192.168.1.102 Cylinder MV (3481)
2C:3A:E8:0F:4C:E8_Wireless 2C:3A:E8:0F:4C:E8 192.168.1.101 Bedroom zone MV (3304)
EC:FA:BC:86:D5:E4_Wireless EC:FA:BC:86:D5:E4 192.168.1.108 Oil burner (5604)
2C:3A:E8:4F:4D:02_Wireless 2C:3A:E8:4F:4D:02 192.168.1.106 Living zone MV (3330)
5C:CF:7F:67:29:50_Wireless 5C:CF:7F:67:29:50 192.168.1.107 Shower pump (2384)
(8:11) rad 47.1 / 15.4 burner was off so put it back on
Currently, MQTT Dash is subscribing to "stat/sonoff_6223/POWER" which is "ON" or "OFF" but will only see last value.
But needs to subscribe to "tele/sonoff_6223/STATE" which is published every 5 mins (300 secs) as:
{"Time":"2019-04-14T08:42:33","Uptime":"0T11:33:24","Vcc":3.495,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"vodafone-2124","BSSId":"D0:FF:98:1B:31:3C","Channel":9,"RSSI":76}}
And to change this period on each sonoff to 5 secs. But what script will extract the "ON" field?
(8:49) rad 47.8 / 16.1 but my hands are still cold
(9:25) rad 30.9 / 16.1 (I was messing with MQTT Dash and turned off zone by accident)
Made all seven sonoff static IPs in Eir router (are lamp IP jumped after reboot!)
5C:CF:7F:40:CD:D0_Ethernet 5C:CF:7F:40:CD:D0 192.168.1.115 Tony's Lamp (3536)
2C:3A:E8:07:B8:4F_Wireless 2C:3A:E8:07:B8:4F 192.168.1.101 Extension zone MV (6223)
2C:3A:E8:0F:4D:99_Wireless 2C:3A:E8:0F:4D:99 192.168.1.116 Cylinder MV (3481)
2C:3A:E8:0F:4C:E8_Wireless 2C:3A:E8:0F:4C:E8 192.168.1.103 Bedroom zone MV (3304)
EC:FA:BC:86:D5:E4_Wireless EC:FA:BC:86:D5:E4 192.168.1.105 Oil burner (5604)
2C:3A:E8:4F:4D:02_Wireless 2C:3A:E8:4F:4D:02 192.168.1.106 Living zone MV (3330)
5C:CF:7F:67:29:50_Wireless 5C:CF:7F:67:29:50 192.168.1.107 Shower pump (2384)
(9:57) rad 32.0 / 16.2 (zone was off again!)
"event.payload" no good in "on receive" displays nothing!
"POWER" causes an error message which is something I suppose
"event[POWER]" same message
"print event" missing ; before statement
"print( event );" - print is not defined
"print event ;" missing ; before statement
"$" - $ is not defined
(14:36) rad 16.8 / 14.4
So a bit of a dilemna
So there are currently four ways to turn a sonoff on or off, say for my light
1) Using Node-Red by pointing a browser to: http://192.168.1.105:1880/ui
2) Pressing a MQTT Dash app button
3) Manually pressing the button on each unit
4) Point a browser to the IP address of a sonoff and clicking the"Toggle" button
They will each be done by or cause "ON" or "OFF" to be published to MQTT topic "cmnd/sonoff_3536/POWER". And on being actioned to "stat/sonoff_3536/POWER". If this is done with the "retained" flag set in all four cases then anybody launching the app or going to that website and subscribing to topic "stat/sonoff_3536/POWER" will instantly get the latest sonoff status.
Great write-up
http://www.thesmarthomehookup.com/end-random-ghost-switching-for-good-by-fixing-your-retain-settings-in-tasmota-and-home-assistant/
"switchretain on" using console resulted in:
15:27:04 CMD: switchretain on
15:27:04 MQT: stat/sonoff_3536/RESULT = {"SwitchRetain":"ON"}
"buttonretain on" ..
15:28:13 CMD: buttonretain on
15:28:13 MQT: stat/sonoff_3536/RESULT = {"ButtonRetain":"ON"}
"powerretain on"
15:28:54 CMD: powerretain on
15:28:54 MQT: stat/sonoff_3536/RESULT = {"PowerRetain":"ON"}
(16:22) 16.9 / 17.5 (using the electric fan heater)
Finally trying micro Python
https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html
http://micropython.org/download#esp8266
Flashed to board using NodeMcu PyFlasher (frontend for esptool.py)
Command: esptool.py --port COM8 --baud 115200 --after no_reset write_flash --flash_mode dio 0x00000 C:\Users\kilnageer\Documents\CoderDojo\2018 Reboot\CH Project\NodeMcu\esp8266-20190125-v1.10.bin --erase-all
http://micropython.org/webrepl/
(23:17) Two issues have come to light:
1) Some sonoffs drop LAN connection every few minutes (especially Extension Zone MV)
2) They don't restore their retained setting. A bug? Instead they restore the last one set by Node-Red.
So ensure that Node-Red is used to set the sonoffs. Otherwise their settings can change.
I'll investigate more tomorrow.
(8:11) rad 49.8 / 12.8
Why isn't MQTT Dash updating the icon status every few minutes?
Current Eir router LAN map
5C:CF:7F:40:CD:D0_Wireless 5C:CF:7F:40:CD:D0 192.168.1.100 Tony's Lamp (3536)
2C:3A:E8:07:B8:4F_Wireless 2C:3A:E8:07:B8:4F 192.168.1.103 Extension zone MV (6223)
2C:3A:E8:0F:4D:99_Wireless 2C:3A:E8:0F:4D:99 192.168.1.102 Cylinder MV (3481)
2C:3A:E8:0F:4C:E8_Wireless 2C:3A:E8:0F:4C:E8 192.168.1.101 Bedroom zone MV (3304)
EC:FA:BC:86:D5:E4_Wireless EC:FA:BC:86:D5:E4 192.168.1.108 Oil burner (5604)
2C:3A:E8:4F:4D:02_Wireless 2C:3A:E8:4F:4D:02 192.168.1.106 Living zone MV (3330)
5C:CF:7F:67:29:50_Wireless 5C:CF:7F:67:29:50 192.168.1.107 Shower pump (2384)
(8:11) rad 47.1 / 15.4 burner was off so put it back on
Currently, MQTT Dash is subscribing to "stat/sonoff_6223/POWER" which is "ON" or "OFF" but will only see last value.
But needs to subscribe to "tele/sonoff_6223/STATE" which is published every 5 mins (300 secs) as:
{"Time":"2019-04-14T08:42:33","Uptime":"0T11:33:24","Vcc":3.495,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"vodafone-2124","BSSId":"D0:FF:98:1B:31:3C","Channel":9,"RSSI":76}}
And to change this period on each sonoff to 5 secs. But what script will extract the "ON" field?
(8:49) rad 47.8 / 16.1 but my hands are still cold
(9:25) rad 30.9 / 16.1 (I was messing with MQTT Dash and turned off zone by accident)
Made all seven sonoff static IPs in Eir router (are lamp IP jumped after reboot!)
5C:CF:7F:40:CD:D0_Ethernet 5C:CF:7F:40:CD:D0 192.168.1.115 Tony's Lamp (3536)
2C:3A:E8:07:B8:4F_Wireless 2C:3A:E8:07:B8:4F 192.168.1.101 Extension zone MV (6223)
2C:3A:E8:0F:4D:99_Wireless 2C:3A:E8:0F:4D:99 192.168.1.116 Cylinder MV (3481)
2C:3A:E8:0F:4C:E8_Wireless 2C:3A:E8:0F:4C:E8 192.168.1.103 Bedroom zone MV (3304)
EC:FA:BC:86:D5:E4_Wireless EC:FA:BC:86:D5:E4 192.168.1.105 Oil burner (5604)
2C:3A:E8:4F:4D:02_Wireless 2C:3A:E8:4F:4D:02 192.168.1.106 Living zone MV (3330)
5C:CF:7F:67:29:50_Wireless 5C:CF:7F:67:29:50 192.168.1.107 Shower pump (2384)
(9:57) rad 32.0 / 16.2 (zone was off again!)
"event.payload" no good in "on receive" displays nothing!
"POWER" causes an error message which is something I suppose
"event[POWER]" same message
"print event" missing ; before statement
"print( event );" - print is not defined
"print event ;" missing ; before statement
"$" - $ is not defined
"@" missing name after @
"@.POWER" missing name after @
"@POWER" cannot read property "@"":POWER" from undefined
"val" is not defined
event
"@.POWER" missing name after @
"@POWER" cannot read property "@"":POWER" from undefined
"val" is not defined
event
(10:54) 49.2 / 18.2 turned zone off
(11:16)
event.payload = event.payload.split(',')[6].split(':')[1];
works for a text box
(14:36) rad 16.8 / 14.4
So a bit of a dilemna
So there are currently four ways to turn a sonoff on or off, say for my light
1) Using Node-Red by pointing a browser to: http://192.168.1.105:1880/ui
2) Pressing a MQTT Dash app button
3) Manually pressing the button on each unit
4) Point a browser to the IP address of a sonoff and clicking the"Toggle" button
They will each be done by or cause "ON" or "OFF" to be published to MQTT topic "cmnd/sonoff_3536/POWER". And on being actioned to "stat/sonoff_3536/POWER". If this is done with the "retained" flag set in all four cases then anybody launching the app or going to that website and subscribing to topic "stat/sonoff_3536/POWER" will instantly get the latest sonoff status.
Great write-up
http://www.thesmarthomehookup.com/end-random-ghost-switching-for-good-by-fixing-your-retain-settings-in-tasmota-and-home-assistant/
"switchretain on" using console resulted in:
15:27:04 CMD: switchretain on
15:27:04 MQT: stat/sonoff_3536/RESULT = {"SwitchRetain":"ON"}
"buttonretain on" ..
15:28:13 CMD: buttonretain on
15:28:13 MQT: stat/sonoff_3536/RESULT = {"ButtonRetain":"ON"}
"powerretain on"
15:28:54 CMD: powerretain on
15:28:54 MQT: stat/sonoff_3536/RESULT = {"PowerRetain":"ON"}
(16:22) 16.9 / 17.5 (using the electric fan heater)
Finally trying micro Python
https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html
http://micropython.org/download#esp8266
Flashed to board using NodeMcu PyFlasher (frontend for esptool.py)
Command: esptool.py --port COM8 --baud 115200 --after no_reset write_flash --flash_mode dio 0x00000 C:\Users\kilnageer\Documents\CoderDojo\2018 Reboot\CH Project\NodeMcu\esp8266-20190125-v1.10.bin --erase-all
Worked fine then reset board and used ESPlorer for UART window
MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
Type "help()" for more information.
>>>
>>
help()
help()
Welcome to MicroPython!
For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .
For diagnostic information to include in bug reports execute 'import port_diag'.
Basic WiFi configuration:
import network
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if.scan() # Scan for available access points
sta_if.connect("<AP_name>", "<password>") # Connect to an AP
sta_if.isconnected() # Check for successful connection
# Change name/password of ESP8266's AP:
ap_if = network.WLAN(network.AP_IF)
ap_if.config(essid="<AP_NAME>", authmode=network.AUTH_WPA_WPA2_PSK, password="<password>")
Control commands:
CTRL-A -- on a blank line, enter raw REPL mode
CTRL-B -- on a blank line, enter normal REPL mode
CTRL-C -- interrupt a running program
CTRL-D -- on a blank line, do a soft reset of the board
CTRL-E -- on a blank line, enter paste mode
For further help on a specific object, type help(obj)
>>>
Did above commands to connect
import network
import network
>>>
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
#6 ets_task(4020f4d0, 28, 3fff9e28, 10)
>>>
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
>>> sta_if.scan()
sta_if.scan()
[(b'vodafone-2124', b'\xe8\xab\xfa\xb0\xc4D', 1, -53, 3, 0)]
>>> sta_if.connect("vodafone-2124", PASSWORD )
sta_if.connect("vodafone-2124", PASSWORD )
>>> sta_if.isconnected()
sta_if.isconnected()
True
>>>
| ESP_2871DF_Ethernet | EC:FA:BC:28:71:DF | 192.168.1.112 |
(23:17) Two issues have come to light:
1) Some sonoffs drop LAN connection every few minutes (especially Extension Zone MV)
2) They don't restore their retained setting. A bug? Instead they restore the last one set by Node-Red.
So ensure that Node-Red is used to set the sonoffs. Otherwise their settings can change.
I'll investigate more tomorrow.
Saturday, 13 April 2019
New Eir router in Kilnageer..
Have new Eir router in Kilnageer (installed yesterday) so must reserved IP addresses..
Started debug build of "You successfully commissioned a NodeMCU custom build from the master branch. You selected the following 9 modules: dht file gpio mqtt net node tmr uart wifi." at nodemcu-build.com
nodemcu-master-9-modules-2019-04-13-21-50-11-integer.bin
May move to latest dev build if debug doesn't show anything. Also is my MQTT broker compatible? It's version 1.4.10 whereas MQTT firmware is ..
https://nodemcu.readthedocs.io/en/master/modules/mqtt/#mqttclientpublish
"The client adheres to version 3.1.1 of the MQTT protocol. Make sure that your broker supports and is correctly configured for version 3.1.1. The client is backwards incompatible with brokers running MQTT 3.1."
So that could be an issue. But I was able to publish once upon a time.
_flash_used_end:4026c000
fs.start:70000,max:38b000
_flash_used_end:4026c000
fs.start:70000,max:38a000
_flash_used_end:4026c000
fs.start:80000,max:37b000
_flash_used_end:4026c000
fs.start:80000,max:37a000
mount res: 0, 0
Task task_lua started.
nul mode, fpm auto sleep set:enalbe
NodeMCU custom build by frightanic.com
branch: master
commit: 4905381c004bdeaf744a60bb940c1906c2e052d4
SSL: false
modules: dht,file,gpio,mqtt,net,node,tmr,uart,wifi
build created on 2019-04-13 21:49
powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9)
NodeMcu Kilnageer probe v1.9 13-Apr-19
node ID = 2650591
time now = 277378
uptime = 0
boot reason = 2
Configuring WIFI..
nil
scandone
scandone
> Heap size:34280.
EVENT_DBG(wifi_event_monitor_handle_event_cb): was called (Event:8)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
connected with vodafone-2124, channel 1
dhcp client start...
EVENT_DBG(wifi_event_monitor_handle_event_cb): was called (Event:0)
ESP8266 mode is: 1
The module MAC address is: ee:fa:bc:28:71:df
IP unavaiable, Waiting...
ip:192.168.1.112,mask:255.255.255.0,gw:192.168.1.254
EVENT_DBG(wifi_event_monitor_handle_event_cb): was called (Event:3)
ESP8266 mode is: 1
The module MAC address is: ee:fa:bc:28:71:df
Config done, IP is 192.168.1.112
Instantiating mqttBroker
enter mqtt_socket_client.
NodeMCU_2871df
length username: 4
length password: 14
MQTT: Init info: NodeMcu_2650591, tony, 2016Kilnageer!
leave mqtt_socket_client.
Setting up callbacks
enter mqtt_socket_on.
leave mqtt_socket_on.
enter mqtt_socket_on.
leave mqtt_socket_on.
Making connection to MQTT broker
enter mqtt_socket_connect.
TCP ip is set: 192.168.1.105
TCP port is set: 1883.
enter socket_connect.
leave socket_connect
leave mqtt_socket_connect.
PANIC: unprotected error in call to Lua API (init.lua:136: attempt to call field 'alarm' (a nil value))
So now have debug but still not seeing publish onMQTT.fx !
enter mqtt_socket_timer.
timer, queue size: 0
keep_alive_tick: 5
leave mqtt_socket_timer.
Function platform_gpio_mode() is called. pin_mux:1610614840, func:0
Publishing to temperatures/NodeMcu_2650591: 18
enter mqtt_socket_publish.
Sent: 36
send_if_poss, queue size: 1
publish, queue size: 1
leave mqtt_socket_publish.
Publishing to humidities/NodeMcu_2650591: 44
enter mqtt_socket_publish.
send_if_poss, queue size: 2
publish, queue size: 2
leave mqtt_socket_publish.
enter mqtt_socket_timer.
timer, queue size: 2
event_timeout: 5.
enter deep sleep
Saved code as "init.v1.10_still_doesnt_publish.lua" and tried the dev build next...
nodemcu-dev-9-modules-2019-04-13-22-30-55-integer.bin
No difference! So is it a MQTT version issue? Try a different MQTT broker?
nodemcu-master-7-modules-2019-03-30-20-05-51-integer.bin
master: modules: file,gpio,net,node,tmr,uart,wifi
init.lua.working_tolapark
Trying without debug and I'll add lots of delays and print() s ! And let's make sure we are really connected before we try to publish! or deep sleep
nodemcu-master-9-modules-2019-04-14-00-03-50-integer.bin
| Network | Device | MAC Address | IP Address |
|---|---|---|---|
| 2.4GHz Wireless: | android-84-B5-41-08-B2-02 | 84:B5:41:08:B2:02 | 192.168.1.3 |
| 5C:CF:7F:40:CD:D0_Wireless | 5C:CF:7F:40:CD:D0 | 192.168.1.4 | |
| android-AC-37-43-0B-8D-81 | AC:37:43:0B:8D:81 | 192.168.1.5 | |
| 2C:3A:E8:07:B8:4F_Wireless | 2C:3A:E8:07:B8:4F | 192.168.1.8 | |
| mayo_rpi_zero_logger_3_Wireless | B8:27:EB:C8:19:85 | 192.168.1.9 | |
| 2C:3A:E8:0F:4D:99_Wireless | 2C:3A:E8:0F:4D:99 | 192.168.1.10 | |
| 2C:3A:E8:0F:4C:E8_Wireless | 2C:3A:E8:0F:4C:E8 | 192.168.1.11 | |
| EC:FA:BC:86:D5:E4_Wireless | EC:FA:BC:86:D5:E4 | 192.168.1.12 | |
| 2C:3A:E8:4F:4D:02_Wireless | 2C:3A:E8:4F:4D:02 | 192.168.1.13 | |
| 5C:CF:7F:67:29:50_Wireless | 5C:CF:7F:67:29:50 | 192.168.1.14 |
Sadly cannot use the same ones as Vodafone router so had to reconfigure all 6 sonoffs to use 192.168.1.105 as their MQTT broker.
Luckily, Node-Red was using MQTT topics and "mayo_rpi_zero_logger_3" rather than IP address.
Now back to getting the temp/humidity probes working. The one left on the window sill had died so battery only good for Wed/Thurs/Fri/Sat 4 days tops currently. I want it to be good for 6 months+
Started debug build of "You successfully commissioned a NodeMCU custom build from the master branch. You selected the following 9 modules: dht file gpio mqtt net node tmr uart wifi." at nodemcu-build.com
nodemcu-master-9-modules-2019-04-13-21-50-11-integer.bin
May move to latest dev build if debug doesn't show anything. Also is my MQTT broker compatible? It's version 1.4.10 whereas MQTT firmware is ..
https://nodemcu.readthedocs.io/en/master/modules/mqtt/#mqttclientpublish
"The client adheres to version 3.1.1 of the MQTT protocol. Make sure that your broker supports and is correctly configured for version 3.1.1. The client is backwards incompatible with brokers running MQTT 3.1."
So that could be an issue. But I was able to publish once upon a time.
_flash_used_end:4026c000
fs.start:70000,max:38b000
_flash_used_end:4026c000
fs.start:70000,max:38a000
_flash_used_end:4026c000
fs.start:80000,max:37b000
_flash_used_end:4026c000
fs.start:80000,max:37a000
mount res: 0, 0
Task task_lua started.
nul mode, fpm auto sleep set:enalbe
NodeMCU custom build by frightanic.com
branch: master
commit: 4905381c004bdeaf744a60bb940c1906c2e052d4
SSL: false
modules: dht,file,gpio,mqtt,net,node,tmr,uart,wifi
build created on 2019-04-13 21:49
powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9)
NodeMcu Kilnageer probe v1.9 13-Apr-19
node ID = 2650591
time now = 277378
uptime = 0
boot reason = 2
Configuring WIFI..
nil
scandone
scandone
> Heap size:34280.
EVENT_DBG(wifi_event_monitor_handle_event_cb): was called (Event:8)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
connected with vodafone-2124, channel 1
dhcp client start...
EVENT_DBG(wifi_event_monitor_handle_event_cb): was called (Event:0)
ESP8266 mode is: 1
The module MAC address is: ee:fa:bc:28:71:df
IP unavaiable, Waiting...
ip:192.168.1.112,mask:255.255.255.0,gw:192.168.1.254
EVENT_DBG(wifi_event_monitor_handle_event_cb): was called (Event:3)
ESP8266 mode is: 1
The module MAC address is: ee:fa:bc:28:71:df
Config done, IP is 192.168.1.112
Instantiating mqttBroker
enter mqtt_socket_client.
NodeMCU_2871df
length username: 4
length password: 14
MQTT: Init info: NodeMcu_2650591, tony, 2016Kilnageer!
leave mqtt_socket_client.
Setting up callbacks
enter mqtt_socket_on.
leave mqtt_socket_on.
enter mqtt_socket_on.
leave mqtt_socket_on.
Making connection to MQTT broker
enter mqtt_socket_connect.
TCP ip is set: 192.168.1.105
TCP port is set: 1883.
enter socket_connect.
leave socket_connect
leave mqtt_socket_connect.
PANIC: unprotected error in call to Lua API (init.lua:136: attempt to call field 'alarm' (a nil value))
So now have debug but still not seeing publish onMQTT.fx !
enter mqtt_socket_timer.
timer, queue size: 0
keep_alive_tick: 5
leave mqtt_socket_timer.
Function platform_gpio_mode() is called. pin_mux:1610614840, func:0
Publishing to temperatures/NodeMcu_2650591: 18
enter mqtt_socket_publish.
Sent: 36
send_if_poss, queue size: 1
publish, queue size: 1
leave mqtt_socket_publish.
Publishing to humidities/NodeMcu_2650591: 44
enter mqtt_socket_publish.
send_if_poss, queue size: 2
publish, queue size: 2
leave mqtt_socket_publish.
enter mqtt_socket_timer.
timer, queue size: 2
event_timeout: 5.
enter deep sleep
Saved code as "init.v1.10_still_doesnt_publish.lua" and tried the dev build next...
nodemcu-dev-9-modules-2019-04-13-22-30-55-integer.bin
No difference! So is it a MQTT version issue? Try a different MQTT broker?
nodemcu-master-7-modules-2019-03-30-20-05-51-integer.bin
master: modules: file,gpio,net,node,tmr,uart,wifi
nodemcu-master-10-modules-2019-03-31-09-32-28-integer.bin
master: modules: dht,ds18b20,file,gpio,mqtt,net,node,tmr,uart,wifi
Trying without debug and I'll add lots of delays and print() s ! And let's make sure we are really connected before we try to publish! or deep sleep
nodemcu-master-9-modules-2019-04-14-00-03-50-integer.bin
Wednesday, 10 April 2019
Fixing MQTT temp probes..
(7:41) 33.6 / 11.8 (after extn zone and burner on for 10 mins)
Today I must find out why the NodeMcu thinks it has successfully published to the MQTT broker but the broker has seen nothing.
So I can change QoS from 0 to 2 and/or try a different broker.
(8:02) rad 50.3 / 14.6 and very sunny out streaming in through window
(8.07) rad 50.8 / 15.2
(8.18) rad 50.2 / 16.1 (warm enough - so off burner and zone using MQTT Dash app :) )
(8:31) rad 44.1 / 17.1
Also I'm using old firmware because I couldn't get the timer working with the latest stuff!
Good next the DHT11 probe is still working since yesterday afternoon? even with red LED on all the time :)
(8:52) rad 34.8/ 17.4 -still comfortable - so CH staying off
(10:03) rad 20.3 / 16.7 still sun streaming in and comfortable (no CH on)
Today I must find out why the NodeMcu thinks it has successfully published to the MQTT broker but the broker has seen nothing.
So I can change QoS from 0 to 2 and/or try a different broker.
(8:02) rad 50.3 / 14.6 and very sunny out streaming in through window
(8.07) rad 50.8 / 15.2
(8.18) rad 50.2 / 16.1 (warm enough - so off burner and zone using MQTT Dash app :) )
(8:31) rad 44.1 / 17.1
Also I'm using old firmware because I couldn't get the timer working with the latest stuff!
Good next the DHT11 probe is still working since yesterday afternoon? even with red LED on all the time :)
(8:52) rad 34.8/ 17.4 -still comfortable - so CH staying off
(10:03) rad 20.3 / 16.7 still sun streaming in and comfortable (no CH on)
Tuesday, 9 April 2019
Updated the Kilnageer CH hot press
1) Put back the original three miniature sonoffs as they now have Tasmota firmware
This means physically:
sonoff_7932 replaced by sonoff_3481 (192.168.1.49) - controls cylinder MV
sonoff_2613 replaced by sonoff_6223 (192.168.1.50) - controls XX zone MV (see below)
This means physically:
sonoff_7932 replaced by sonoff_3481 (192.168.1.49) - controls cylinder MV
sonoff_2613 replaced by sonoff_6223 (192.168.1.50) - controls XX zone MV (see below)
sonoff_3330 replaced by sonoff_3304 (192.168.1.51) - controls YY zone MV (see below)
But as the live output wires of sonoff_6223 and sonoff_3304 are swapped over from the originals, functionally we have:
sonoff_2613 did power yellow/green live wire to zone XX (now handled by sonoff_3304)
sonoff_3330 did power blue live wire to Extension zone (now handled by sonoff_6223)
2) Also wired the shower pump to sonoff_2384 (192.168.1.6)
Here's a complete list of active sonoffs on the LAN:
sonoff_3330-3330 192.168.1.8 2C:3A:E8:4F:4D:02 Living zone MV
mayo_rpi_zero_logger_3 192.168.1.4 B8:27:EB:C8:19:85 function?
tola_living_room 192.168.1.48 B8:27:EB:EB:F1:B6 function?
But as the live output wires of sonoff_6223 and sonoff_3304 are swapped over from the originals, functionally we have:
sonoff_2613 did power yellow/green live wire to zone XX (now handled by sonoff_3304)
sonoff_3330 did power blue live wire to Extension zone (now handled by sonoff_6223)
2) Also wired the shower pump to sonoff_2384 (192.168.1.6)
Here's a complete list of active sonoffs on the LAN:
sonoff_3330-3330 192.168.1.8 2C:3A:E8:4F:4D:02 Living zone MV
sonoff_2384-2384 192.168.1.6 5C:CF:7F:67:29:50 Shower pump
sonoff_5604-5604 192.168.1.2 EC:FA:BC:86:D5:E4 Oil burner
sonoff-3304 192.168.1.49 2C:3A:E8:0F:4C:E8 Bedroom zone MV
sonoff-6223 192.168.1.50 2C:3A:E8:07:B8:4F Extension zone MV
sonoff-3481 192.168.1.51 2C:3A:E8:0F:4D:99 Cylinder MV
And of Raspberry Pi's on the LANsonoff-6223 192.168.1.50 2C:3A:E8:07:B8:4F Extension zone MV
sonoff-3481 192.168.1.51 2C:3A:E8:0F:4D:99 Cylinder MV
mayo_rpi_zero_logger_3 192.168.1.4 B8:27:EB:C8:19:85 function?
tola_living_room 192.168.1.48 B8:27:EB:EB:F1:B6 function?
And of NodeMcu temperature/humidity sensors:
NODE-E9F4A 192.168.1.42 68:C6:3A:E9:F4:0A Function?
NODE-2871DF 192.168.1.43 EC:FA:BC:28:71:DF Function?
NODE-927154 192.168.1.44 84:0D:8E:92:71:54 Function?
NODE-2743B4 192.168.1.45 EC:FA:BC:27:43:B4 Function?
NOTE: Vodafone router also shows old devices which have since been removed:
sonoff_2613 ?
sonoff_2932-2934 192.168.1.10 5C:CF:7F:67:2B:76 function?
sonoff_3536-3536 192.168.1.41 5C:CF:7F:40:CD:D0 Tony's bedroom lamp
sonoff_7932 ?
sonoff_7613-7613 192.168.1.9 2C:3A:E8:4E:7D:BD
sonoff_5cf5 192.168.1.7 5C:CF:7F:42:8F:F5 Living zone MV (not tasmota)
Node-Red
Uses switch nodes to publish "ON" or "OFF" to sonoff topics like "cmnd/sonoff_5604/POWER" (with QoS not defined) which will directly control the Wifi switch (if it is powered on). But displays the switch's status by subscribing to a different topic "+/sonoff_5604/+" QoS 2
sonoff_5604 burner on/off
sonoff_6223 extension zone MV
sonoff_7613 living zone MV
sonoff_3481 cylinder MV
sonoff_3304 Bedroom zone MV
NODE-E9F4A 192.168.1.42 68:C6:3A:E9:F4:0A Function?
NODE-2871DF 192.168.1.43 EC:FA:BC:28:71:DF Function?
NODE-927154 192.168.1.44 84:0D:8E:92:71:54 Function?
NODE-2743B4 192.168.1.45 EC:FA:BC:27:43:B4 Function?
NOTE: Vodafone router also shows old devices which have since been removed:
sonoff_2613 ?
sonoff_2932-2934 192.168.1.10 5C:CF:7F:67:2B:76 function?
sonoff_3536-3536 192.168.1.41 5C:CF:7F:40:CD:D0 Tony's bedroom lamp
sonoff_7932 ?
sonoff_7613-7613 192.168.1.9 2C:3A:E8:4E:7D:BD
sonoff_5cf5 192.168.1.7 5C:CF:7F:42:8F:F5 Living zone MV (not tasmota)
Node-Red
Uses switch nodes to publish "ON" or "OFF" to sonoff topics like "cmnd/sonoff_5604/POWER" (with QoS not defined) which will directly control the Wifi switch (if it is powered on). But displays the switch's status by subscribing to a different topic "+/sonoff_5604/+" QoS 2
sonoff_5604 burner on/off
sonoff_6223 extension zone MV
sonoff_7613 living zone MV
sonoff_3481 cylinder MV
sonoff_3304 Bedroom zone MV
Subscribe to:
Posts (Atom)