Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
官方Arduino代码:Web客户端示例不';我不工作_Arduino_Webclient - Fatal编程技术网

官方Arduino代码:Web客户端示例不';我不工作

官方Arduino代码:Web客户端示例不';我不工作,arduino,webclient,Arduino,Webclient,我试图从示例中实现官方的Arduino Web客户端代码 住在这里的:, 但不幸的是,这对我不起作用 上传完这个草图后我该怎么办??? 这是我改为的唯一一行: IPAddress ip(192, 168, 1, 178); 我要做的是转到url: 192.168.1.178(在我的本地网络中,其他草图在这个ip中工作得很好),如果我很好地理解了这个代码的功能,我们会从google的服务器请求一个特定的页面,所以服务器会响应,并通过我们在代码中发出的get请求将这个页面带给我们。不幸的是,它没有

我试图从示例中实现官方的Arduino Web客户端代码 住在这里的:, 但不幸的是,这对我不起作用

上传完这个草图后我该怎么办??? 这是我改为的唯一一行:

IPAddress ip(192, 168, 1, 178);
我要做的是转到url: 192.168.1.178(在我的本地网络中,其他草图在这个ip中工作得很好),如果我很好地理解了这个代码的功能,我们会从google的服务器请求一个特定的页面,所以服务器会响应,并通过我们在代码中发出的get请求将这个页面带给我们。不幸的是,它没有加载任何页面


如果我所说的有任何错误,请告诉我。

您的以太网控制器接线是否完美

以太网屏蔽允许您通过SPI总线将WizNet以太网控制器连接到Arduino或Genuino板。它使用引脚10、11、12和13将SPI连接到WizNet。较新型号的以太网屏蔽板上也有SD卡。数字引脚4用于控制SD卡上的从属选择引脚

以下是防护罩的示意图,以获取帮助:

看你的连续剧。是这样写的吗

无法使用DHCP配置以太网

还是这样说

连接

您的路由器使用192.168.1而不是192.168.0或192.168.2吗

是否有其他设备具有相同的IP地址

如果没有任何效果,请尝试替换这段代码

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
}
用这个

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    if(Ethernet.begin(mac, ip) == 0) {
        Serial.println("Failed to configure Ethernet using IP address. 
        Circuit hanged.");
        while(1){}
    }
}
如果该代码:

无法使用IP地址配置以太网。电路悬挂


当然,如果您使用的是WiFi屏蔽,这个示例将不起作用。尝试wifi屏蔽的示例,该示例包含在其库中。

您的以太网控制器接线是否完美

以太网屏蔽允许您通过SPI总线将WizNet以太网控制器连接到Arduino或Genuino板。它使用引脚10、11、12和13将SPI连接到WizNet。较新型号的以太网屏蔽板上也有SD卡。数字引脚4用于控制SD卡上的从属选择引脚

以下是防护罩的示意图,以获取帮助:

看你的连续剧。是这样写的吗

无法使用DHCP配置以太网

还是这样说

连接

您的路由器使用192.168.1而不是192.168.0或192.168.2吗

是否有其他设备具有相同的IP地址

如果没有任何效果,请尝试替换这段代码

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
}
用这个

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    if(Ethernet.begin(mac, ip) == 0) {
        Serial.println("Failed to configure Ethernet using IP address. 
        Circuit hanged.");
        while(1){}
    }
}
如果该代码:

无法使用IP地址配置以太网。电路悬挂


当然,如果您使用的是WiFi屏蔽,这个示例将不起作用。试试wifi屏蔽的示例,它包含在它的库中。

有人能告诉我吗?有人能告诉我吗?