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
209 stars 17 forks source link

Quick tiles randomly not working #32

Open DVDAndroid opened 9 months ago

DVDAndroid commented 9 months ago

Sometimes quick tiles do not work when I press on them. I found on the logcat these stacktraces:

E de.florianisme.wakeonlan.wol.WolSender$1: Error while sending magic packet:
E de.florianisme.wakeonlan.wol.WolSender$1: java.io.IOException: sendto failed: EPERM (Operation not permitted)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:721)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.IoBridge.sendto(IoBridge.java:688)
E de.florianisme.wakeonlan.wol.WolSender$1:      at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:126)
E de.florianisme.wakeonlan.wol.WolSender$1:      at java.net.DatagramSocket.send(DatagramSocket.java:723)
E de.florianisme.wakeonlan.wol.WolSender$1:      at de.florianisme.wakeonlan.wol.WolSender$1.sendPacket(WolSender.java:36)
E de.florianisme.wakeonlan.wol.WolSender$1:      at de.florianisme.wakeonlan.wol.WolSender$1.run(WolSender.java:24)
E de.florianisme.wakeonlan.wol.WolSender$1:      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E de.florianisme.wakeonlan.wol.WolSender$1:      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E de.florianisme.wakeonlan.wol.WolSender$1:      at java.lang.Thread.run(Thread.java:1012)
E de.florianisme.wakeonlan.wol.WolSender$1: Caused by: android.system.ErrnoException: sendto failed: EPERM (Operation not permitted)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.Linux.sendtoBytes(Native Method)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.Linux.sendto(Linux.java:235)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.ForwardingOs.sendto(ForwardingOs.java:718)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:398)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.ForwardingOs.sendto(ForwardingOs.java:718)
E de.florianisme.wakeonlan.wol.WolSender$1:      at libcore.io.IoBridge.sendto(IoBridge.java:686)
E de.florianisme.wakeonlan.wol.WolSender$1:      ... 7 more

followed by this warning

W         : Error while pinging device with IP 192.168.1.100
W         : android.system.ErrnoException: sendto failed: EPERM (Operation not permitted)
W         :      at libcore.io.Linux.sendtoBytes(Native Method)
W         :      at libcore.io.Linux.sendto(Linux.java:227)
W         :      at libcore.io.ForwardingOs.sendto(ForwardingOs.java:713)
W         :      at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:390)
W         :      at libcore.io.ForwardingOs.sendto(ForwardingOs.java:713)
W         :      at android.system.Os.sendto(Os.java:653)
W         :      at com.spectrum.android.ping.Ping.sendto(Ping.java:229)
W         :      at com.spectrum.android.ping.Ping.run(Ping.java:163)
W         :      at de.florianisme.wakeonlan.ui.list.status.PingDeviceStatusTester.lambda$scheduleDeviceStatusPings$0$de-florianisme-wakeonlan-ui-list-status-PingDeviceStatusTester(PingDeviceStatusTester.java:51)
W         :      at de.florianisme.wakeonlan.ui.list.status.PingDeviceStatusTester$$ExternalSyntheticLambda0.run(Unknown Source:6)
W         :      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
W         :      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
W         :      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:308)
W         :      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W         :      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W         :      at java.lang.Thread.run(Thread.java:1012)

(192.168.1.100 is my computer I want to wake).

If I open the app and then I press on the quick tile, everything is working normally. Android 14


I have created a fork using this workaround (filtering interfaces by supportsMulticast()) . But that's not the proper fix

patienttruth commented 6 months ago

I just came here looking to see if there was something wrong with my configuration, and this issue may be what I'm experiencing.

Test...

In fact it is.

Previously I had not tested to see if the QuickTile worked after the app had been opened. I just confirmed that it does work after it has been opened, even if I have swiped the app off my switch app screen.

I have a couple of apps that require to have been run to perform certain actions, tailscale for example.

My fix will be to add this app to the list of apps that are launched and minimized by Tasker when the phone boots, hopefully that is a long-term fix, albeit a bandaid of sorts.

To the OG dev, thank you for this awesome app!

DVDAndroid commented 6 months ago

Maybe reading this and implementing something like this can help fix the issue

patienttruth commented 6 months ago

Maybe reading this and implementing something like this can help fix the issue

Thank you! I'll read through these when I get a chance.

Florianisme commented 6 months ago

I don't get the error on my emulator.. Im using Android 14 aswell and force-closed the app before tapping the Quick tile. Or am I missing something here?

patienttruth commented 5 months ago

I don't get the error on my emulator.. Im using Android 14 aswell and force-closed the app before tapping the Quick tile. Or am I missing something here?

Thanks for taking a look!

I haven't gotten into logs or anything, but I don't actually get a user facing error. It just doesn't wake the target computer.

patienttruth commented 5 months ago

I don't get the error on my emulator.. Im using Android 14 aswell and force-closed the app before tapping the Quick tile. Or am I missing something here?

My experience is inconsistant. For a moment after I read your comment yesterday I tried (remotely via VPN) to WOL after a force stop and a restart, and it did seem like it worked, however, I figured I'd test again sitting in front of the PC that I'm waking.

I'm running WOL Monitor on the target which isn't showing the packets being received after a force quit on WakeOnLan, however they show up once I open the app and wake from within the app, or quick tile.

SorceressLyra commented 4 months ago

I'm experiencing the same issue, my quick tile rarely actually works. I most often have to open the app and press wake instead.