0

Desloo W5100 イーサネット シールドを備えた Arduino Uno を使用しています。Temboo を使用して Parse を呼び出そうとすると、デバイスがハングアップします。時には数分間…時には無期限に。これが私が実行するものです:

void updateParseDoorState() {

  if (!ENABLE_DOOR_STATE_PUSHES) {
    Serial.println("Door state pushing disabled. Skipping.");
    return;
  }

  Serial.println("Pushing door state to database...");

  TembooChoreo UpdateObjectChoreo(client);

  // Invoke the Temboo client
  UpdateObjectChoreo.begin();

  // Set Temboo account credentials
  UpdateObjectChoreo.setAccountName(TEMBOO_ACCOUNT);
  UpdateObjectChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
  UpdateObjectChoreo.setAppKey(TEMBOO_APP_KEY);

  // Set profile to use for execution
  UpdateObjectChoreo.setProfile("ParseAccount");

  // Set Choreo inputs
  String ObjectIDValue = "xxxxxxxxxx";
  UpdateObjectChoreo.addInput("ObjectID", ObjectIDValue);
  String ClassNameValue = "DoorState";
  UpdateObjectChoreo.addInput("ClassName", ClassNameValue);
  String ObjectContentsValue = (currentState == OPEN) ? "{\"isOpen\":true}" : "{\"isOpen\":false}";
  UpdateObjectChoreo.addInput("ObjectContents", ObjectContentsValue);

  // Identify the Choreo to run
  UpdateObjectChoreo.setChoreo("/Library/Parse/Objects/UpdateObject");

  // Run the Choreo; when results are available, print them to serial
  int returnStatus = UpdateObjectChoreo.run();
  if (returnStatus != 0){
    setEthernetIndicator(EthernetStatus::SERVICES_DISCONNECTED);
    Serial.print("Temboo error: "); Serial.println(returnStatus);
    // read the name of the next output item
    String returnResultName = UpdateObjectChoreo.readStringUntil('\x1F');
    returnResultName.trim(); // use “trim” to get rid of newlines
    Serial.print("Return result name: "); Serial.println(returnResultName);

    // read the value of the next output item
    String returnResultData = UpdateObjectChoreo.readStringUntil('\x1E');
    returnResultData.trim(); // use “trim” to get rid of newlines
    Serial.print("Return result data: "); Serial.println(returnResultData);
  }

  /*while(UpdateObjectChoreo.available()) {
    char c = UpdateObjectChoreo.read();
    Serial.print(c);
    }*/
  UpdateObjectChoreo.close();

  Serial.println("Pushed door state to database!");
  Serial.println("Waiting 30s to avoid overloading Temboo...");
  delay(30000);
}

シリアルモニターでこれを取得します:

Current state:6666ÿ &‰ SP  S   P U  WR     SR   R  PR   P 66Temboo error: 223

これは、何らかのタイプの HTTP エラーが発生していることを示していますが、エラーの内容を出力することはできません。そしてついに脱線。

4

1 に答える 1

3

天望で働いています。

ボードのメモリが不足しているようです (Arduino のようなリソースに制約のあるハードウェアでよく発生します)。Temboo の使用中にメモリ使用量を節約する方法に関するチュートリアルは、次の場所にあります。

https://temboo.com/hardware/profiles

他にご不明な点がございましたら、いつでもお気軽に Temboo サポートまでお問い合わせください。いつでも喜んでお手伝いいたします。

于 2015-12-28T15:24:36.820 に答える