The TCP Disconnect event does not seem to be related to any other event... are you using lwIP 2.0 or 1.4?
NodeMCU/Espurna losing track of time?
First of all, I should congratulate you for the work, your project is amazing! I've been using Espurna for a few weeks now and it's awesome.
I've been having an issue recently that I thought might be interesting to share. I have two NodeMCU Lolin that I use with BME280 and MH-Z19B sensors. For some reasons, I can see there are periods where no readings are sent and the NodeMCU are not connected to my WiFi (as I can see through my router admin page). During those times, the NodeMCU still seem to be on though. I can see the led of sensor MH-Z19B still blinks, and the NodeMCU isn't in AP mode. Eventually after some time, the NodeMCU comes back on the network and starts sending sensor readings again. This doesn't seem to be a restart (see log below).
Precisely, in my NodeRED dashboard listening to mqtt messages, I see a temperature reading of 19.2 at 11:14, and then the next reading is 19.1 at 12:13. So I have a one hour gap.
It was plugged to my computer with putty listening to serial. Here is the relevant section of the output log (full log attached):
 [MQTT] Sending /NodeMCUBedroom/temperature => 19.2 (PID 1211)  [MQTT] Sending /NodeMCUBedroom/pressure => 996.27 (PID 1212)  [MQTT] Sending /NodeMCUBedroom/humidity => 48 (PID 1213)  [MQTT] Sending /NodeMCUBedroom/co2 => 727 (PID 1214)  [MQTT] Publish ACK for PID 1211  [MQTT] Publish ACK for PID 1212  [MQTT] Publish ACK for PID 1213  [MQTT] TCP Disconnected  [MQTT] Publish ACK for PID 1214  [MQTT] Disconnected!  [WIFI] Connecting to BSSID: FF:3F:20:05:00:00 CH: 00, RSSI: 0, SEC: OPEN, SSID: mywifissid  [WIFI] MODE STA -------------------------------------  [WIFI] SSID mywifissid  [WIFI] IP 192.168.0.241  [WIFI] MAC 68:C6:3A:84:1C:1E  [WIFI] GW 192.168.0.1  [WIFI] DNS 192.168.0.1  [WIFI] MASK 255.255.255.0  [WIFI] HOST NodeMCUBedroom  [WIFI] BSSID C0:FF:D4:10:18:50  [WIFI] CH 6  [WIFI] RSSI -50  [WIFI] ----------------------------------------------  [MDNS] OK  [MQTT] MQTT brokers found: 0  [MQTT] Connecting to broker at mymqttbrokerip:mqttport  [MQTT] Connecting as user mymqttuser  [MQTT] Client ID: ESPURNA_841C1E  [MQTT] QoS: 1  [MQTT] Retain flag: 1  [MQTT] Keepalive time: 240s  [MQTT] Will topic: /NodeMCUBedroom/status  [MQTT] Connected!  [MQTT] Unsubscribing to # (PID 1)  [MQTT] Subscribing to /NodeMCUBedroom/relay/+/set (PID 2)  [MQTT] Subscribing to /NodeMCUBedroom/led/+/set (PID 3)  [MQTT] Subscribing to /NodeMCUBedroom/action/set (PID 4)  [MQTT] Sending /NodeMCUBedroom/app => ESPURNA (PID 5)  [MQTT] Sending /NodeMCUBedroom/version => 1.12.4 (PID 6)  [MQTT] Sending /NodeMCUBedroom/host => NodeMCUBedroom (PID 7)  [MQTT] Sending /NodeMCUBedroom/ip => 192.168.0.241 (PID 8)  [MQTT] Sending /NodeMCUBedroom/mac => 68:C6:3A:84:1C:1E (PID 9)  [MQTT] Sending /NodeMCUBedroom/rssi => -51 (PID 10)  [MQTT] Sending /NodeMCUBedroom/uptime => 27490 (PID 11)  [MQTT] Sending /NodeMCUBedroom/datetime => 2018-03-23 11:15:05 (PID 12)  [MQTT] Sending /NodeMCUBedroom/freeheap => 18808 (PID 13)  [MQTT] Sending /NodeMCUBedroom/relay/0 => 0 (PID 14)  [MQTT] Sending /NodeMCUBedroom/vcc => 3061 (PID 15)  [MQTT] Sending /NodeMCUBedroom/status => 1 (PID 16)  [MQTT] Subscribe ACK for PID 2  [MQTT] Subscribe ACK for PID 3  [MQTT] Subscribe ACK for PID 4  [MQTT] Publish ACK for PID 5  [MQTT] Publish ACK for PID 6  [MQTT] Publish ACK for PID 7  [MQTT] Publish ACK for PID 8  [MQTT] Publish ACK for PID 9  [MQTT] Publish ACK for PID 10  [MQTT] Publish ACK for PID 11  [MQTT] Publish ACK for PID 12  [MQTT] Publish ACK for PID 13  [MQTT] Publish ACK for PID 14  [MQTT] Publish ACK for PID 15  [MQTT] Publish ACK for PID 16  [NTP] Time: 2018-03-23 12:12:49  [MQTT] Sending /NodeMCUBedroom/temperature => 19.1 (PID 17)  [MQTT] Sending /NodeMCUBedroom/pressure => 996.05 (PID 18)  [MQTT] Sending /NodeMCUBedroom/humidity => 48 (PID 19)  [MQTT] Sending /NodeMCUBedroom/co2 => 704 (PID 20)
So I see a TCP Disconnected event, which is suspicious, but not sure how to interpret this... Also, this TCP Disconnected event happens quite often during the day and most of the time it connects back immediately and I have no gap in sensor readings. Any clue to investigate this further? I have to admit I'm a bit clueless as to how investigate this further.
Hopefully this is enough details. Obviously I'm happy to provide more if needed.
Again, thank you.
- weixin_39607865 5月前点赞 评论 复制链接分享
I'm using IwIP v2 Lower Memory.
Other available options I see are: - v2 Higher Bandwidth - v1.4 Higher Bandwidth - v1.4 Compile from source
Looking at your page https://github.com/xoseperez/espurna/wiki/ArduinoIDE I see you actually explain v2 has some instability issues. Sorry I must have overlooked it. What would v1.4 Pre built correspond to in the above options?
Just tried to compile IwIP v.14 Higher Bandwidth which built fine. However, v1.4 Compile from source failed to build, complaining about "make" not being on my path, which should be easy enough to do.
Thanks, Florent点赞 评论 复制链接分享
Well I should open my eyes. I suppose Pre built means going with v1.4 Higher Bandwidth. Giving this one a try on my NodeMCUs now.
Will update you on this.
Thanks, Florent点赞 评论 复制链接分享
Looks like moving to IwIP v1.4 Higher Bandwidth didn't do the trick. Within minutes of flashing, the same behaviour occurred again. I'll plug to the computer again to grab a log and check nothing new is in there. Unless there is another IwIP version that can be used?点赞 评论 复制链接分享
Yeah, exactly the same behavior happens with lwIP v1.4 Higher Bandwidth. My NodeMCU is currently blocked. Log is being written and I'll post it when it unblocks but so far it looks exactly like that the previous one. That is, it shows nothing :(
How can this lwIP be debugged into?点赞 评论 复制链接分享
Log attach here, it just woke up.
I don't know how much value this will be, but the NodeMCU was blocked like described, and I got pissed off waiting, so I decided to blow gently on the BME280 sensor attached, because why not? And seconds after, the NodeMCU woke up and started communicating again. I don't believe in coincidences like this (it had been blocked for 1.5h or so), but at the same time, I have no idea how to connect the dots here. Would a sudden change in sensor values (humidity or temperature in this case) have any impact on the whole process?点赞 评论 复制链接分享
Well I tried to blow on my second NodeMCU who also happens to be frozen and this one doesn't want to wake up. So maybe this was a coincidence after all.点赞 评论 复制链接分享
- weixin_39875842 5月前
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.点赞 评论 复制链接分享
- weixin_39875842 5月前
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.点赞 评论 复制链接分享