Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.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
Arduino Sigfox解析错误:为什么它不能发送我的消息?_Arduino_Message_Parse Error - Fatal编程技术网

Arduino Sigfox解析错误:为什么它不能发送我的消息?

Arduino Sigfox解析错误:为什么它不能发送我的消息?,arduino,message,parse-error,Arduino,Message,Parse Error,我正在测试Sigfox与a和核子-32 L432KC的通讯。我和Arduino一起工作。我可以发送12字节的信息。我用了12个字符来保存我的数据,但它不起作用。然后我用3“int”进行测试,但我总是收到错误消息:“error:parse error”,我不知道为什么 这是我的信息结构: typedef struct { unsigned int temperature; unsigned int latitude; unsigned int longitude; } Payload;

我正在测试Sigfox与a和核子-32 L432KC的通讯。我和Arduino一起工作。我可以发送12字节的信息。我用了12个字符来保存我的数据,但它不起作用。然后我用3“int”进行测试,但我总是收到错误消息:“error:parse error”,我不知道为什么

这是我的信息结构:

typedef struct {
  unsigned int temperature;
  unsigned int latitude;
  unsigned int longitude;
} Payload;
这是我的密码:

#include "IO_WSSFM10.h"

IO_WSSFM10 mySigfox(10, 11, true);

typedef struct {
  unsigned int temperature;
  unsigned int latitude;
  unsigned int longitude;
} Payload;

unsigned int counter=0;

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  mySigfox.begin();
  delay(50);
  mySigfox.test();
  mySigfox.getID();
  mySigfox.getPAC();
  mySigfox.getTemp();

  //mySigfox.setPowerMode(1);
}

// the loop function runs over and over again forever
void loop() {  
  String sfResponse;
  Payload p;
  p.temperature = 1075847679;
  p.latitude = 441300000;
  p.longitude = 41000000;

  bool statusS = mySigfox.send(&p, sizeof(p));
  if (statusS) counter++;

  delay(10000);
  /*
  bool statusSR = mySigfox.sendReceive(&p, sizeof(p), sfResponse);
  if (statusS) {
    for (uint8_t i= 0; i<26; ++i) {//RX= 01 02 03 04 05 06 07 08
      Serial.println(sfResponse[i]);
      counter++;
    }
  }*/
}
#包括“IO_WSSFM10.h”
IO_WSSFM10 mysifox(10,11,真);
类型定义结构{
无符号整数温度;
无符号整数纬度;
无符号整数经度;
}有效载荷;
无符号整数计数器=0;
无效设置(){
//将数字引脚LED_内置初始化为输出。
引脚模式(LED内置,输出);
mysifox.begin();
延迟(50);
mysifox.test();
getID();
getPAC();
mysifox.getTemp();
//mysifox.setPowerMode(1);
}
//循环函数永远反复运行
void loop(){
字符串响应;
有效载荷p;
p、 温度=1075847679;
p、 纬度=441300000;
p、 经度=41000000;
bool status=mysifox.send(&p,sizeof(p));
如果(状态)计数器++;
延迟(10 000);
/*
bool statusSR=mySigfox.sendReceive(&p、sizeof(p)、sfResponse);
如果(状态){

对于(uint8_t i=0;i您省略了草图中非常重要的部分。mysifox来自哪里?mysifox.send()是什么类型的数据预期?在哪一行出现语法分析器错误?如果启用调试输出,会得到什么输出?它没有解释错误在哪里。我只得到消息:Data:error:perse error错误之前,调试打印的结果将显示处理器的代码深度。