V
V
Vladimir2021-05-08 16:43:24
Python
Vladimir, 2021-05-08 16:43:24

How to use this script from GitHub?

I need to send magic packets (Wake On Lan) to turn on LG TV with Web OS. With Raspberry Pi. I found a Python 3 script: https://github.com/bentasker/Wake-On-Lan-Python , but I don’t understand how to run it through the terminal.

wol.py [hostname]

What to prescribe instead of hostname?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
ScriptKiddo, 2021-05-08
@DHARMA373

Create .wol_config.ini Filename starts with a dot
Set broadcast address if different.
broadcast=192.168.1.255
Add the mac address of the device. The name in square brackets will be the hostname
of [myPC]
mac=00:2a:a0:cf:83:15

# Save this file as .wol_config.ini in the same directory as wol.py

[General]
broadcast=192.168.1.255

[myPC]
mac=00:2a:a0:cf:83:15

[myLaptop]
mac=00:13:0d:e4:60:61

Run like this:
wol.py myLaptop

A
Alexey Yarkov, 2021-05-08
@yarkov

I guess the address of the TV

P
pfg21, 2021-05-08
@pfg21

cezh open source - look what's in the source.
https://github.com/bentasker/Wake-On-Lan-Python/bl...
# Check mac address format
found = re.fullmatch('^([A-F0-9]{2}(([: ][A-F0-9]{2}){5}|([-][A-F0-9]{2}){5})|([\s][A-F0-9]{2 }){5})|([a-f0-9]{2}(([:][a-f0-9]{2}){5}|([-][a-f0-9]{ 2}){5}|([\s][a-f0-9]{2}){5}))$', macaddress)
#We must found 1 match , or the MAC is invalid
script requires mac address network connection piece of iron, which must be woken up.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question