Skip to content
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

Home Assistant - MQTT #264

Open
aritonigr opened this issue Jan 8, 2022 · 20 comments
Open

Home Assistant - MQTT #264

aritonigr opened this issue Jan 8, 2022 · 20 comments

Comments

@aritonigr
Copy link

I admit that I am not familiar with MQTT and Home Assistant and I need some help:
In the following code:
...
const char* mqttServer = "192.168.1.200"; The domain or IP where the MQTT is installed (namely the IP of Home Assistant)?
const int mqttPort = 1883; // MQTT server port
const char* mqttUsername = "user"; // Optional, leave blank if not required Username of HomeAssistant or MQTT?
const char* mqttPassword = "pass"; // Optional, leave blank if not required Password of Home Assistant or MQTT?
...

Is there something I have to change on yaml code (except of course the configuration of zones, partitions etc.)?

@aritonigr aritonigr reopened this Jan 11, 2022
@aritonigr
Copy link
Author

Finally I managed to make it work simply by putting the... correct ssid... Now, after around 20hours functioning correctly this message appears on Arduino Monitor:
MQTT....connection error: 192.168.1.200
MQTT disconnected, failed to reconnect.
What is wrong here?

@brucehatherell
Copy link

I had an issue where my router was not giving out a new DHCP lease due to an arp issue - I found a lot more stability with static IP configured - may help

@aritonigr
Copy link
Author

I still have the same problem after some time. I followed @brucehatherell advice but no result.

@daexpert
Copy link

daexpert commented Feb 4, 2022

I want to set up a static ip for arduino uno, not dhcp, can some one help me with the synthax for the ino file?

@lubster85
Copy link

lubster85 commented Feb 4, 2022

I'm having a similar issue around this. I added something force the wifi to reconnect and then try the MQTT connection again. This works reliably, but I am noticing MQTT is still losing connection every few minutes.

Is there anything special that should be set regarding MQTT?

In Home Assistant, this is how frequently the sensor is losing MQTT connection.
Changed to Disarmed
09:37:08 - 17 seconds ago
Became unavailable
09:37:01 - 24 seconds ago
Changed to Disarmed
09:36:58 - 28 seconds ago
Became unavailable
09:36:35 - 1 minute ago
Changed to Disarmed
09:35:53 - 2 minutes ago
Became unavailable
09:35:29 - 2 minutes ago
Changed to Disarmed
09:34:48 - 3 minutes ago
Became unavailable
09:34:41 - 3 minutes ago
Changed to Disarmed
09:33:35 - 4 minutes ago
Became unavailable
09:33:11 - 4 minutes ago
Changed to Disarmed
09:32:17 - 5 minutes ago
Became unavailable
09:31:43 - 6 minutes ago
Changed to Disarmed
09:31:22 - 6 minutes ago
Became unavailable
09:30:53 - 7 minutes ago
Changed to Disarmed
09:29:42 - 8 minutes ago
Became unavailable
09:29:41 - 8 minutes ago
Changed to Disarmed
09:29:07 - 8 minutes ago
Became unavailable
09:29:07 - 8 minutes ago
Changed to Disarmed
09:28:59 - 8 minutes ago
Became unavailable
09:28:57 - 8 minutes ago
Changed to Disarmed
09:28:31 - 9 minutes ago
Became unavailable
09:28:30 - 9 minutes ago
Changed to Disarmed
09:27:44 - 10 minutes ago
Became unavailable
09:27:04 - 10 minutes ago
Changed to Disarmed
09:26:50 - 11 minutes ago
Became unavailable
09:26:50 - 11 minutes ago
Changed to Disarmed
09:26:13 - 11 minutes ago
Became unavailable
09:26:11 - 11 minutes ago
Changed to Disarmed
09:25:40 - 12 minutes ago
Became unavailable
09:25:23 - 12 minutes ago
Changed to Disarmed
09:24:09 - 13 minutes ago
Became unavailable
09:24:05 - 13 minutes ago
Changed to Disarmed
09:22:47 - 15 minutes ago
Became unavailable
09:22:29 - 15 minutes ago
Changed to Disarmed
09:22:04 - 15 minutes ago
Became unavailable
09:21:05 - 16 minutes ago
Changed to Disarmed
09:20:14 - 17 minutes ago
Became unavailable
09:20:11 - 17 minutes ago
Changed to Disarmed
09:17:39 - 20 minutes ago
Became unavailable
09:17:36 - 20 minutes ago
Changed to Disarmed
09:16:23 - 21 minutes ago
Became unavailable
09:16:10 - 21 minutes ago
Changed to Disarmed
09:16:09 - 21 minutes ago
Became unavailable
09:16:00 - 21 minutes ago
Changed to Disarmed
09:15:46 - 22 minutes ago
Became unavailable
09:15:23 - 22 minutes ago
Changed to Disarmed
09:14:55 - 23 minutes ago
Became unavailable
09:14:41 - 23 minutes ago
Changed to Disarmed
09:14:05 - 23 minutes ago
Became unavailable
09:13:41 - 24 minutes ago
Changed to Disarmed
09:12:59 - 24 minutes ago
Became unavailable
09:12:55 - 25 minutes ago
Changed to Disarmed
09:12:49 - 25 minutes ago
Became unavailable
09:12:46 - 25 minutes ago
Changed to Disarmed
09:12:46 - 25 minutes ago
Became unavailable
09:12:29 - 25 minutes ago
Changed to Disarmed
09:12:01 - 25 minutes ago
Became unavailable
09:11:53 - 26 minutes ago
Changed to Disarmed
09:11:27 - 26 minutes ago
Became unavailable
09:11:23 - 26 minutes ago
Changed to Disarmed
09:09:31 - 28 minutes ago
Became unavailable
09:09:29 - 28 minutes ago
Changed to Disarmed
09:09:00 - 28 minutes ago
Became unavailable
09:08:59 - 28 minutes ago
Changed to Disarmed
09:06:38 - 31 minutes ago
Became unavailable
09:06:38 - 31 minutes ago
Changed to Disarmed
09:06:37 - 31 minutes ago
Became unavailable
09:06:23 - 31 minutes ago
Changed to Disarmed
09:05:30 - 32 minutes ago
Became unavailable
09:05:23 - 32 minutes ago
Changed to Disarmed
09:04:42 - 33 minutes ago
Became unavailable
09:04:41 - 33 minutes ago
Changed to Disarmed
09:04:41 - 33 minutes ago
Became unavailable
09:04:31 - 33 minutes ago
Changed to Disarmed
09:04:04 - 33 minutes ago
Became unavailable
09:03:59 - 33 minutes ago
Changed to Disarmed
09:03:02 - 34 minutes ago
Became unavailable
09:02:59 - 34 minutes ago
Changed to Disarmed
09:02:22 - 35 minutes ago
Became unavailable
09:01:53 - 36 minutes ago
Changed to Disarmed
09:00:38 - 37 minutes ago
Became unavailable
09:00:35 - 37 minutes ago
Changed to Disarmed
09:00:12 - 37 minutes ago
Became unavailable
08:59:47 - 38 minutes ago
Changed to Disarmed
08:59:05 - 38 minutes ago
Became unavailable
08:59:04 - 38 minutes ago
Changed to Disarmed
08:58:17 - 39 minutes ago
Became unavailable
08:57:44 - 40 minutes ago
Changed to Disarmed
08:51:02 - 1 hour ago
Became unavailable
08:50:59 - 1 hour ago
Changed to Disarmed
08:50:19 - 1 hour ago
Became unavailable
08:50:17 - 1 hour ago
Changed to Disarmed
08:49:54 - 1 hour ago
Became unavailable
08:49:47 - 1 hour ago
Changed to Disarmed
08:48:14 - 1 hour ago
Became unavailable
08:48:11 - 1 hour ago
Changed to Disarmed
08:46:03 - 1 hour ago
Became unavailable
08:46:03 - 1 hour ago
Changed to Disarmed
08:46:03 - 1 hour ago
Became unavailable
08:45:53 - 1 hour ago
Changed to Disarmed
08:45:31 - 1 hour ago
Became unavailable
08:45:23 - 1 hour ago
Changed to Disarmed
08:44:30 - 1 hour ago
Became unavailable
08:44:15 - 1 hour ago
Changed to Disarmed
08:43:53 - 1 hour ago
Became unavailable
08:43:35 - 1 hour ago
Changed to Disarmed
08:41:08 - 1 hour ago
Became unavailable
08:41:03 - 1 hour ago
Changed to Disarmed
08:40:37 - 1 hour ago
Became unavailable
08:40:35 - 1 hour ago
Changed to Disarmed
08:39:59 - 1 hour ago
Became unavailable
08:39:55 - 1 hour ago
Changed to Disarmed
08:39:38 - 1 hour ago
Became unavailable
08:38:53 - 1 hour ago
Changed to Disarmed
08:38:23 - 1 hour ago
Became unavailable
08:38:23 - 1 hour ago
Changed to Disarmed
08:38:01 - 1 hour ago
Became unavailable
08:37:53 - 1 hour ago
Changed to Disarmed
08:35:49 - 1 hour ago
Became unavailable
08:35:49 - 1 hour ago
Changed to Disarmed
08:35:23 - 1 hour ago
Became unavailable
08:35:17 - 1 hour ago
Changed to Disarmed
08:34:52 - 1 hour ago
Became unavailable
08:34:32 - 1 hour ago
Changed to Disarmed
08:34:10 - 1 hour ago
Became unavailable
08:33:59 - 1 hour ago
Changed to Disarmed
08:32:41 - 1 hour ago
Became unavailable
08:32:41 - 1 hour ago
Changed to Disarmed
08:32:16 - 1 hour ago
Became unavailable
08:32:10 - 1 hour ago
Changed to Disarmed
08:32:01 - 1 hour ago
Became unavailable
08:32:01 - 1 hour ago
Changed to Disarmed
08:31:02 - 1 hour ago
Became unavailable
08:30:58 - 1 hour ago
Changed to Disarmed
08:30:16 - 1 hour ago
Became unavailable
08:30:11 - 1 hour ago
Changed to Disarmed
08:28:56 - 1 hour ago
Became unavailable
08:28:51 - 1 hour ago
Changed to Disarmed
08:28:14 - 1 hour ago
Became unavailable
08:28:11 - 1 hour ago
Changed to Disarmed
08:27:46 - 1 hour ago
Became unavailable
08:27:40 - 1 hour ago
Changed to Disarmed
08:27:25 - 1 hour ago
Became unavailable
08:27:17 - 1 hour ago
Changed to Disarmed
08:26:51 - 1 hour ago
Became unavailable
08:26:47 - 1 hour ago
Changed to Disarmed
08:25:00 - 1 hour ago
Became unavailable
08:24:59 - 1 hour ago
Changed to Disarmed
08:24:00 - 1 hour ago
Became unavailable
08:23:41 - 1 hour ago
Changed to Disarmed
08:22:17 - 1 hour ago
Became unavailable
08:21:53 - 1 hour ago
Changed to Disarmed
08:21:26 - 1 hour ago

@daexpert
Copy link

daexpert commented Feb 5, 2022

I think it's rather a network communication issue between the arduino/esp and the router/mqtt server, from a pc/laptop open a command prompt and execute a ping command with the -t parameter into arduino/esp and see if there is packet loss.

@daexpert
Copy link

daexpert commented Feb 5, 2022

I've managed to modify the sketch for arduino uno to setup static ip instead of dhcp:

-added these lines:
byte ip[] = { 192, 168, 1, 7 };
byte subnet[] = { 255, 255, 255, 0 };
byte gateway[] = { 192, 168, 1, 1 };

  • modified these ones:
    EthernetClient client;
    PubSubClient mqtt(mqttServer, mqttPort, client);

Ethernet.begin(mac, ip, subnet, gateway);
Serial.print(F("connected ip: "));
Serial.println(Ethernet.localIP());
Serial.print(F("subnet mask: "));
Serial.println(Ethernet.subnetMask());
Serial.print(F("gateway: "));
Serial.println(Ethernet.gatewayIP());

@lubster85
Copy link

I think it's rather a network communication issue between the arduino/esp and the router/mqtt server, from a pc/laptop open a command prompt and execute a ping command with the -t parameter into arduino/esp and see if there is packet loss.

So I'm seeing times when I ping and it's OK
--- 192.168.XX.XX ping statistics ---
19 packets transmitted, 19 received, 0% packet loss, time 18284ms
rtt min/avg/max/mdev = 1.544/30.925/227.866/64.967 ms

Other times I'm seeing issues, like this:
--- 192.168.XX.XX ping statistics ---
34 packets transmitted, 14 received, 58.8235% packet loss, time 34866ms
rtt min/avg/max/mdev = 63.388/964.241/3487.802/926.397 ms, pipe 4

I also looked at the router + Mosquitto logs. Again I see peroids of nothing happening.. then I see this repeat over and over.
Mon Feb 7 14:25:18 2022 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED xx:xx:xx:xx:xx:xx
Mon Feb 7 14:25:18 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: disassociated
Mon Feb 7 14:25:19 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Feb 7 14:25:46 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
Mon Feb 7 14:25:47 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 5)
Mon Feb 7 14:25:47 2022 daemon.notice hostapd: wlan1: AP-STA-CONNECTED xx:xx:xx:xx:xx:xx
Mon Feb 7 14:25:47 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
Mon Feb 7 14:25:47 2022 daemon.notice hostapd: wlan1: EAPOL-4WAY-HS-COMPLETED xx:xx:xx:xx:xx:xx
Mon Feb 7 14:25:47 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) xx:xx:xx:xx:xx:xx
Mon Feb 7 14:25:47 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.0.8 xx:xx:xx:xx:xx:xx
Mon Feb 7 14:25:47 2022 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.0.8 xx:xx:xx:xx:xx:xx
Mon Feb 7 14:25:47 2022 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.0.8 xx:xx:xx:xx:xx:xx ESP-1D9D75
Mon Feb 7 14:25:57 2022 daemon.notice mosquitto[1768]: 1644236757: Client dscKeybusInterface disconnected due to malformed packet.
Mon Feb 7 14:25:57 2022 daemon.notice mosquitto[1768]: 1644236757: New connection from 192.168.xx.xx:57572 on port 1883.
Mon Feb 7 14:25:57 2022 daemon.notice mosquitto[1768]: 1644236757: New client connected from 192.168.xx.xx:57572 as dscKeybusInterface (p2, c1, k90, u'DSC').

@daexpert
Copy link

daexpert commented Feb 7, 2022

It's clear a comunication issue between the device and router. You have packet loss and the device is reauthenticating (DHCPOFFER, DHCPREQUEST, DHCPACK) If the device is an esp try put it more closer to the router and if it's an arduino uno with ethernet shield replace the network cable between the router and the arduino (my arduino is not working if the cable length to the router is more than 10 meters)

@taligentx
Copy link
Owner

taligentx commented Feb 7, 2022

Hi @lubster85,

Mon Feb 7 14:25:19 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)

Are you running OpenWRT on the router? Looks like there's an OpenWRT setting that disconnects devices that don't send ACK packets frequently (which would apply to this use case):

https://openwrt.org/faq/deauthenticated_due_to_inactivity

Issue: Wifi problems with Android / iOS devices:

constant disconnects
logfile shows deauthenticated due to inactivity

Solution: /etc/config/wireless → @ config wifi-iface → add option disassoc_low_ack '0'

You could also add something in the sketch that pings the router at a certain interval to keep the connection alive, but this looks like a general networking issue.

@aritonigr
Copy link
Author

It's clear a comunication issue between the device and router. You have packet loss and the device is reauthenticating (DHCPOFFER, DHCPREQUEST, DHCPACK) If the device is an esp try put it more closer to the router and if it's an arduino uno with ethernet shield replace the network cable between the router and the arduino (my arduino is not working if the cable length to the router is more than 10 meters)

Hi, in my case the router is next to esp8266 but still communication issues after some time.

@lubster85
Copy link

Hi @lubster85,

Mon Feb 7 14:25:19 2022 daemon.info hostapd: wlan1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)

Are you running OpenWRT on the router? Looks like there's an OpenWRT setting that disconnects devices that don't send ACK packets frequently (which would apply to this use case):

https://openwrt.org/faq/deauthenticated_due_to_inactivity

Issue: Wifi problems with Android / iOS devices:
constant disconnects
logfile shows deauthenticated due to inactivity
Solution: /etc/config/wireless → @ config wifi-iface → add option disassoc_low_ack '0'

You could also add something in the sketch that pings the router at a certain interval to keep the connection alive, but this looks like a general networking issue.

Thank you for the suggestion. Yes, I am using OpenWRT. The ESP device is a NodeMCU device and it is a fair bit away from the router (but it should not be out of range). I have that setting in the config already on the 2.4GHZ network, but II'll try pinging the router ever-so-often and see if that helps.

@Dilbert66
Copy link
Contributor

Dilbert66 commented Feb 7, 2022

I know this has been mentioned before but power issues will also cause problems with wifi. Are you powering via usb? Try a different adapter just as an experiment as well. Normally you would see this as reboots but you didnt mention those so it could be something else. I have also seen a bad esp that would disconnect and never reconnect until a reboot. A new esp solved the issue.

@lubster85
Copy link

lubster85 commented Feb 7, 2022

I know this has been mentioned before but power issues will also cause problems with wifi. Are you powering via usb? Try a different adapter just as an experiment as well. Normally you would see this as reboots but you didnt mention those so it could be something else. I have also seen a bad esp that would disconnect and never reconnect until a reboot. A new esp solved the issue.

Yes, I am at the moment. I'm using a 5V 1amp (iPhone charger) power supply. I'll try a 2amp supply and see how that goes. I haven't noticed it reboot, but I haven't paid close attention to this.

@lubster85
Copy link

lubster85 commented Feb 9, 2022

  • The power supply does not seem to be the issue.

Yesterday I tried adding the following to my sketch. The idea was to ping the router every 5 seconds.
I simply placed it into my loop section. It appeared to be working flawlessly for many minutes but later on I saw the same behaviour.

I'm going to reflash it tonight and make sure no other changes are in the sketch (I'm using the HomeAssistant-MQTT example as my base) and will retest. To ping, I've added the "Pinger" library and I've placed it directly in the loop section just above mqttHandle();

void loop() {
  unsigned long pingCurrentTime = millis();

  if (pingCurrentTime - pingPreviousTime > 5000) {

    pingResult = pinger.Ping(routerIP);
    if (pingResult >= 0) {
      Serial.print("SUCCESS! RTT = ");
      Serial.print(pingResult);
      Serial.println(" ms");
    } else {
      Serial.print("FAILED! Error code: ");
      Serial.println(pingResult);
    }
    pingPreviousTime = pingCurrentTime;
  }

  mqttHandle();

  dsc.loop();.......

On another note - would it likely have any impact to edit the Pubsubclient library to increase

#define MQTT_KEEPALIVE 15

?

@daexpert
Copy link

daexpert commented Feb 9, 2022

I keep my opinion, it seems to be a wifi signal issue. Rather than reflash the nod mcu with the same sketch, place it near by the router and see if the problem persists. It's a simple thing.

@lubster85
Copy link

@daexpert I'll give that a shot to test it, although unfortunately it has to be positioned where it is if i am to use it. I've had it in place for ages without issue and the router is the same device too so I'm really lost for a good explanation.

For completeness sake, here are some logs from the ESP device and router after flashing the updated sketch.
I've shortened the log a little, but assume that where you see dots, there were successful pings. Perhaps someone spots something useful.

19:23:53.659 -> WiFi.........................................connected: 192.168.X.XX
19:24:14.883 -> MQTT....connected: 192.168.X.XY
19:24:20.292 -> DSC Keybus Interface is online.
19:24:20.292 -> SUCCESS! RTT = 1 ms
19:24:25.319 -> SUCCESS! RTT = 1 ms
19:24:30.295 -> SUCCESS! RTT = 1 ms
19:24:35.308 -> SUCCESS! RTT = 1 ms
19:24:40.298 -> SUCCESS! RTT = 1 ms
19:24:45.318 -> SUCCESS! RTT = 1 ms
19:24:50.324 -> SUCCESS! RTT = 1 ms
19:24:55.307 -> SUCCESS! RTT = 1 ms
19:24:59.815 -> MQTT....connection error: 192.168.X.XY
19:25:04.968 -> MQTT disconnected, failed to reconnect.
19:25:05.016 -> SUCCESS! RTT = 1 ms
19:25:05.016 -> MQTT....connection error: 192.168.X.XY
19:25:10.148 -> MQTT disconnected, failed to reconnect.
19:25:10.148 -> SUCCESS! RTT = 1 ms
19:25:10.148 -> MQTT....connection error: 192.168.X.XY
19:25:15.313 -> MQTT disconnected, failed to reconnect.
19:25:15.313 -> SUCCESS! RTT = 1 ms
19:25:15.313 -> MQTT....connection error: 192.168.X.XY
19:25:20.471 -> MQTT disconnected, failed to reconnect.
19:25:20.471 -> SUCCESS! RTT = 1 ms
19:25:20.471 -> MQTT....connected: 192.168.X.XY
19:25:23.453 -> MQTT disconnected, successfully reconnected.
19:25:25.467 -> SUCCESS! RTT = 1 ms
.
.
.
19:27:17.266 -> SUCCESS! RTT = 1 ms
19:27:17.266 -> MQTT....connected: 192.168.X.XY
19:27:17.266 -> MQTT disconnected, successfully reconnected.
.
.
.
19:27:47.273 -> SUCCESS! RTT = 1 ms
19:27:52.265 -> SUCCESS! RTT = 1 ms
19:27:57.274 -> SUCCESS! RTT = 1 ms
Wed Feb  9 19:24:13 2022 daemon.info hostapd: wlan1: STA aa:bb:aa:bb:aa:bb IEEE 802.11: authenticated
Wed Feb  9 19:24:13 2022 daemon.info hostapd: wlan1: STA aa:bb:aa:bb:aa:bb IEEE 802.11: associated (aid 8)
Wed Feb  9 19:24:14 2022 daemon.notice hostapd: wlan1: AP-STA-CONNECTED aa:bb:aa:bb:aa:bb
Wed Feb  9 19:24:14 2022 daemon.info hostapd: wlan1: STA aa:bb:aa:bb:aa:bb WPA: pairwise key handshake completed (RSN)
Wed Feb  9 19:24:14 2022 daemon.notice hostapd: wlan1: EAPOL-4WAY-HS-COMPLETED aa:bb:aa:bb:aa:bb
Wed Feb  9 19:24:14 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) aa:bb:aa:bb:aa:bb
Wed Feb  9 19:24:14 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.x.xx aa:bb:aa:bb:aa:bb
Wed Feb  9 19:24:14 2022 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.x.xx aa:bb:aa:bb:aa:bb
Wed Feb  9 19:24:14 2022 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.x.xx aa:bb:aa:bb:aa:bb ESP-2A7E07
Wed Feb  9 19:24:18 2022 daemon.notice mosquitto[7229]: 1644427458: New connection from 192.168.x.xx:49669 on port 1883.
Wed Feb  9 19:24:18 2022 daemon.notice mosquitto[7229]: 1644427458: New client connected from 192.168.x.xx:49669 as dscKeybusInterface (p2, c1, k25, u'DSC').
Wed Feb  9 19:24:59 2022 daemon.notice mosquitto[7229]: 1644427499: Client dscKeybusInterface has exceeded timeout, disconnecting.
Wed Feb  9 19:25:23 2022 daemon.notice mosquitto[7229]: 1644427523: New connection from 192.168.x.xx:60970 on port 1883.
Wed Feb  9 19:25:23 2022 daemon.notice mosquitto[7229]: 1644427523: New client connected from 192.168.x.xx:60970 as dscKeybusInterface (p2, c1, k25, u'DSC').
Wed Feb  9 19:27:17 2022 daemon.notice mosquitto[7229]: 1644427637: Client dscKeybusInterface has exceeded timeout, disconnecting.
Wed Feb  9 19:27:17 2022 daemon.notice mosquitto[7229]: 1644427637: New connection from 192.168.x.xx:61775 on port 1883.
Wed Feb  9 19:27:17 2022 daemon.notice mosquitto[7229]: 1644427637: New client connected from 192.168.x.xx:61775 as dscKeybusInterface (p2, c1, k25, u'DSC').
Wed Feb  9 19:28:11 2022 daemon.notice mosquitto[7229]: 1644427691: Client dscKeybusInterface has exceeded timeout, disconnecting.

@aritonigr
Copy link
Author

I have checked the arduino monitor when the service became unavailable. Here is what I get:

MQTT Disconnected, failed to reconnect
MQTT.... connection error: 192.168.1.200

When I have the reset button of esp8266 pressed the service becomes available again.

Any idea?

@sidlauskas
Copy link

I have the same issue that it becomes unavailable and have to reset the ESP8266.

I also tried to ping the ESP8266 and found that requests keep timing out, even when the WiFi signal is strong (-50dBm)

@sidlauskas
Copy link

It seems I managed to fix this issue just by re-flashing the firmware and selecting the correct board in the Arduino IDE. I was using NodeMCU 1.0 (ESP-12E) instead NodeMCU 0.9 (ESP-12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants