爱快软路由对笔记本实现网络唤醒

    本人有一台爱快软路由作为动态域名和端口映射,实现通过阿里域名远程访问内网设备。一台X201笔记本连接在软路由上。由于X201电池已经卸下无法实现来电开机,只能通过爱快e云APP手动实现网络唤醒,感觉非常麻烦。爱快云web端也不能实现开机唤醒X201.

  用树莓派3B+可以实现软路由开机后唤醒X201笔记本,但感觉功耗比较大。

  通过爱快的Docker插件安装NodeRed实现了网络唤醒。

 NodeRed Docker插件

 实现网络唤醒的流图

实现上述流图需要安装node-red-node-wol节点

 

inject节点设置如图,注意画红线的部分设置

 wake on lan节点设置

  MAC Address 设置要唤醒笔记本的mac地址

 Number of Packets 可以根据需要填写发送的次数

Interval Between Packets 2组魔术包之间的间隔,默认100ms

 

 完整源代码

  注意MAC Address 根据自己笔记本的填写

[
    {
        "id": "f6f2187d.f17ca8",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "10ffeedf651e02e9",
        "type": "inject",
        "z": "f6f2187d.f17ca8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 100,
        "wires": [
            [
                "b7a7c949d1f6d382",
                "9f56a1e344018e9b"
            ]
        ]
    },
    {
        "id": "b7a7c949d1f6d382",
        "type": "wake on lan",
        "z": "f6f2187d.f17ca8",
        "mac": "xx:de:f1:xx:39:xx",
        "host": "172.16.0.5",
        "udpport": 9,
        "numpackets": "6",
        "interval": 100,
        "name": "wakeOnLan",
        "x": 410,
        "y": 100,
        "wires": []
    },
    {
        "id": "9f56a1e344018e9b",
        "type": "debug",
        "z": "f6f2187d.f17ca8",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 400,
        "y": 160,
        "wires": []
    }
]

 

 另外,NodeRed服务器我自己设置了账户和密码,如果只是用NodeRed实现自动网络唤醒,而不需要远程访问可以取消端口设置,保证安全。

猜你喜欢

转载自blog.csdn.net/armcsdn/article/details/128781499
今日推荐