【问题标题】:Receiving data on XBee module on a XBee explorer from a XBee module on an Arduino从 Arduino 上的 XBee 模块接收 XBee 浏览器上的 XBee 模块上的数据
【发布时间】:2015-11-20 11:21:12
【问题描述】:

我有一个由以下人员组成的网络:

A:使用 XBee shield v1.1 安装在 Arduino UNO 上的 XBee S2 模块,配置为 Zigbee 路由器/终端设备 AT 模式。

B:安装在 XBee 浏览器上的 XBee S2 模块连接到带有 XCTU 软件的 PC,配置为 Zigbee 协调器 AT 模式。

我将以下代码上传到 Arduino。如您所见,A 正在等待接收数据。当A接收到数据后,开始向B发送数据,B接收到。

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  establishContact();
}

void loop() {
    Serial.println('A'); // It is shown in B
    delay(2000)
}

void establishContact() {
  while (Serial.available() <= 0) {
    delay(300);
  }
  Serial.readString(); // Read data from B
}

问题:

如果 Arduino 运行以下代码,A 在从 B 接收任何数据之前向 B 发送数据,那么 B 不会从 A 接收数据(没有 LED 闪烁)。

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
}

void loop() {
    Serial.println('A'); // It isn't shown in B
    delay(2000);
}

【问题讨论】:

    标签: arduino communication xbee


    【解决方案1】:

    您是否尝试过在 API 模式下使用 xbee A?请说明您要发送给 B 的数据。 据我所知,您需要在 API 模式下将 xbee 连接到 MCU,而不是 AT 模式。您可以参考 Robert Faludi 的《Building Wireless Sensor Networks》一书。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-22
      • 1970-01-01
      • 1970-01-01
      • 2010-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-06
      相关资源
      最近更新 更多