Release Advanced Wake on WAN - Wake-up a remote device by router through internet traffic
#1
The addon "Advanced Wake On Wan" allows you to wake up or start (if supported) a device by having the router (if supported) send a WoL package to the device if it is being accessed through the internet (example). It displays a notification if and when the computer is available, or an error message, if the device did not wake up during a configurable timeout. It is also possible to configure the pings to use a different IP (like a local) to check if the device is up in case the forwarded port is a dead end and is only used to trick the router into thinking the device will be accessed.

This addon (and this post) is heavily based on Advanced Wake On Lan by mandark and was forked from his GitHub. (Most will want to use that over my version!)

Please check out the original for a full feature list.

The only option that was removed is this part:
Quote:can be provided with another XBMC-command as a parameter, which will then be launched either immediately or not until the remote computer is available (behaviour can be set by a second parameter)
Because I simply didn't have a use for it. It would probably be possible to re-implement though.

Screenshots

Usage Details:
You will need 2 things for this to even be possible:
1: A router with an option to wake a device if it is being accessed over the internet.
2: The device must have WoL support.

Instead of entering an IP or a MAC address, you will need to enter a remotely accessible URL or IP (most common will be some kind of DynDNS:port). The port entered must be forwarded to the device you want to wake. The device does not need to respond to that port. I would personally suggest to have that port blacklisted in a firewall for any traffic to be quite honest. It is sufficient if the router thinks the device is being accessed for the router to send the WoL signal. In this scenario, there is an option to ping against a different IP address, like a local LAN IP in a VPN, to check if the server is available.

PLEASE NOTE: It seems, that the hostup-check via ping only works, when Kodi is run with root- (on Linux) or administrator- (on Windows) -rights. You will get an error message, if this is not the case. As an alternative, you can You can disable the hostup-check via ping in the addon's "Advanced Settings", and instead set a time span, after which the addon should assume, that the server has awoken. The actual waking-up should not be affected by this and should also work with non root- or administrator-rights.

The addon can be launched manually from the Programs-section of Kodi (and thus added to your favorites, as home-menu-items, etc.), and can also be configured in the addon-settings to auto start with Kodi, thus waking up your remote computer when Kodi starts (it will start after Kodi is completely loaded, including the database!). Enabling auto start also enables some further possibilities like automatically starting library updates after a successful wake-up, or performing a wake-up after Kodi itself has come after standby.
PLEASE NOTE: If auto start is enabled, a socket-error can occur, stating that the network is not ready yet. This can be the case, if Kodi starts, when the operating system has not yet initialized the network. In this case, you can set a delay for the WoWAN-signal in the "auto start"-section of the addon-settings.

In the advanced settings you can also set the addon to continue sending WoWAN packets with a configurable delay. This is useful, if you set the device to go back to sleep quickly if it is not being used, because it will keep getting woken up as long as Kodi is running. Normally the continuous WoWAN-packets will also continue after Kodi has returned from standby/sleep/suspend, but there is an option to turn this behavior off.

Requirements:
Tested with Kodi 18.4 and 18.5
Tested with Python 2.7

This addon should work on all platforms.

Current Version: v0.1

Download:
The addon is available on GitHub.

P.s.: This is my first attempt at any kind of addon for Kodi, so be gentle please. I tested it and am already using it productively, but there may be issues I have not noticed yet.
Reply
#2
Hello.

I have CoreELEC release: Amlogic-ng.arm-9.2.3. Here is crash.log

2020-06-24 19:36:00.842 T:3906089856   ERROR: Previous line repeats 2 times.
2020-06-24 19:36:00.842 T:3906089856   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: unknown url type: 187.105.155.148
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.advanced.wowan/default.py", line 212, in <module>
                                                main()
                                              File "/storage/.kodi/addons/script.advanced.wowan/default.py", line 56, in main
                                                response = urlopen(req)
                                              File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
                                              File "/usr/lib/python2.7/urllib2.py", line 421, in open
                                              File "/usr/lib/python2.7/urllib2.py", line 283, in get_type
                                            ValueError: unknown url type: 187.105.155.148
                                            -->End of Python script error report<--
Reply



Logout Mark Read Team Forum Stats Members Help
Advanced Wake on WAN - Wake-up a remote device by router through internet traffic0
This forum uses Lukasz Tkacz MyBB addons.