ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
> I totally agree, but it may be a starting point. I hope the traces would show a sudden change (consistently showing a similar behaviour every 30s and, when the connection is lost and errors start occurring, traces around that initial moment might give us some hints, hopefully).
> 
> If you think it's not worth the effort, I understand. But then, I'd personally close this issue with the "works for me" label. No need to have a stale issue if nobody is going to try anything to solve it.

I have the exact same issue! 

`ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed `

A Homebridge restart solved it. But occurs again after a day or two...
I tried it with a complete new system under hoobs and got the same error.
The firmware is the latest (3.5.7_002008)

> Can you try running homebridge with the debug logs ON so we can see more verbose logs (hopefully they'll help out).
Please, set the environment variable DEBUG="miio:*,thing:*". If these are set, you'll likely see logs like the ones below:

How exactly a do the debug mode you mentioned. then i can post that here!

here is the normal log:

```
> [10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareSensors | roborock.vacuum.s5 | Sensors dirtytime is 28363 seconds / 26.26%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareSensors | roborock.vacuum.s5 | Sensors dirtytime is 28363 seconds / 26.26%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareFilter | roborock.vacuum.s5 | Filter worktime is 386437 seconds / 71.56%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareFilter | roborock.vacuum.s5 | Filter worktime is 386437 seconds / 71.56%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareSideBrush | roborock.vacuum.s5 | Sidebrush worktime is 386437 seconds / 53.67%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareSideBrush | roborock.vacuum.s5 | Sidebrush worktime is 386437 seconds / 53.67%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareMainBrush | roborock.vacuum.s5 | Mainbrush worktime is 386437 seconds / 35.78%.
[10/25/2020, 12:00:33] [Xiaomi Roborock S5] INF getCareMainBrush | roborock.vacuum.s5 | Mainbrush worktime is 386437 seconds / 35.78%.
[10/25/2020, 12:01:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:01:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:01:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getCleaning | roborock.vacuum.s5 | Cleaning is false
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getDocked | roborock.vacuum.s5 | Robot Docked is true (Status is charging)
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getCleaning | roborock.vacuum.s5 | Cleaning is false
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getCleaning | roborock.vacuum.s5 | Cleaning is false
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getCleaning | roborock.vacuum.s5 | Cleaning is false
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getCleaning | roborock.vacuum.s5 | Cleaning is false
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 103 over miIO. Converting to HomeKit
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 103 over miIO "Turbo" > HomeKit speed 80%
[10/25/2020, 12:01:11] [Xiaomi Roborock S5] INF getBatteryLow | roborock.vacuum.s5 | Batterylevel is 100%
[10/25/2020, 12:01:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:01:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:01:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:02:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:02:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:02:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:02:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:02:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:02:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:03:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:03:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:03:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:03:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:03:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:03:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:04:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:04:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:04:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:04:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:04:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:04:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:05:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:05:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:05:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:05:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:05:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:05:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:06:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:06:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:06:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:06:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:06:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:06:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:07:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:07:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:07:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:07:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:07:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:07:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:08:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:08:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:08:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:08:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:08:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:08:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:09:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:09:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:09:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:09:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:09:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:09:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:10:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:10:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:10:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:10:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:10:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:10:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:11:02] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:11:02] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:11:02] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:11:32] [Xiaomi Roborock S5] INF ensureDevice | roborock.vacuum.s5 | The socket was destroyed or not initialised, initialising the device
[10/25/2020, 12:11:32] [Xiaomi Roborock S5] ERR connect | miio.device, next try in 2 minutes | Error: Network communication is unavailable, device might be destroyed
[10/25/2020, 12:11:32] [Xiaomi Roborock S5] ERR getState | {"device":null}
[10/25/2020, 12:11:47] [Config] Homebridge restart request received
[10/25/2020, 12:11:48] [Config] No restart command defined, killing process...
[10/25/2020, 12:11:48] [HB Supervisor] Stopping services...
[10/25/2020, 12:11:48] Got SIGTERM, shutting down Homebridge...
[10/25/2020, 12:11:53] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[10/25/2020, 12:12:00] [HB Supervisor] OS: Linux 5.4.51-v7l+ arm
[10/25/2020, 12:12:00] [HB Supervisor] Node.js v12.19.0 /usr/local/bin/node
[10/25/2020, 12:12:00] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge
[10/25/2020, 12:12:00] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[10/25/2020, 12:12:00] [HB Supervisor] Starting Homebridge with extra flags: -I
[10/25/2020, 12:12:00] [HB Supervisor] Starting Homebridge with custom env: {"DEBUG":"DEBUG=\"miio:*,thing:*\""}
[10/25/2020, 12:12:00] [HB Supervisor] Started Homebridge v1.1.6 with PID: 6036
[10/25/2020, 12:12:00] Loaded config.json with 1 accessories and 1 platforms.
[10/25/2020, 12:12:00] ---
[10/25/2020, 12:12:01] Loaded plugin: homebridge-config-ui-x@4.30.0
[10/25/2020, 12:12:01] Registering platform 'homebridge-config-ui-x.config'
[10/25/2020, 12:12:01] ---
[10/25/2020, 12:12:02] Loaded plugin: homebridge-xiaomi-roborock-vacuum@0.13.5
[10/25/2020, 12:12:02] Registering accessory 'homebridge-xiaomi-roborock-vacuum.XiaomiRoborockVacuum'
[10/25/2020, 12:12:02] ---
[10/25/2020, 12:12:02] Loading 1 platforms...
[10/25/2020, 12:12:02] [Config] Initializing config platform...
[10/25/2020, 12:12:02] [Config] Running in Service Mode
[10/25/2020, 12:12:02] Loading 1 accessories...
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] Initializing XiaomiRoborockVacuum accessory...
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF createRoom | undefined | Room das Schlafzimmer (17)
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF createRoom | undefined | Room das Badezimmer (18)
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF createRoom | undefined | Room die Küche (19)
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF createRoom | undefined | Room das Loft (20)
Setup Payload:
X-HM://0024N1UA7JC03
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ xxxxxx │     
    └────────────┘     
                       
[10/25/2020, 12:12:02] Homebridge is running on port 51142.
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | Connected to: 192.168.xxx.xx
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | Model: roborock.vacuum.s5
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | State: charging
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | FanSpeed: 103
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | BatteryLevel: 100
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF getSerialNumber | roborock.vacuum.s5 | Serial Number is xxxxxxxxx
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | Serialnumber: xxxxxxxxxxx
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF getFirmware | roborock.vacuum.s5 | Firmwareversion is 3.5.7_002008
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] STA getDevice | Firmwareversion: 3.5.7_002008
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF changedCleaning | roborock.vacuum.s5 | Cleaning is OFF.
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] MON changedCharging | roborock.vacuum.s5 | ChargingState is now true
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF changedCharging | roborock.vacuum.s5 | Charging is active
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF changedCharging | roborock.vacuum.s5 | Robot was docked.
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] MON changedSpeed | roborock.vacuum.s5 | FanSpeed is now 103%
[10/25/2020, 12:12:02] [Xiaomi Roborock S5] INF changedSpeed | roborock.vacuum.s5 | Speed was changed to 103% (Turbo), for HomeKit 80%
HAP Warning: Characteristic 000000AC-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000040-0000-1000-8000-0026BB765291. Adding anyway.
HAP Warning: Characteristic 000000AB-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000040-0000-1000-8000-0026BB765291. Adding anyway.
[10/25/2020, 12:12:03] [Config] Homebridge Config UI X v4.30.0 is listening on :: port 8581
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCleaning | roborock.vacuum.s5 | Cleaning is false
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCareSensors | roborock.vacuum.s5 | Sensors dirtytime is 28363 seconds / 26.26%.
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCareFilter | roborock.vacuum.s5 | Filter worktime is 386437 seconds / 71.56%.
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCareSideBrush | roborock.vacuum.s5 | Sidebrush worktime is 386437 seconds / 53.67%.
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCareSensors | roborock.vacuum.s5 | Sensors dirtytime is 28363 seconds / 26.26%.
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCareFilter | roborock.vacuum.s5 | Filter worktime is 386437 seconds / 71.56%.
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCareSideBrush | roborock.vacuum.s5 | Sidebrush worktime is 386437 seconds / 53.67%.
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 103 over miIO. Converting to HomeKit
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 103 over miIO "Turbo" > HomeKit speed 80%
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getCharging | roborock.vacuum.s5 | Charging is true (Status is charging)
[10/25/2020, 12:16:54] [Xiaomi Roborock S5] INF getBattery | roborock.vacuum.s5 | Batterylevel is 100%
```

_Originally posted by @piiong in https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/issues/227#issuecomment-716132377_