bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 199 forks source link

UpnpListener encountered an error sending upnp response packet. IP: 192.168.X.X with message: Host is down #1252

Open heffneil opened 4 years ago

heffneil commented 4 years ago

My logs are riddled with these errors. When I ask Alexa to do stuff it says the device didn't respond. I can, most of the time, ask again and it will work. Today I got into a shouting match with the Alexa because she refused to listen at all.

Not sure how to avoid this problem but I really would like to resolve it. Thanks!

bwssytems commented 4 years ago

If you could post your log from the start of the ha-bridge that would be appreciated

heffneil commented 4 years ago

My logs were completely filled with the upnp error so I restarted the server. Here are the details of my server from the logs after the restart, sir:

11-19-2020 11:54:39.470 INFO HA Bridge startup sequence... com.bwssystems.HABridge.HABridge
11-19-2020 11:54:39.626 INFO HA Bridge (v5.3.0) initializing.... com.bwssystems.HABridge.HABridge
11-19-2020 11:54:39.641 INFO reading from config file: data/habridge.config com.bwssystems.HABridge.BridgeSettings
11-19-2020 11:54:39.784 WARN The upnp config address, 192.168.1.203, does not match any known IP's on this host. Using default address: null com.bwssystems.HABridge.BridgeSettings
11-19-2020 11:54:42.534 INFO StaticResourceHandler configured with folder = /public spark.staticfiles.StaticFilesConfiguration
11-19-2020 11:54:42.555 INFO System control service started.... com.bwssystems.HABridge.SystemControl
11-19-2020 11:54:42.959 INFO Initializing UDP response Socket... com.bwssystems.HABridge.util.UDPDatagramSender
11-19-2020 11:54:42.977 INFO UDP response Socket initialized to: 50000 com.bwssystems.HABridge.util.UDPDatagramSender
11-19-2020 11:54:42.981 INFO HTTP Home created. com.bwssystems.HABridge.plugins.http.HTTPHome
11-19-2020 11:54:42.986 INFO Harmony Home created. No Harmony devices configured. com.bwssystems.HABridge.plugins.harmony.HarmonyHome
11-19-2020 11:54:43.380 INFO Nest Home created. No Nest configured. com.bwssystems.HABridge.plugins.NestBridge.NestHome
11-19-2020 11:54:43.383 INFO Hue passthru Home created. No Hue passtrhu systems configured. com.bwssystems.HABridge.plugins.hue.HueHome
11-19-2020 11:54:43.417 INFO HAL Home created. No HAL devices configured. com.bwssystems.HABridge.plugins.hal.HalHome
11-19-2020 11:54:43.418 INFO MQTT Home created. No MQTT Clients configured. com.bwssystems.HABridge.plugins.mqtt.MQTTHome
11-19-2020 11:54:43.420 INFO HomeAssistant Home created. No HomeAssistants configured. com.bwssystems.HABridge.plugins.hass.HassHome
11-19-2020 11:54:43.421 INFO HomeWizard Home created. No HomeWizard gateways configured. com.bwssystems.HABridge.plugins.homewizard.HomeWizardHome
11-19-2020 11:54:43.422 INFO Command Home for system program execution created. com.bwssystems.HABridge.plugins.exec.CommandHome
11-19-2020 11:54:43.425 INFO TCP Home created. com.bwssystems.HABridge.plugins.tcp.TCPHome
11-19-2020 11:54:43.535 INFO UDP Home created. com.bwssystems.HABridge.plugins.udp.UDPHome
11-19-2020 11:54:43.622 INFO Vera Home created. No Veras configured. com.bwssystems.HABridge.plugins.vera.VeraHome
11-19-2020 11:54:43.624 INFO Fibaro Home created. No Fibaros configured. com.bwssystems.HABridge.plugins.fibaro.FibaroHome
11-19-2020 11:54:43.626 INFO Domoticz Home created. No Domoticz devices configured. com.bwssystems.HABridge.plugins.domoticz.DomoticzHome
11-19-2020 11:54:43.628 INFO Somfy Home created. No Somfys configured. com.bwssystems.HABridge.plugins.somfy.SomfyHome
11-19-2020 11:54:43.860 INFO LifxDevice Home created. No LifxDevices configured. com.bwssystems.HABridge.plugins.lifx.LifxHome
11-19-2020 11:54:43.862 INFO OpenHAB Home created. No OpenHABs configured. com.bwssystems.HABridge.plugins.openhab.OpenHABHome
11-19-2020 11:54:43.865 INFO FHEM Home created. No FHEMs configured. com.bwssystems.HABridge.plugins.fhem.FHEMHome
11-19-2020 11:54:43.879 INFO Broadlink Home created. No Broadlinks configured. com.bwssystems.HABridge.plugins.broadlink.BroadlinkHome
11-19-2020 11:54:43.881 INFO Mozilla IOT Home created. No Mozilla IOTs configured. com.bwssystems.HABridge.plugins.moziot.MozIotHome
11-19-2020 11:54:43.883 INFO HomeGenie Home created. No HomeGenies configured. com.bwssystems.HABridge.plugins.homegenie.HomeGenieHome
11-19-2020 11:54:43.927 INFO HABridge device management service started.... com.bwssystems.HABridge.devicemanagmeent.DeviceResource
11-19-2020 11:54:43.949 INFO == Spark has ignited ... spark.embeddedserver.jetty.EmbeddedJettyServer
11-19-2020 11:54:43.949 INFO >> Listening on 0.0.0.0:80 spark.embeddedserver.jetty.EmbeddedJettyServer
11-19-2020 11:54:44.503 INFO Hue emulator service started.... com.bwssystems.HABridge.hue.HueMulator
11-19-2020 11:54:44.991 INFO Description xml service started.... com.bwssystems.HABridge.upnp.UpnpSettingsResource
11-19-2020 11:54:45.007 INFO UPNP Discovery Listener starting.... com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 11:54:45.009 INFO Create and run mDNS service. com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 11:54:45.160 INFO UPNP Discovery Listener running and ready.... com.bwssystems.HABridge.upnp.UpnpListener
bwssytems commented 4 years ago

So the the third item shows the issue. The IP in the config is not matching any known IPs on the server and the default selection of null points to the ha-bridge not being able to find the correct interface. Are there multiple interfaces on your system?

heffneil commented 4 years ago

There is only on ip on the machine and one interface. Screen Shot 2020-11-19 at 12 35 40 PM

bwssytems commented 4 years ago

https://github.com/bwssytems/ha-bridge/issues/470

There are issues the way the mac OSX handles interfaces if you start the ha-bridge as a user. You will need to use sudo on the command line.

heffneil commented 4 years ago

This server had been configured for quite some time so I honestly have no idea how it is enabled from the beginning. Do you think once I make that change it will work properly?

bwssytems commented 4 years ago

IF you could turn on traceupnp, save the config, restart and post the log again, that would help

heffneil commented 4 years ago

I enabled and tried to turn on some lights got the following. Once I wake it up and I ask a second time it usually works.

11-19-2020 13:42:27.901 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:42:28.646 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:42:29.405 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:42:30.089 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:47:35.510 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:47:36.219 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:47:36.982 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-19-2020 13:47:37.703 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
heffneil commented 4 years ago

Ignorantly I can't find how the bridge is started in OSX. LIke I said its been quite some time since I set it up. If you have any insight in OSX how I can review I will see how / who is running the bridge. Thanks!

heffneil commented 4 years ago

I am running it as a plist within /Library/LaunchDaemons/. File contents to follow. Do you think I need to run this somehow with sudo still?


<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>HA-Bridge</string>
  <key>ProgramArguments</key>
  <array>
    <string>java</string>
    <string>-jar</string>
    <string>ha-bridge.jar</string>
  </array>
  <key>RunAtLoad</key>
  <true/> <!-- run the program at login -->
  <key>KeepAlive</key>
  <true/> <!-- run the program again if it terminates -->
        <key>StandardErrorPath</key>
        <string>/var/log/ha-bridge_err.log</string>
        <key>StandardOutPath</key>
        <string>/var/log/ha-bridge.log</string>
        <key>WorkingDirectory</key>
  <string>/Users/MYUSERNAME/ha-bridge-master/target</string>
</dict>
</plist>
heffneil commented 4 years ago

My system is working - just mostly not the first call.

bwssytems commented 4 years ago

I still need to see the log from the very beginning of startup with traceupnp turned on...

heffneil commented 4 years ago

I enable traceupnp and it doesn't show any data in the logs and continues to show warn or info - any other setting. Why can't traceupnp "stick"?

bwssytems commented 4 years ago

You need to hit save at the top of the page for it to stick

heffneil commented 4 years ago

I don't think I am a total moron- but I could be wrong. In the logging section, I try to change to "trace" and hit the update log levels but it doesn't stick. Am I in the wrong place?

bwssytems commented 4 years ago

It is a setting in the bridge control tab called traceupnp and it is a checkbox. You need to set that and hit save at the top of the page.

heffneil commented 4 years ago

Mine is currently unchecked which says false:

UPNP Original (simple version) | false Trace UPNP Calls | false Trace State Changes | false

bwssytems commented 4 years ago

Check Trace UPNP Calls to true and save the setting

heffneil commented 4 years ago

Did that. Is the time in the logs based on system time? I had an incident just now (7:17 AM) where the system didn't respond to the first verbal command but the second one did work. Logs indicate nothing for over an hour. See below (not dissimilar to log output before enabling traces)

11-23-2020 15:13:15.067 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 15:13:15.779 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 15:13:16.529 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 16:08:27.106 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 16:08:27.887 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 16:08:28.587 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 16:08:29.371 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:15:34.566 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:15:35.337 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:15:36.070 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:15:36.837 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.58 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:59:21.487 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:59:22.204 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 17:59:22.954 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 20:09:21.057 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 20:09:21.840 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 20:09:22.534 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 20:09:23.323 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 22:13:17.531 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 22:13:18.322 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 22:13:19.031 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-23-2020 22:13:19.783 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 00:05:47.683 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 00:05:48.463 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 00:05:49.156 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 00:05:49.946 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 01:59:33.627 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 01:59:34.419 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 01:59:35.211 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 01:59:35.960 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 04:09:15.741 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 04:09:16.529 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 04:09:17.246 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 04:09:18.029 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 06:06:35.957 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: No route to host com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 06:06:36.674 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 06:06:37.424 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
11-24-2020 06:06:38.174 WARN UpnpListener encountered an error sending upnp response packet. IP: 192.168.2.33 with message: Host is down com.bwssystems.HABridge.upnp.UpnpListener
bwssytems commented 3 years ago

I need you to post the log that is on the system with all messages from the time of start of the ha-bridge. Portions do not help me. If you are not sure how to do this, please google it.

heffneil commented 3 years ago

I am technical - which log. Its not clear what you want? You want the entire log from this machine for HA-Bridge? Can I email that to you rather than publically provide it?

heffneil commented 3 years ago

Are the trace upnp logs part of the "regular" logs? I am making calls and there are 0 entries to indicate turning on or off loads. I restarted the bridge and confirmed this so I need clarification so I can provide you with the proper details.

heffneil commented 3 years ago

Now it never works. Last entry:

Traceupnp: hue api user create requested for device type: test_ha_bridge#192.168.2.3 and username: 0d2048f6123448b18f6e36b3caadbcaf