Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add support for Wake On Lan endpoint #2

Open
na-ji opened this issue May 28, 2024 · 1 comment
Open

[Feature request] Add support for Wake On Lan endpoint #2

na-ji opened this issue May 28, 2024 · 1 comment

Comments

@na-ji
Copy link

na-ji commented May 28, 2024

Hello,

This is a feature request: would it be possible to support the Wake on Lan endpoint, please? This would allow using the bash script to automatically start devices, and schedule them with cron.
I didn't find the documentation of this endpoint on the internal documentation available on mafreebox.freebox.fr, but I did find it here: https://dev.freebox.fr/sdk/os/lan/
I tested on Insomnia and it works well.

What do you think?

@nbanb
Copy link
Owner

nbanb commented Oct 15, 2024

Hi

Sorry for my late answer.
OK, it seems to be a good idea.

I did find the documenation in the developper section of mafreebox.freebox.fr on : API List > Configuration > LAN Browser > Wake On LAN

For the moment (until it's been officially added to the library), as it's a simple instruction you can use machine_1 to wake up machine_2 from freebox API :

machine_2 mac address ; 06:c2:93:c3:0b:df
machine_2 password :

user@machine_1 $ add_freebox_api lan/wol/pub '{"mac":"06:c2:93:c3:0b:df","password":""}'
{"success":true}

or
machine_2 mac address ; 06:c2:93:c3:0b:df
machine_2 password : passwd

user@machine_1 $ add_freebox_api lan/wol/pub '{"mac":"06:c2:93:c3:0b:df","password":"passwd"}'
{"success":true}

And it seems to work, as on machine_2, running (192.168.0.254 is my freebox local address) :

root@machine_2 # tcpdump -nnei enp0s3 -vvvttttXXX 'host 192.168.0.254'

while issuing from machine_1 :

user@machine_1 $ add_freebox_api lan/wol/pub '{"mac":"06:c2:93:c3:0b:df","password":"passwd"}'
{"success":true}

give this output on machine_2 (The Wake-On-Lan signal is recieved with the password) :

tcpdump -nnei enp0s3 -vvvttttXXX 'host 192.168.0.254' 
tcpdump: listening on enp0s3, link-type EN10MB (Ethernet), snapshot length 262144 bytes
2024-10-15 10:37:22.121794 34:27:92:XX:XX:XX > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 150: (tos 0x0, ttl 64, id 14556, offset 0, flags [DF], proto UDP (17), length 136)
    192.168.0.254.47492 > 192.168.0.255.9: [bad udp cksum 0x4bd4 -> 0x38a6!] UDP, length 108
	0x0000:  ffff ffff ffff 3427 9263 3990 0800 4500  ......4'.c9...E.
	0x0010:  0088 38dc 4000 4011 b63a c0a8 64fe c0a8  ..8.@.@..:..d...
	0x0020:  64ff b984 0009 0074 4bd4 ffff ffff ffff  d......tK.......
	0x0030:  06c2 93c3 0bdf 06c2 93c3 0bdf 06c2 93c3  ................
	0x0040:  0bdf 06c2 93c3 0bdf 06c2 93c3 0bdf 06c2  ................
	0x0050:  93c3 0bdf 06c2 93c3 0bdf 06c2 93c3 0bdf  ................
	0x0060:  06c2 93c3 0bdf 06c2 93c3 0bdf 06c2 93c3  ................
	0x0070:  0bdf 06c2 93c3 0bdf 06c2 93c3 0bdf 06c2  ................
	0x0080:  93c3 0bdf 06c2 93c3 0bdf 06c2 93c3 0bdf  ................
	0x0090:  7061 7373 7764                           passwd

So WOL seems to work fine and to be quiete easy to develop in the library

Regards
nbanba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants