Shop OBEX P1 Docs P2 Docs Learn Events
RN-XV Wifly and BS2 through XBee SIP Adapter — Parallax Forums

RN-XV Wifly and BS2 through XBee SIP Adapter

piolepiole Posts: 8
edited 2013-11-22 14:14 in Accessories
Hi,

I'm connecting my BS2 to my Wifly with the help of the XBee SIP adapter http://www.parallax.com/tabid/768/ProductID/691/Default.aspx
so that the adapter does the 5V / 3.3V conversion.

Using the SERIN command I managed to make the BS2 read serial data sent by the Wifly - no problem there.
But I can't get the serial out to work properly.
I tried all possible values of baud settings on the WiFly and the BS2.
If I use the value 84 (which works perfectly for SERIN) for SEROUT, the Wifly does not receive anything : the "show stats" command says zero byte received, zero error, and the RX LED is not blinking.
If I use the value 16468 (inverted) the Wifly seems to receive data but it is garbled (weird characters displayed in Wifly console, and "show stats" reports many errors).
If I add a 10 ms pace in the SEROUT I can reduce the amount of errors, but the characters are still garbled.
Tried to reduce baud rate to 4800 and 2400 with no luck...
The only thing I didn't try is to use flow control, but I can't see why it would help.

Anyone has every made this work ?
Any idea ?
Could the problem come from the XBee SIP adapter ?

Thanks

Paul

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-06-19 06:18
    It has worked for me. The Baud constant of 84 should work. The fact that SERIN works suggests that the problem is either in the WiFly module or the SIP adapter. I'd suggest contacting Parallax Tech Support directly.
  • piolepiole Posts: 8
    edited 2013-06-22 11:12
    Thanks a lot.
    I contacted Tech support, waiting for their answer.

    Just guessing : I think I read somewhere that in the beginning a few customers received adapters with an inverted diode.
    On my adapter, with Baud 84 the LED is always off and that with 16468 (inverted polarity) the LED is always on... sounds like the same issue, no ?
  • piolepiole Posts: 8
    edited 2013-06-24 11:04
    Hello again Mike,

    The tech support says : "The adapters have logic level buffers on them to protect the XBee modules, which are most likely the cause of your corrupted data. The buffers are not spec'd to work with a WiFly module".

    You said it has worked for you, meaning BS2 + SIP Adapter + WiFly ?

    Paul

  • Mike GreenMike Green Posts: 23,101
    edited 2013-06-24 14:25
    That's what I remember. I'll have to find my SIP Adapter though. It'll be the weekend before I'll have time to hunt for it.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-06-25 21:50
    Interestingly, the Wifly module has it's RTS and CTS pins reversed (at least in designation) from the XBee modules. On an XBee Module pin 12 is /CTS and pin 16 is /RTS. On the Wifly module pin 12 is RTS and pin 16 is CTS. That aside, it appears from looking at the datasheet that the Wifly is supposed to be pin compatible with an XBee. If that is the case then the SIP adapter should work fine. The only lines that are buffered are DIN, DOUT, ASSOC, DTR, RSSI, RTS and CTS. Seven lines. As for your query about the diode and baud modes...they aren't related. The diode is connected to the RESET line only. If you don't connect anything to that line nothing happens anyway. The reason the LED stays on when you invert the baud mode is because you're changing the idle state of the line. In non-inverted baud mode (which you should be using) the idle state of the signal is HIGH. The LED is wired so that is is active-low so that it comes on when the signal lines transitions LOW, such as when data is coming in. When you set inverted baud mode the line is always low holding the LED on.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-06-30 09:46
    I found my SIP adapter and it indeed works fine with the WiFly module and both my Propeller Board of Education at 5V (with a 10K resistor in series with DOUT and DIN ... could be 3.3K if you want) and my BASIC Stamp HomeWork Board. 9600 Baud is a bit of a stretch for the BS2, so you may want to use some other microcontroller to change the Baud of the WiFly module to something like 2400 if you're using it with a Stamp.
  • damenvanvlietdamenvanvliet Posts: 2
    edited 2013-08-07 12:29
    Did anyone ever have any luck with this? I'm hammering away on it now, and I seem to be having the same problems that Paul was having.

    Thanks in advance,
    Damen
  • damenvanvlietdamenvanvliet Posts: 2
    edited 2013-08-07 16:26
    switched to a bs2p, and it seems to have sorted the issue out. The bs2 just can't handle the data rate I guess. Whew....
  • piolepiole Posts: 8
    edited 2013-11-04 15:33
    Sorry it took me forever to reply.
    Thanks a lot Mike and Chris for your answers.

    There must be something I'm doing incorrectly but i can't find out what.
    It doesn't seem to be a baud issue, I lowered it to 2400 (using Wifly telnet).
    I never get the RX LED to blink and never get any RX on the wifly (unless in inverted mode, or a few random bytes at BS2 powerup).

    Damen, I even did like you and tried with a bs2p(x) but still no improvement. Did you do anything special to make it work ?

    Maybe I'll try to get rid of the adapter and plug the Wifly directly (I read somewhere that some arduino guy even managed to get it work without any voltage divider)...
  • Mike GreenMike Green Posts: 23,101
    edited 2013-11-06 10:34
    Don't try to wire a WiFly directly to a Stamp. You may burn out the WiFly. It's not designed to handle the 5V logic signals from the Stamp.
  • piolepiole Posts: 8
    edited 2013-11-22 14:14
    Finally ! I got rid of the SIP adapter... and now it works perfectly. Even at 9600 bauds.

    There is a 3.3V adapter to power the Wifly and a simple 2-resistor divider for the 5V basic stamp SEROUT.
    If anyone's interested the tutorial is here
    http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Wireless/Zigbee/maxstreaminterface3.pdf

    P
    aul
Sign In or Register to comment.