Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.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
Push notification Arduino和PushingBox通知_Push Notification_Arduino_Arduino Uno - Fatal编程技术网

Push notification Arduino和PushingBox通知

Push notification Arduino和PushingBox通知,push-notification,arduino,arduino-uno,Push Notification,Arduino,Arduino Uno,当使用PushingBox API触发某个事件时,我试图从Arduino向电子邮件发送通知,但连接返回0,有时返回-1 有人能帮忙找出问题所在吗 //向PushingBox发送请求的函数 void sendToPushingBox(字符设备[]){ client.stop(); 如果(调试)Serial.println(“连接…”); client.connect(serverName,80);//伪调用 延迟(3000); int conn=client.connect(serverName,

当使用PushingBox API触发某个事件时,我试图从Arduino向电子邮件发送通知,但连接返回0,有时返回-1

有人能帮忙找出问题所在吗

//向PushingBox发送请求的函数
void sendToPushingBox(字符设备[]){
client.stop();
如果(调试)Serial.println(“连接…”);
client.connect(serverName,80);//伪调用
延迟(3000);
int conn=client.connect(serverName,80);
//实际调用返回0
int clientConnect=client.connected();
串口打印(clientConnect);
连续打印(“”);
序列号:println(康涅狄格州);
如果(客户端连接){
如果(调试)Serial.println(“已连接”);
if(DEBUG)Serial.println(“sendind请求”);
client.print(“GET/pushingbox?devid=”);
客户端打印(devid);
client.println(“HTTP/1.1”);
client.print(“主机:”);
client.println(服务器名);
client.println(“用户代理:Arduino”);
client.println();
Serial.println(“已发送请求”);
}否则{
如果(调试)Serial.println(“连接失败”);
}
}

您正在调用
客户端。connect(serverName,80)
两次,我们不知道您的
serverName
是什么,这可能是问题的根源。请在下面查找服务器名称和设备ID。char DEVID1[]=“v4E*************”;char serverName[]=“api.pushingbox.com”;我有两个调用,因为第一个调用会将Arduino和以太网连接初始化为虚拟调用,因为我意识到需要一秒钟或两秒钟才能将连接排序,而第二个调用是实际调用。