查看“Microduino ENC Network (4)”的源代码
←
Microduino ENC Network (4)
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language | Microduino ENC网络(四)}} {| style="width: 800px;" |- | ==Objective== This tutorial will show you how to power on a PC using the wake on Lan feature and your Microduino. ==Equipment== *'''[[Microduino-Core]]''' *'''[[Microduino-FT232R]]''' *'''[[Microduino-ENC28J60]]''' *'''[[Microduino-RJ45]]''' *Other equipment **USB cable ==Requirements== Almost all the actual network adapters have a feature called Wake on Lan, that is the ability to “wake” the PC with a special command sent through the network. Two main requirements to use this feature: if your network adapter is not embedded in the motherboard, you have to connect them with a cable [[File:netCardConnetMotherBoard.jpg|600px|center|thumb]] the WOL functionality has to be enabled in the BIOS: [[File:BIOSSetup1.jpg|600px|center|thumb]] A typical limit in WOL usage is that network adapter isn’t able to wake the PC if it was shut down by power loss. Actually, recent motherboards can enable WOL functionality even after a power loss; you can configure this feature in motherboard’s BIOS: [[File:BIOSSetup2.jpg|600px|center|thumb]] Magic Packet: The wake command is issued sending on the network a specific packet, called Magic Packet (refer to http://en.wikipedia.org/wiki/Wake-on-LAN#Magic_packet). This packet is receved by all the devices connected to local network because it presents – as destination MAC address – the broadcast address (FF:FF:FF:FF:FF:FF). It includes six bytes valued FF, followed by the target PC’s MAC address repeated 16 times. Even if it’s not important which high level protocols you choose, it’s a convention to use UDP protocol and destionation port 7 or 9. ==Schematic== *Microduino-ENC28J60 *Microduino-RJ45 *Microduino-Core *Microduino-FT232R Stack all modules and then connect the ethernet cable, as follows: [[File:MicroduinoENCShow.jpg|600px|center|thumb]] ==Program== Refer to ENCnetwork4 ==Debug== Step 1:Download the EtherCard library and copy to your libraries fold of IDE, then restart IDE. https://github.com/jcw/ethercard Step 2:Explain the program: Note: EtherCard library had a bug in the Magic Packet creation. I solved the problem and my change has been accepted in the official repository: so make sure to download library’s latest version You can use sendWol() method to send the Magic Packet; that method needs target PC’s MAC address as a parameter: static byte targetmac[] = {0x00,0x1A,0x4B,0x38,0x0F,0x5C}; ... ether.sendWol(targetmac); Step 3:Compile the code and download it. Step 4:Using a network analysis tool like Wireshark, you can inspect the packet sent by Microduino and note that it’s correct: in red the destination broadcast MAC address in green the choice of IP and UDP protocol in light blue the target PC’s MAC address repeated 16 times [[File:Wireshark.jpg|600px|center|thumb]] ==Result== You PC will be waken by Microduino. ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Microduino ENC Network (4)
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息