-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More than 3 nodes not possible in 2.0.0 develop? #263
Comments
Thank you for posting this. I had the exact same issue. I removed the third node and all works fine again. Before removing the third node, I would get immediate disconnects from Mosquitto. After removing, no issues and connection is very stable. Mosquitto logs showed: 1482538571: Client Homie-18fe34a18ccd has exceeded timeout, disconnecting. Over and over... |
I also did encounter this problem. Has anyone a clue how to fix this? I investigated a bit, it seems to be working fine on a NodeMCU with 4M Flash and 1M SPIFFS.
without even configuring or calling any function on it, the error occurs. The sizes of a working code (3 nodes):
The sizes of a not working code (4 nodes):
Lucas |
It does not make sense... The underlying chip is the same, I don't get why it would work on a NodeMCU but not on a Sonoff. I just received a sonoff, I'll be able to test soon. |
It doesn't work for me on an nodemcu either. |
Haven't tried 4 nodes but works fine with 3 (DHT22 humi+temp, LED). |
Most probably there is a bug in your code somewhere else that overwrites some memory belonging to a HomieNode object. |
You can check out this commit derlucas/homie-sonoff@2b7e409 with my Sonoff-SC Firmware. Just comment in the additional nodes. |
I just tried with an 8 nodes firmwares, and it works fine, so there's probably an issue somewhere else as @euphi said. I will take a closer look as soon as I have some spare time. |
seems to be fixed somehow. just updated some nodes that failed in december and they seem to work fine with at least 4 nodes. will have another try in the next days with 5 or 6 nodes. |
Please keep us informed so we can close the issue. |
today i tried a homie-fw with 10 homie-nodes with random data (so no real sensors/actors attached). worked in my office fine for 5 hours. but then i got home and the problem is back. maybe the other issue where someone mentioned some association with the wifi-networks around is not that wrong. in my office there are 3 or 4 wifis. in my neighborhood > 25. damn it. this bug is dragging all my development on one project down :|
|
just installed a mosquitto on my raspberry pi in the local lan, works with ten nodes again. |
I all recommend you to increase the keepalive value to 300secs or something. MQTT is designed with these high values in mind. The MQTT specification mentions "several minutes" as common practice. Ever since I increased the keepalive I haven't seen any persisting disconnects anymore. |
The keepalive is correctly changed to 300 in my scenario. it doen't matter. i can see, that the "socket error, disconnecting" message in my broker log comes after 300 seconds, without the keepalive setting it appears earlier. the homie-device connects, i see the connect on broker-side and via serial output. but the homie device never comes to send anything to the broker and after 300 seconds (or whatever the keepalive is configured at homie-device-side) the connection times out. |
@derlucas You've got blocking code in your sketch: @egon: Since your device does nothing at all (not sending messages nor ping), maybe you also included blockign code. Can you share your sketch? |
sure i can share the test-sketch. but there can't be a general problem with the sketch, it works in my office, it works with a local mosquitto-broker inside the lan, but does not work inside two other networks.
|
also, if there were any blocking components, i shouldn see the serial output for the ten nodes every 60 seconds i think. |
I identified the cause: let's keep #342 (same issue) for reference. |
Please update your https://github.com/marvinroger/async-mqtt-client (fixed there) |
At the moment i'm stuck at trying to have more than 3 nodes in the current dev-branch.
I have a BME280 for temperature, humidity and pressure and a tsl2561 light sensor for light-intensity.
If i have 3 Nodes like:
everthing works fine. as soon as i add another node like:
it connects to mqtt but loses the connection some seconds later, my mosquitto log says "connection timed out".
anybody has any idea?
edit: if i only register 3 nodes, for example temperature, humidity and luminance everything works fine again.
The text was updated successfully, but these errors were encountered: