我想连接到一个AzureML网络服务。我已经查看了Arduino主页上的POST方法,以及这里的https://iotguys.wordpress.com/2014/12/25/communicating-with-microsoft-azure-eventhub-using-arduino/。
下面是我的设置方法:
void setup()
{
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect.
}
Serial.println("ethernet");
if (Ethernet.begin(mac) == 0) {
Serial.println("ethernet failed");
for (;;) ;
}
// give the Ethernet shield a second to initialize:
delay(1000);
}Post方法的基础是:http://playground.arduino.cc/Code/WebClient
我刚将sprintf(outBuf, "Authorization: Bearer %s\r\n", api_key);添加到标题中,并使用了char* api_key = "the ML Web Service API KEY"
另外,与WebClient中指定的url不同,我使用整个WebService URI作为url,而不指定页面名。
这不管用。
我所连接的网络可以上网。
我做错了什么?
发布于 2015-12-17 07:27:41
您创建的机器学习Studio服务需要接收来自具有SSL执行HTTPS请求能力的设备的请求。AFAIK,Arduino不支持SSL功能。
一个常见的场景是将Arduino附加到第三个设备上,如Raspberry 2等,将其作为网关使用,并从Pi本身进行调用。
这里有一个来自微软开放技术团队的示例项目,它使用了Arduino Uno,Raspberry pi和Azure的东西。
希望这能有所帮助!
https://stackoverflow.com/questions/33229576
复制相似问题