Communication arduino and pc using two xbees

This is my first time using Xbee modules. I am using two Xbee Serie 1 modules.

They are programmed as follows:

CH 10 ID 1 DH 0 DL 3 MY 2 CE 0

and

CH 10 ID 1 DH 0 DL 2 MY 3 CE 1

Arduino launches this:

const int ledPin = 13; // the pin that the LED is attached to
int incomingByte;      // a variable to read incoming serial data into

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // read the oldest byte in the serial buffer:
  incomingByte = Serial.read();
 // if it a capital H (ASCII 72), turn on the LED:
   if (incomingByte == 'H') {
      digitalWrite(ledPin, HIGH);
   } 
     // if it an L (ASCII 76) turn off the LED:
   if (incomingByte == 'L') {
     digitalWrite(ledPin, LOW);
   }
}

So, I put the end device on arduino using xbee shield, and the coordinator on xbee explorer. Using the X-CTU software, I write about the coordinator, but nothing happens.

+4
source share
1 answer

, , API X-CTU API, X-CTU with API enable

"" " " "HEX", , , AT, :

  • "L" (L = 4C - ascii):
    7E 00 0F 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 4C A1

  • "H" (H = 48 ascii):
    7E 00 0F 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 48 1E
0

Source: https://habr.com/ru/post/1537163/


All Articles