Wake On Lan via Network-Binding Action stopped working - Docker? Ports?

  • Platform information:
    • Hardware: Intel NUC
    • OS: Fedora CoreOS
    • OH running in docker-container
OH details
runtimeInfo:
  version: 4.1.1
  buildString: Release Build
locale: de-DE
systemInfo:
  configFolder: /openhab/conf
  userdataFolder: /openhab/userdata
  logFolder: /openhab/userdata/logs
  javaVersion: 17.0.9
  javaVendor: Debian
  osName: Linux
  osVersion: 6.6.3-200.fc39.x86_64
  osArchitecture: amd64
  availableProcessors: 2
  freeMemory: 256228992
  totalMemory: 897581056
  uptime: 157137
  startLevel: 100
addons:
  - binding-amazondashbutton
  - binding-astro
  - binding-chromecast
  - binding-http
  - binding-ipcamera
  - binding-lgwebos
  - binding-luxtronikheatpump
  - binding-mqtt
  - binding-network
  - binding-ntp
  - binding-openweathermap
  - binding-shelly
  - binding-somfytahoma
  - binding-telegram
  - binding-wifiled
  - binding-wled
  - misc-metrics
  - misc-openhabcloud
  - persistence-influxdb
  - persistence-mongodb
  - persistence-rrd4j
  - transformation-jsonpath
  - ui-basic
  - ui-habot
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: true
    macos: false
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    pixelRatio: 1
    prefersColorScheme: dark
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 8
    language: de
    languages:
      - de
      - en-US
      - en
    onLine: true
    platform: Linux x86_64
  screen:
    width: 3440
    height: 1440
    colorDepth: 32
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: dark
    filled: true
    pageTransitionAnimation: default
    bars: light
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0
timestamp: 2024-01-17T16:35:10.835Z
  • Issue of the topic: openHAB sending WOL-Packet but WOL not working
  • Please post configurations (if applicable):
    • Configured Network-Device with correct mac-address
    • Sending WOL command via Network-Binding action as code snipped below shows
    • After that frontail shows that it sent WOL packet
    • Exactly this setup already has worked and i did not change a thing
    • The only thing that has changed may be, that i swtitcht the Docker-Container my OH is running in away from host-mode to manual port forwarding

→ I dont know enough about magic packages and the binding but is there a chance that putting away the OH container from host-networking-mode does avoit sending correct POL?
→ Does this have to do with ports or are ports only important for the machine i want to wake up?

Thanks a lot in advance

		// Wake PC
		val strUID = "network:pingdevice:pc_work_my"
		val actions = getActions("network", strUID)
		if (actions === null) {
			logInfo("actions", "Actions not found, check thing ID")
			return;
		} 
		actions.sendWakeOnLanPacket()
2024-01-17 17:39:22.896 [INFO ] [twork.internal.WakeOnLanPacketSender] - Wake-on-LAN packets sent (MAC address: CENSORED)

But you did. You completely change the networking. WOL uses a broadcast address on the local subnet only. By changing away from host networking your openHAB is no longer on your LAN’s subnet, it’s on the Docker subnet. So it can no longer send the broadcast to your LAN.

The docs for using openHAB in Docker does not require the use of host networking out of laziness. There are all sorts of things like this that break when you don’t.

Makes completely sense!!

Thanks a lot … i will try to get a solution for that

The reason for not using host-networking was a recent issue where openHAB caused very high load → Openhab 4.1 starts mass of SocketListener and JmDNS Threads in Docker · Issue #3976 · openhab/openhab-core · GitHub

Doesn’t PR #3978 fix that problem though? You should need to avoid host networking any more to avoid the CPU issue.

1 Like

Yes thank you for this hint

This is what im about to try next and also the “clean” solution :wink:

Just do give public feedback: Everything fixed with OH in host now!

Very lucky and thanks one more time