1 Reply Latest reply on Feb 22, 2016 1:34 PM by Intel_Alvarado

    Intel Galieo Gen2 with XBee S2

    KS_Nathan

      I am quite new to this board and I have been trying to communicate between two galileos using XBee s2's.

      I am using arduino software for this purpose.

      Initially I tried shorting the tx/rx(Serial1) of the gen 2 and tried sending text and simultaneously printing when received.But it started printing junk values like forever until I had to close the program itself.

      below is the code

      ///

      int readValue = 0;

      void setup() {

        // put your setup code here, to run once:

      Serial.begin(9600);

      Serial1.begin(9600);

      }

       

      void loop() {

        // put your main code here, to run repeatedly:

        Serial1.write("Hey how are you?");

        delay(1000);

        if (Serial1.available() > 0) {

         

          int val = Serial1.read();

          Serial.println(val);

        }

      }

      ///

       

      I have a remote router API configured to the coordinator pan(connected to the gen 2).

      Firstly, I had connected tx of module to rx of board, and similarly the rx of module to the tx of board.

      Secondly, I had configured the router API to keep sending its ADC values.

      Another observation was that , when the coordinator and router are connected to a usb and are observed using the XCTU software, I am perfectly receiving the sample values.

      I tried using the XBee-Arduino-Master library, famous one for arduino, for receiving the values but again was unsuccessful.

      I used the below code to print the values coming from the serial port.

      //

       

      void setup() {

        // put your setup code here, to run once:

      Serial.begin(9600);

      Serial1.begin(9600);

      Serial.println("Hello and welcome!!");

      }

       

      void loop() {

        // put your main code here, to run repeatedly:

        if(Serial1.available()){

        Serial.println(Serial1.read(),HEX);

        }

        delay(500);

      }

      //

      Any advice on how to proceed ?