首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Temboo调用挂起Arduino

Temboo调用挂起Arduino
EN

Stack Overflow用户
提问于 2015-12-25 04:55:39
回答 1查看 156关注 0票数 0

我使用的是带有Desloo W5100以太网屏蔽的Arduino Uno。每当我试图使用to调用Parse时,设备就会挂起。有时对minutes...sometimes来说是无限期的。下面是我运行的内容:

代码语言:javascript
复制
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);
}

我在串行监视器上看到了这个:

代码语言:javascript
复制
Current state:6666ÿ &‰ SP  S   P U  WR     SR   R  PR   P 66Temboo error: 223

这表明存在某种类型的HTTP错误,但我从未打印出串行监视器永远停留在那里的错误is...because。最终断线。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-28 15:24:36

我在特波工作。

听起来你可能已经耗尽了你的内存(在资源受限的硬件上,比如Arduino),这是常见的情况。在这里,您可以找到我们的教程,介绍如何在使用to时节省内存使用:

https://temboo.com/hardware/profiles

如果您有进一步的问题,请随时与to支持联系--我们随时都会提供帮助。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34460127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档