【发布时间】:2025-12-02 17:05:02
【问题描述】:
在这个GET请求中,我不需要服务器的回答,所以循环函数是空的。
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip;
byte localIp[] = {192,168,1,181};
EthernetClient client;
void setup()
{
Serial.begin(9600);
Ethernet.begin(mac , localIp);
delay(1000);//give ethernet time to boot?
byte x[] = { 192,168,1,1 };//my pc , running SimpleHTTPServer (python)
client.connect(x , 8000);
delay(1000);
if(client.connected()){
Serial.println("connected"); //does never print
}
}
void loop()
{
}
我电脑的网络服务器没有收到任何连接请求左右。
【问题讨论】: