Florianisme / WakeOnLan

A Wake on Lan Application for Android
https://play.google.com/store/apps/details?id=de.florianisme.wakeonlan
GNU General Public License v2.0
195 stars 17 forks source link

[Feature request] support wake on WAN via VPN #17

Closed chuwza closed 10 months ago

chuwza commented 1 year ago

Hello, could you please support wake on WAN via VPN ?

Currently, Wake On Lan (Android https://play.google.com/store/apps/details?id=co.uk.mrwebb.wakeonlan) Screenshot_20230814-123548_Wake_On_Lan (小) and MagicPacket (Windows https://apps.microsoft.com/store/detail/magicpacket/9WZDNCRCW1MX?hl=en-us&gl=us) 屏幕截图(257) support using the same configurations to be able to wake the device on both LAN and WAN (VPN). Hopefully this APP will support this feature(currently it requires two configurations for LAN and WAN) Screenshot_20230814-123531_Wake_on_Lan (小)

I found how thist two APPs Implementing this feature: I downloaded MagicPacket on Windows and found that it can automatically detect and select whether to use Wake on LAN or Wake on WAN, and even can sends both Wake on LAN and Wake on WAN at the same time. 屏幕截图(259)

Florianisme commented 1 year ago

Yes, I had something similar in mind where the user optionally can set a broadcast address for use in LAN but then the app automatically retrieves the Broadcast address for use in VPN as well. So it would essentially send two Wake requests

chuwza commented 1 year ago

Yes, I had something similar in mind where the user optionally can set a broadcast address for use in LAN but then the app automatically retrieves the Broadcast address for use in VPN as well. So it would essentially send two Wake requests

OK, I'll wait for it, thank you for your app and work👍

Florianisme commented 1 year ago

Will be available in the beta version released today

chuwza commented 1 year ago

Will be available in the beta version released today

Thank you, I'll try it

Florianisme commented 1 year ago

Update is finally out now!

chuwza commented 1 year ago

Update is finally out now!

Hello, I tested 1.8.4 under WireGuard but both WOL and SSH functions failed, and SSH function even also failed in LAN. (this is my config) IMG_20230823_081018

But I am successful with this WOL APP (https://play.google.com/store/apps/details?id=co.uk.mrwebb.wakeonlan&hl=en_US) and this SSH APP (https://play.google.com/store/apps/details?id=com.matungos.sshing.free&hl=en_US) on LAN and WAN.

So I think the problem comes from Wake on lan app

Florianisme commented 1 year ago

Does the SSH command prompt you to enter your password when you execute it using the SSH app?

chuwza commented 1 year ago

Does the SSH command prompt you to enter your password when you execute it using the SSH app?

No, it doesn't.

The password is already entered in the configuration, so maybe it's normal that there's no prompt? 41208412 (小)

Florianisme commented 1 year ago

In this case, the password is only used for login. So you also don't have to execute the same command using sudo?

chuwza commented 1 year ago

In this case, the password is only used for login. So you also don't have to execute the same command using sudo?

sudo? Oh! My device is Windows, so that's the cause? this ssh function only support Linux?

Florianisme commented 1 year ago

Yes, it's only supported on Linux :) It's a bit worriying that the dialog says that a user session was successfully initiated though..

chuwza commented 1 year ago

Yes, it's only supported on Linux :) It's a bit worriying that the dialog says that a user session was successfully initiated though..

Sorry, I don't know much about it, maybe the ssh command for ssh to Windows Server and Linux Server is the same, so it shows user session was successfully create. they are both ssh win_user/linux_user@ip

Florianisme commented 1 year ago

Got it. But you've mentioned that wakeups still dont work when you leave the Broadcast address empty?

chuwza commented 1 year ago

Got it. But you've mentioned that wakeups still dont work when you leave the Broadcast address empty?

The app prompt me that value cannot be null Screenshot_20230823-150452_Wake_on_Lan (小)

Florianisme commented 1 year ago

But that's not the beta version, the "Remote shutdown" is missing. Only in the beta the input field is not required

chuwza commented 1 year ago

But that's not the beta version, the "Remote shutdown" is missing. Only in the beta the input field is not required

I can't download beta version, did you withdraw this update? I was able to download it a couple hours ago, and now even though it's beta, it downloaded as 1.8.0

Florianisme commented 1 year ago

No I didn't.. That's weird

chuwza commented 1 year ago

No I didn't.. That's weird

Oh, I cleared my Play Store cache and 1.8.4 is back! And I test the leave the Broadcast address empty, It still can't work. It works on LAN, but can't work on WAN

Florianisme commented 12 months ago

Would be willing to try a custom version which I provide to you as an APK file?

chuwza commented 12 months ago

Would be willing to try a custom version which I provide to you as an APK file?

Yes, I'd like to try it.

Florianisme commented 12 months ago

Alright, I will provide you one in the following days! Thanks!

chuwza commented 12 months ago

Alright, I will provide you one in the following days! Thanks!

Alright, I will provide you one in the following days! Thanks!

OK, I'll wait for it, thank you too

Florianisme commented 12 months ago

app-release.zip Please try this one. I have to zip it because Github restricts file types for uploads.

This version tries to send wake packets to all connected interfaces of your phone. Normally I am filtering interfaces by their name to some known working ones. But maybe in your case that interface name is not in the list when you are connected via VPN.

chuwza commented 12 months ago

Hello, It didn't work.

Maybe this information is useful. In my LAN, OpenWrt ip is 192.168.1.1, NAS ip is 192.168.1.2. In WireGuard LAN(WireGuard install on OpenWrt), WireGuard ip is 192.168.2.1, my phone ip is 192.168.2.2, and phone can access all devices in LAN