Shop OBEX P1 Docs P2 Docs Learn Events
XBee via SIP Adapter not passing serial data to RX of Arduino — Parallax Forums

XBee via SIP Adapter not passing serial data to RX of Arduino

concyseconcyse Posts: 4
edited 2014-02-18 21:39 in Accessories
I'm trying to test basic communications using XBee (pro s2b) in simple 'AT' mode. Using XCTU's I can pass simple ASCII back and forth, so the XBees are talking to one another fine. Then I connected a Parallax SIP card to to either end and wired them to a pair of Uno's. The Send side of the pair shoots some simple text over the air based on a simple input. I connected the Receive end to an XCTU to ensure the data was transmitting, and the ASCII strings came in just fine - so the Send side of the pair is working great. However, when I put the Receive radio in place and try to capture the RX signal into the Receiving UNO, I get nothing.

I can see all the TX and RX lights flash in a healthy way on the SIP adapter boards. It's as if the Uno's RX isn't listening (put on default pins 0,1 for the serial comms). If I take the XBees out of the equation and wire the RX and TX from both the Uno's directly together the code executes fine and the serial data is passing as it should.

It's as if everything works fine from: Send-UNO > XBee > to other XBee > ...and then the RX signal output from the 2nd XBee isn't 'strong' enough to drive the RX input of the receiving Uno.

Thanks to anyone who has advice to offer.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2014-02-17 17:13
    So, the SIP adapter (from Parallax?) works but your Arduinos don't? Sounds like you should ask in an Arduino forum. If you plan to continue here could we see some code, a drawing of your circuit and pictures of your adapters?
  • concyseconcyse Posts: 4
    edited 2014-02-17 17:40
    Hi Franklin, the SIP "works" as far as I can tell - at least it does on the sensor (send) side of the pair. The receive side seems to receive (shows RSSI light, and RX light). I'm concerned that from leaving the SIP on the Serial Data Out pin that the electrical characteristics don't match with the expectations of the micro controllers RX (input). It's hard to tell from the wiring diagrams what the signal characteristic is coming out - to see if it matches the anticipated 5v signal input (of in this case and Arduino serial port).

    I've greatly reduced the code to bare essentials in order to go upstream as far as possible. I've basically set the receiving end to set pin13 high on the Arduino for any Serial event, and it triggers when I connect serial data directly to the TX/RX from another source.

    I'm suspecting there may be some wiring needed but every respectable tutorial out there doesn't seem to point to any - but few if any are using the SIP adapter as part of their solution either.

    I've tried using a simple SerialEvent() to throw a flag and indicated data received, but nothing. Below is some sample code I've used to test the end-to-end.

    I'm happy to take this to the Arduino group - but I do feel like the answer lies somewhere between the output from the SIP and the input of the Arduino, I just need to find out whose side of the fence this lands.

    Thanks for your help,

    -Bill


    /*
    * ********* Doorbell Basic BELL ********
    * requires pre-paired XBee Radios
    * and the BUTTON program on the receiving end
    * by Rob Faludi http://faludi.com
    */


    #define VERSION "1.00a0"


    int BELL = 13;




    void setup() {
    pinMode(BELL, OUTPUT);
    digitalWrite(BELL, LOW);
    Serial.begin(9600);
    }




    void loop() {
    // look for a capital D over the serial port and ring the bell if found
    if (Serial.available() > 0) {
    if (Serial.read() == 'D'){
    //ring the bell briefly
    digitalWrite(BELL, HIGH);
    delay(1000);
    digitalWrite(BELL, LOW);
    }
    }
    }


    /*
    * ********* Doorbell Basic BUTTON ********
    * requires pre-paired XBee Radios
    * and the BELL program on the receiving end
    * by Rob Faludi http://faludi.com
    */


    #define VERSION "1.00a0"


    int BUTTON = 2;


    void setup() {
    pinMode(BUTTON, INPUT);
    Serial.begin(9600);
    }




    void loop() {
    // send a capital D over the serial port if the button is pressed
    if (digitalRead(BUTTON) == HIGH) {
    Serial.print('D');
    delay(10); // prevents overwhelming the serial port
    }
    }
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-02-18 14:29
    Talking to a few colleagues who know a bit more about the Arduino it seems that the Arduino inputs don't recognize the 3.3V output as a HIGH. I haven't tested this myself, but that is what I am hearing. This could be verified by looking at the datasheet for the chip used in the Arduino UNO (not sure what that is).
  • tdlivingstdlivings Posts: 437
    edited 2014-02-18 14:59
    Hi
    I have used the Sip Adapter with an Ardunio UNO and it works without issue.
    Please note I do not connect it to pins 0 and 1 of the UNO which is the serial port and are even
    labeled rx,tx. This port which you use Serial functions is the port to talk to the terminal and to download new
    code.
    Use the SoftwareSerial library to create a serial port on two other pins, I used pins 2 and 3 which if I remember
    are the ones in the Software Serial examples.

    I did not have to do any level shifting just direct connection to pins 2,3 and setup SoftwareSerial.

    Tom
  • concyseconcyse Posts: 4
    edited 2014-02-18 21:11
    I'm totally going to give this a try - thanks! Let you know how it goes.
  • concyseconcyse Posts: 4
    edited 2014-02-18 21:39
    Tom - you're a genius. For whatever reason, using the "sending" xbee + arduino works when using the default pins 0, 1 for TX/RX. But not not the receiving end, for whatever reason it took using your suggestion to enable alternate pins and use SoftwareSerial.h to accept the incoming stream. Many thanks for your help!

    The final code on the receiving Arduino came out looking like this...

    #include <SoftwareSerial.h>


    int BELL = 13;


    uint8_t recv = 2;
    uint8_t trans = 3;
    SoftwareSerial soft_serial(recv, trans);




    void setup() {
    pinMode(BELL, OUTPUT);
    digitalWrite(BELL, LOW);
    soft_serial.begin(9600);
    }




    void loop() {
    // look for a capital D over the serial port and ring the bell if found
    if (soft_serial.available() > 0) {
    if (soft_serial.read() == 'D'){
    //ring the bell briefly
    digitalWrite(BELL, HIGH);
    delay(1000);
    digitalWrite(BELL, LOW);
    }
    }
    }
Sign In or Register to comment.