Saturday, 13 April 2019

New Eir router in Kilnageer..

Have new Eir router in Kilnageer (installed yesterday) so must reserved IP addresses..

NetworkDeviceMAC AddressIP Address
2.4GHz Wireless:android-84-B5-41-08-B2-0284:B5:41:08:B2:02192.168.1.3
5C:CF:7F:40:CD:D0_Wireless5C:CF:7F:40:CD:D0192.168.1.4
android-AC-37-43-0B-8D-81AC:37:43:0B:8D:81192.168.1.5
2C:3A:E8:07:B8:4F_Wireless2C:3A:E8:07:B8:4F192.168.1.8
mayo_rpi_zero_logger_3_WirelessB8:27:EB:C8:19:85192.168.1.9
2C:3A:E8:0F:4D:99_Wireless2C:3A:E8:0F:4D:99192.168.1.10
2C:3A:E8:0F:4C:E8_Wireless2C:3A:E8:0F:4C:E8192.168.1.11
EC:FA:BC:86:D5:E4_WirelessEC:FA:BC:86:D5:E4192.168.1.12
2C:3A:E8:4F:4D:02_Wireless2C:3A:E8:4F:4D:02192.168.1.13
5C:CF:7F:67:29:50_Wireless5C:CF:7F:67:29:50192.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

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


No comments:

Post a Comment