Shop OBEX P1 Docs P2 Docs Learn Events
XBee Wifi & Propeller Activity Board, how to connect? — Parallax Forums

XBee Wifi & Propeller Activity Board, how to connect?

banjobanjo Posts: 443
edited 2014-01-13 06:14 in Accessories
So I received a XBee Wifi and thought it would be a piece of cake to connect physically and electronically to the PAB (perhaps it still is?). According to the PAB guide however, the XBee RF socket is not supporting the XBee Wifi.

<....... XBee RF Module Socket
This socket fits most XBee wireless modules ...NOTE: This socket does not support XBee Wi-Fi. See also 12) XBee Access, p. 4....>

As the pin spacing is different than on the breadboard, I can neither plug it in there without adapters that might be challenging to find where I live. Of course I'd be glad to order them from Parallax, but will then wait for ~2 weeks for the mail to arrive

I'm now accordingly looking for guidance on below questions:
1. Is it correct that the RF socket is not supporting the XBee Wifi?
2. How should I then connect them physically and electronically?
3. Any links or documentation for the software side (C or Spin)?

-Thomas
«1

Comments

  • jazzedjazzed Posts: 11,803
    edited 2014-01-08 08:03
    Which Wifi XBee module do you have?

    Can you post a link here to the PAB guide that says you can't use the module?

    I have a Digi International S6B Wifi XBee module that I've been talking to in the XBee socket. Haven't had time to work up a driver yet, but it is in my plan.
  • banjobanjo Posts: 443
    edited 2014-01-08 08:13
    I have same S6B as you, so if you've been able to talk to it I should also be able to do it. Is it connected same way as a XBee RF? If you know of some links to guide me further, I'd appreciate to get them

    The PAB guide is here: http://www.parallax.com/sites/default/files/downloads/32910-Propeller-Activity-Board-Guide-v1.0.pdf
  • jazzedjazzed Posts: 11,803
    edited 2014-01-08 08:31
    Hmm. I don't see a valid explanation. I posted the SimpleIDE code I used to talk to the module here. Please note the comment about connecting DO and DI. I left RTS/CTS floating. To test for communication with the module after power up, just type +++ After that you should see OK. Writing code to use the module is another story of course, but Digi has a wonderful User Guide for the S6B which can be found here.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 08:45
    I am pretty sure that that reference pertains to power supply issues on the Propeller Activity Board and the prior version of the XBee WiFi.

    The XBee WiFi S6B has the following specifications:

    Transmit Current up to 309 mA
    Receive Current 100 mA
    Supply Voltage 3.14 to 3.46 VDC

    The prior XBee WiFi S6 has these specifications, which were in effect when we prepared the Propeller Activity Board documentation:

    Transmit Current up to 260 mA
    Receive Current 140 mA
    Supply Voltage 3.1 to 3.6 VDC

    Nothing stands out here, so I did a little more digging and came across this document http://www.digi.com/pdf/xbee-wi-fi-s6 to-s6b-migration-guide.pdf where I found this important note:

    Screen Shot 2014-01-08 at 8.47.19 AM.png

    The S6 can't be used in any Propeller Activity Boards because of the requirement for the large capacitor. The S6B will work in the Activity Board Revision B (B has a 1 uF capacitor on the XBee power supply pin). The S6B may/may not work in the Propeller Activity Board Revision A because it does not have the 1 uF capacitor. A small capacitor is recommended for XBee power supply pins.

    Also, you're probably wondering about when we have stock of Propeller Activity Board Revision Bs. Probably not for another 60 days minimum.

    So, plug it in! Share the results.

    Ken Gracey
  • jazzedjazzed Posts: 11,803
    edited 2014-01-08 08:50
    Thanks Ken.

    Assuming things work out, you will be seeing several demos with that module. I hope that eventually it will be viable enough for you to stock for resale.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 08:53
    jazzed wrote: »
    Thanks Ken.

    Assuming things work out, you will be seeing several demos with that module. I hope that eventually it will be viable enough for you to stock for resale.

    We already have hundreds in stock - they're just not available for sale yet. The activity you're seeing here is because I've sent some out to a few customers (including Thomas, in Finland) to start working with them. Chris Savage is working on a quick start setup guide and web descriptions. Shall I throw one into the USPS queue to you?

    Ken Gracey
  • jazzedjazzed Posts: 11,803
    edited 2014-01-08 09:09
    I have one already Ken.

    Excellent choice of hardware BTW. :) Great user docs, programming API, and all necessary agency approvals.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-08 09:16
    I've been playing with these for the last couple of days in between tech calls and e-mail which is why I haven't caught as much stuff like this on the forums. I used the original version of the XBee Wi-Fi Modules and while I did get them working on our boards/adapters, I had to put an extra capacitor right at the power pins to keep the inrush current from resetting everything. The current units we have in stock do not exhibit this and came right up for me in X-CTU. Speaking of which I am using the newest version of X-CTU which has been totally rewritten.

    In order to get a pair of these talking between each other over my network I needed only set the SSID, Encryption and passcode using them in transparent mode. I was able to then go to the terminal windows and connect to both modules and send data across from one to the other. Both were connected to my PC via the XBee USB Adapter Rev B and I could send data from one and see it in the terminal window on the other. I also did the typical loopback test where I connected DIN/DOUT together on one and data sent to it was returned. My next test will be to see if I can send data between my home office and Parallax.
  • banjobanjo Posts: 443
    edited 2014-01-08 09:27
    jazzed wrote: »
    Hmm. I don't see a valid explanation. I posted the SimpleIDE code I used to talk to the module here. Please note the comment about connecting DO and DI. I left RTS/CTS floating. To test for communication with the module after power up, just type +++ After that you should see OK. Writing code to use the module is another story of course, but Digi has a wonderful User Guide for the S6B which can be found here.

    Just plugged it in and connected as above, it worked right away (giving OK after +++)! This is on PAB Rev A.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 09:27
    Chris, Thomas is in Finland and has less [quick] access to some of the goodies we take for granted, like an XBee USB Adapter. Can you think of a way he could get these connected up to X-CTU with a Propeller Activity Board, breadboard (and PropPlug?) or some other improvised method? If he were here I could simply hand him what he needs.

    Reason I'm helping him out is because he's going to spend a bit of time on the iPad/XBee SB6/Propeller concept.

    Ken Gracey
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 09:28
    banjo wrote: »
    Just plugged it in and connected as above, it worked right away (giving OK after +++)! This is on PAB Rev A.

    OK, in this case you should be able to configure it with Spin/C code. Won't be as quick and easy as using an XBee USB Adapter, but at least you can keep moving forward.

    See if your iPad can recognize this device, too.

    Ken Gracey
  • banjobanjo Posts: 443
    edited 2014-01-08 09:43
    Seems to be my lucky day so far! I'm connected and can write AT commands to get response (got some Deja vu flash backs from the 80's connecting to BBS's with 1200 baud modem...)
    And it is visible on the iPad as well.
    Continuing with hooking it up correctly to my WLAN with security keys etc.

    -Thomas
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 10:04
    banjo wrote: »
    Seems to be my lucky day so far! I'm connected and can write AT commands to get response (got some Deja vu flash backs from the 80's connecting to BBS's with 1200 baud modem...)
    And it is visible on the iPad as well.
    Continuing with hooking it up correctly to my WLAN with security keys etc.

    -Thomas

    Great progress. Wish I could make the time to do this, too! At least I can work with and through you guys.

    Once you can see it on iPad you should be able to give it a single line of TechBASIC code and send data to it.

    Ken Gracey
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-08 11:38
    Ken Gracey wrote: »
    Chris, Thomas is in Finland and has less [quick] access to some of the goodies we take for granted, like an XBee USB Adapter. Can you think of a way he could get these connected up to X-CTU with a Propeller Activity Board, breadboard (and PropPlug?) or some other improvised method? If he were here I could simply hand him what he needs.

    Reason I'm helping him out is because he's going to spend a bit of time on the iPad/XBee SB6/Propeller concept.

    Ken Gracey

    The XBee requires a minimum of VCC, GND, DOUT and DIN for communication, so any of those methods and more are available (including the PAB). However to update firmware (which I did have to do) you also need RTS & DTR, limiting methods and really requiring the adapter board. I also needed to reset my module at some point which requires access to the reset pin.
  • banjobanjo Posts: 443
    edited 2014-01-08 12:36
    Ken Gracey wrote: »
    Great progress. Wish I could make the time to do this, too! At least I can work with and through you guys.

    Once you can see it on iPad you should be able to give it a single line of TechBASIC code and send data to it.

    Ken Gracey

    Current status:

    As I'm not getting anywhere further apart from seeing the XBee on my iPad, I have a few questions:
    1. On my iPad under Settings/Wi-Fi, should I connect to the xbee-adapter or should it be enough that it is visible there?
    2. Will it be a point-to-point contact?
    - If not (meaning it will be routed through my WLAN-router), then I need to set up the WLAN-connection (SSID, encryption etc.) on the Xbee. This I'm able to do, but then I don't see it anymore on my iPad...
    3. In TechBasic I'm trying to connect to the IP I'm getting from XBee with the "AT MY" and the port ($2616) through "AT DE" commands with below code. No luck yet.
    DIM url AS STRING, t AS DOUBLE
    url = "192.168.1.10"
    Comm.openTCPIP(1, url, $2616)
    t = System.ticks
    found = 0
    WHILE System.ticks - t < 1.0
      IF Comm.isreadyforoutput(1) THEN
        found = 1
        t = t - 1.0
      END IF
    WEND
    IF NOT found THEN
      PRINT "The connection to "; url; " failed."
    END IF
    
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 13:51
    banjo wrote: »
    Current status:

    As I'm not getting anywhere further apart from seeing the XBee on my iPad, I have a few questions:
    1. On my iPad under Settings/Wi-Fi, should I connect to the xbee-adapter or should it be enough that it is visible there?
    2. Will it be a point-to-point contact?
    - If not (meaning it will be routed through my WLAN-router), then I need to set up the WLAN-connection (SSID, encryption etc.) on the Xbee. This I'm able to do, but then I don't see it anymore on my iPad...
    3. In TechBasic I'm trying to connect to the IP I'm getting from XBee with the "AT MY" and the port ($2616) through "AT DE" commands with below code. No luck yet.
    DIM url AS STRING, t AS DOUBLE
    url = "192.168.1.10"
    Comm.openTCPIP(1, url, $2616)
    t = System.ticks
    found = 0
    WHILE System.ticks - t < 1.0
      IF Comm.isreadyforoutput(1) THEN
        found = 1
        t = t - 1.0
      END IF
    WEND
    IF NOT found THEN
      PRINT "The connection to "; url; " failed."
    END IF
    

    Hey banjo!

    I think you're after a point-to-point connection, so you'd want to connect it from your iPad Settings/WiFi (#1 and #2).

    Not sure about the third item just yet. You now know much more about this effort than I do, as I've only got time to lend lots of interest and encouragement from afar. There is a tutorial I came across with Arduino that looked pretty good, along with a SparkFun tutorial. . . let me get those links - here they are:

    http://www.byteworks.us/Byte_Works/Blog/Entries/2013/9/11_Connecting_to_an_Arduino_with_and_iPhone_or_iPad.html
    https://learn.sparkfun.com/tutorials/xbee-wifi-hookup-guide?utm_source=SparkFun+Customer+Newsletter&utm_campaign=87cda1c527-Dec2_Dec6Newsletter&utm_medium=email&utm_term=0_fa5287abaf-87cda1c527-60569285

    Both of these should help you out with the TechBASIC code.

    Man this looks interesting.

    Ken Gracey
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-08 13:54
    If you enter the SSID, Encryption Type and passkey the XBee Wi-Fi Module should obtain the gateway address and an IP address (assuming DHCP) automatically. If you want the XBee Wi-Fi module to be an access point I believe you must leave the SSID section null, though I haven't tested that yet. On the iPad, since I don't have one I can't test this theory, but I wonder if in your connection from TechBASIC you need to specify the port as well? Also, there is a setting for UDP and TCP. I hope this helps.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-08 13:57
    Thanks, Chris. I'm getting tempted to just drop my iPad in the mail to you. After all, I use the darned thing like any other Apple customer - not the way I'd LIKE to see it used with our products. You'd probably get there a lot faster.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-08 14:29
    Every time there's an iPad giveaway I sign up. I've got to be due any time now! Besides, if you give yours away, when we figure this thing out you won't be able to just pick it up and try it.
  • banjobanjo Posts: 443
    edited 2014-01-08 22:31
    Ken Gracey wrote: »
    Hey banjo!

    I think you're after a point-to-point connection, so you'd want to connect it from your iPad Settings/WiFi (#1 and #2).

    Not sure about the third item just yet. You now know much more about this effort than I do, as I've only got time to lend lots of interest and encouragement from afar. There is a tutorial I came across with Arduino that looked pretty good, along with a SparkFun tutorial. . . let me get those links - here they are:

    http://www.byteworks.us/Byte_Works/Blog/Entries/2013/9/11_Connecting_to_an_Arduino_with_and_iPhone_or_iPad.html
    https://learn.sparkfun.com/tutorials/xbee-wifi-hookup-guide?utm_source=SparkFun+Customer+Newsletter&utm_campaign=87cda1c527-Dec2_Dec6Newsletter&utm_medium=email&utm_term=0_fa5287abaf-87cda1c527-60569285

    Both of these should help you out with the TechBASIC code.

    Man this looks interesting.

    Ken Gracey

    Thanks for the links, don't know how I missed the one from Byteworks. Might have been the late hour...
    As I understand the TechBasic example they use a direct connection, so I will try to replicate the same.
    Earlier I've in TechBasic been able to establish a ftp-connection for writing and reading a file on a ftp-server, so I'm not a complete newbie on that side.

    Now back to "real" work for some hours

    -Thomas
  • banjobanjo Posts: 443
    edited 2014-01-08 22:48
    If you enter the SSID, Encryption Type and passkey the XBee Wi-Fi Module should obtain the gateway address and an IP address (assuming DHCP) automatically. If you want the XBee Wi-Fi module to be an access point I believe you must leave the SSID section null, though I haven't tested that yet. On the iPad, since I don't have one I can't test this theory, but I wonder if in your connection from TechBASIC you need to specify the port as well? Also, there is a setting for UDP and TCP. I hope this helps.

    Thanks Chris. I'll continue to try with a direct connection as the XBee gets invisible on iPad once it is connected to my WLAN.
    I've tried to use the default XBee port setting (0x2616) in the TechBasic code. A perhaps stupid question: is 0x indicating a hex number?
    Anyhow I've in TechBasic tried with both $2616 (hex) and 2616 (dec) with no difference.

    In another post you mentioned about that a small capacitor might be needed to keep the inrush current from resetting everything. Another stupid question, how would I connect that on my PAB with the XBee in the XBee socket? Or is it perhaps not needed as I'm able to connect from a terminal window in SimpleIde?
  • David BetzDavid Betz Posts: 14,514
    edited 2014-01-09 12:20
    I got my Xbee Wi-Fi module from Digi-Key today. Now I just have to wade through that thick manual to figure out how to use it! :-)

    Is the API for this module anything like the Wiznet module that is on the Spinneret?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-09 14:48
    banjo wrote: »
    A perhaps stupid question: is 0x indicating a hex number?
    Anyhow I've in TechBasic tried with both $2616 (hex) and 2616 (dec) with no difference.

    In another post you mentioned about that a small capacitor might be needed to keep the inrush current from resetting everything. Another stupid question, how would I connect that on my PAB with the XBee in the XBee socket? Or is it perhaps not needed as I'm able to connect from a terminal window in SimpleIde?

    Yes, 0x prefix indicates a Hexadecimal value. $ is also used in some languages. What I meant about the port is perhaps you have to specify it, yes, but also you may need to change it.

    As for the mention of the capacitor that was required on the older original XBee Wi-Fi when used with our adapters. That is not the case with the current S6B units, including if Ken sent you one.

    Once I get my hands on an iPad (hoping for an iPad 2) I can do some of my own experimenting on not only Tech BASIC but apps in general that communicate with out hardware.
  • banjobanjo Posts: 443
    edited 2014-01-10 09:43
    Yes, 0x prefix indicates a Hexadecimal value. $ is also used in some languages. What I meant about the port is perhaps you have to specify it, yes, but also you may need to change it.

    As for the mention of the capacitor that was required on the older original XBee Wi-Fi when used with our adapters. That is not the case with the current S6B units, including if Ken sent you one.

    Once I get my hands on an iPad (hoping for an iPad 2) I can do some of my own experimenting on not only Tech BASIC but apps in general that communicate with out hardware.

    Ok, thx for the clarifications. I've also tried setting the port on XBee side and in TechBasic to same.
    I've now been able to ping the XBee from my iPad, this is done through my router which was easy enough to configure on XBee with AT commands. On iPad I'm using the app System Scope lite to ping and getting a response.
    Still I'm not though able to get TechBasic to communicate to or from the XBee ip-address. I've followed same example as in the TechBasic example Ken linked to.
    On XBee side I'm just initializing it through AT commands and then "spamming" with sending a * character according to the code snippet below. TechBasic is then trying to read from the IP-address, but timing out after a few seconds.
    ...
        while(1)  {
          ch = "*";
          putChar(ch);
          writeChar(xbee, ch);
        }
    ...
    
    BTW Is <...Serial.write("*");...> in Arduino C same as writeChar(xbee, "*") ?
    Am I perhaps missing something completely here?
  • David BetzDavid Betz Posts: 14,514
    edited 2014-01-10 12:41
    banjo wrote: »
    Ok, thx for the clarifications. I've also tried setting the port on XBee side and in TechBasic to same.
    I've now been able to ping the XBee from my iPad, this is done through my router which was easy enough to configure on XBee with AT commands. On iPad I'm using the app System Scope lite to ping and getting a response.
    Still I'm not though able to get TechBasic to communicate to or from the XBee ip-address. I've followed same example as in the TechBasic example Ken linked to.
    On XBee side I'm just initializing it through AT commands and then "spamming" with sending a * character according to the code snippet below. TechBasic is then trying to read from the IP-address, but timing out after a few seconds.
    ...
        while(1)  {
          ch = "*";
          putChar(ch);
          writeChar(xbee, ch);
        }
    ...
    
    BTW Is <...Serial.write("*");...> in Arduino C same as writeChar(xbee, "*") ?
    Am I perhaps missing something completely here?
    If this is C code I think you'll want this:
    ...
        while(1)  {
          ch = '*';
          putChar(ch);
          writeChar(xbee, ch);
        }
    ...
    
    Double quotes makes an array of characters. Single quotes is a single character.
  • banjobanjo Posts: 443
    edited 2014-01-10 13:03
    David Betz wrote: »
    If this is C code I think you'll want this:
    ...
        while(1)  {
          ch = '*';
          putChar(ch);
          writeChar(xbee, ch);
        }
    ...
    
    Double quotes makes an array of characters. Single quotes is a single character.

    Thanks David, I'm always mixing between Basic and C... Corrected now my C code.
    I installed Wireshark on my PC to monitor the Wi-fi traffic and I can see that the XBee now is sending out whatever character I've put in 'ch'. So it seems that my problem now lies more on the iPad or TechBasic side as it is not able to connect or read from the XBee IP-address.
    Hmm, one option would be to try to get my PC and XBee to talk to each other through Wi-fi, and when that is working go back to TechBasic again with hopefully fresh ideas.
    For the PC side it would be nice to find some starting code for Wi-fi communication.

    -Thomas
  • David BetzDavid Betz Posts: 14,514
    edited 2014-01-10 13:06
    banjo wrote: »
    For the PC side it would be nice to find some starting code for Wi-fi communication.

    -Thomas
    Isn't Wi-Fi communications just the same as any TCP/IP communications if you know the IP address and port number? You might even be able to use putty to talk to the Propeller.
  • banjobanjo Posts: 443
    edited 2014-01-10 14:13
    Success!
    It was the port it was hanging on. For whatever reason the port number was 9750 even if I set it to 2000 on XBee.
    The code I used in TechBasic to transfer an appropriate text is below and the result that iPad/TechBasic received is in the attachment.
    Next step would be to get some LED blinking, but as it is over midnight here I'll leave it to the weekend.

    Thanks Ken, Chris, David and others helping!

    -Thomas
    DIM url AS STRING, t AS DOUBLE
    url = "192.168.1.2"
    
    Comm.openTCPIP(1, url, 9750)
    
    print "Port open"
    
    while 1=1
    if not eof(1) then
      get #1,,b~
      print chr(b~);
    end if
    wend
    
    t = System.ticks
    found = 0
    
    WHILE System.ticks - t < 5.0
      IF Comm.isreadyforoutput(1) THEN
        found = 1
        t = t - 1.0
      END IF
    WEND
    
    IF NOT found THEN
      PRINT "The connection to "; url; " failed."
    END IF
    
    590 x 640 - 262K
  • David BetzDavid Betz Posts: 14,514
    edited 2014-01-10 14:56
    Congratulations on getting this working! Now I have to try it on my Xbee Wi-Fi module.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-01-10 15:02
    Yeah! Congrats on getting the basic connectivity working. You may have overcome the biggest hurdles. Provided you have some examples with TechBASIC you should be able to produce some kind of iPad to Propeller control, maybe bi-directional. This is an important first step. I can't help but imagine if you could create a bi-directional ActivityBot control system with your framework.

    I'll keep watch of the thread, Thomas. But feel free to bring me back to take a look via e-mail if I go dormant for too long.

    Ken Gracey
Sign In or Register to comment.