2013-04-23 6 views
3

Cosiled에 Shiled Ethernet으로 Arduino Mega에서 데이터를 업로드 할 수 없습니다. 튜토리얼 예제 (DatastreamUpload.ino) 중 하나를 시도했다. 여기 자습서 스케치로 arduino mega에서 Cosm으로 데이터를 업로드 할 수 없습니다

Ethernet.begin(mac, ip, gateway, subnet); 

이 출력됩니다 : 다음

byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0xD3, 0x45 }; 
    IPAddress ip(192,168,0, 110); 
    IPAddress gateway(192,168,0, 1); 
    IPAddress subnet(255, 255, 255, 0); 

: 나는 다음과 같이 정적 IP 주소를 사용하도록 init() 기능을 COSM이 등록에서 나에게 준 API 키와 공급 ID를 사용 변경 시리얼 모니터에서 :

 
Read sensor value 452.00 
Uploading it to Cosm 
cosmclient.put returned -1 

Read sensor value 451.00 
Uploading it to Cosm 
cosmclient.put returned -1 

Read sensor value 378.00 
Uploading it to Cosm 
cosmclient.put returned -3 

Read sensor value 352.00 
Uploading it to Cosm 
cosmclient.put returned -3 

누구에게 해결책이 있습니까?

답변

0

현재로서는 문서가 부족합니다. 찾으려면 소스 코드를 살펴 봐야합니다.

// The end of the headers has been reached. This consumes the '\n' 
static const int HTTP_SUCCESS =0; 
// Could not connect to the server 
static const int HTTP_ERROR_CONNECTION_FAILED =-1; 
// This call was made when the HttpClient class wasn't expecting it 
// to be called. Usually indicates your code is using the class 
// incorrectly 
static const int HTTP_ERROR_API =-2; 
// Spent too long waiting for a reply 
static const int HTTP_ERROR_TIMED_OUT =-3; 
// The response from the server is invalid, is it definitely an HTTP 
// server? 
static const int HTTP_ERROR_INVALID_RESPONSE =-4; 
+0

아직 cosm 포럼을 보았습니다. arduino가 pachube 서버와 통신 할 수 없다는 것을 알고 있습니다. 하지만 그 이유는 모르겠다. 이더넷으로 이더넷을 시작하려고하면 Ethernet.begin (mac) 가끔 데이터가 pachube에 도착합니다 ... 이것은 여전히 ​​나에게있어서의 미스터리입니다! 누구든지 도울 수 있니? 감사! – user2312976

+0

DHCP를 사용하면 디버깅에 좋은 시작이 될 것입니다 ... IP 구성에서 문제가 될 가능성이 큽니다. – errordeveloper

0

당연히, 당신이 링크 이노 100 % 정결보고 내가 사용했던 것과 다른 아무것도 볼 투쟁 :이 오류 코드는 아래와 같이 HttpClient.h에 정의되어 있습니다.

예방책으로 넣으겠습니다. int ret = 0; 루프

난 당신이 하나 개의 센서를 가지고 있지만 꼼꼼하게 당신을 제안 실현의 시작 는

내가 가진 sensorId0로 식별 전체 병이 게시 된

const int bufferSize = 100; char bufferValue[bufferSize]; CosmDatastream datastreams[] = { CosmDatastream(sensorId0, strlen(sensorId0), DATASTREAM_FLOAT),

버퍼 지난 10 월 cosm 공개 토론.

저는 IP, 게이트웨이 및 서브넷 물건을 사용하지 않습니다. 그것은 아마도 물을 muddying입니다.