Frage

It's my first time using Xbee modules. I'm using two Xbee modules Serie 1.

They are programmed like this:

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 is running 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's a capital H (ASCII 72), turn on the LED:
   if (incomingByte == 'H') {
      digitalWrite(ledPin, HIGH);
   } 
     // if it's 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'm writing on the coordinator, but nothing happens.

War es hilfreich?

Lösung

After you attach your coordinator with PC, you have to configure your coordinator in the API mode and let the X-CTU work with it in API mode , X-CTU with API enable

After that go to "Terminal" and by clicking the "Assemble Packet" button and choose the "HEX" radio button, now you can write your frame which is going to be received by the End Device which is working in AT Command mode, and the frame should be like this :

  • For 'L' value (L = 4C is ascii):
    7E 00 0F 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 4C A1

  • For 'H' value (H = 48 in ascii):
    7E 00 0F 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 48 1E
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top