Shop OBEX P1 Docs P2 Docs Learn Events
Trying to figure out this XBee business on my SpinStudio setup — Parallax Forums

Trying to figure out this XBee business on my SpinStudio setup

Brann FenixBrann Fenix Posts: 57
edited 2009-10-27 18:48 in Propeller 1
Let me start by saying this is my first attempt at playing with a prop, but I have done some work with the BS2 a few years ago. Here are the details on my setup:


SpinStudio main board (Tested and known working)
SpinStudio XBee Adapter (Build it today and I have no bridged connection, all my solder work looks solid)
Series 2 XBee 2mw chiptenna (from SparkFun)
Trusty PropPlug [noparse]:)[/noparse]

My first question on this after reading a bunch of other post and tutorials is can I run the X-CTU utility to configure my XBee using my SpinStudio setup. I think my issue is I need to configure the XBee before I can just toss it on my propeller setup, but I may be wrong. I did not order the USB carrier board when I order the XBee units because I assume I could do anything the serial to USB board did with my propeller setup... Was I mistaken?

The next thing that puzzled me was what I read on the uncontroller.com docs for the XBee page. It says "You can also utilize the XBee as a simple serial device. One demo Spin program that can be used to test your XBee setup is Jeff Ledger's PropCOMM(http://forums.parallax.com/attachment.php?attachmentid=49347)." I have been hopelessly lost trying to figure out how to modify that code to test my XBee. I tried changing the RX and TX pins, but that did not seem to do anything for me. I assume I am missing something simple and I am not looking for advanced spoon feed or anything. I would be super happy with getting the LED on my adapter to show some sign on life like the XBee is even on... Then maybe a "Hello World" or two [noparse]:)[/noparse]

I know there are some people on here with some XBee skills based on my search results, but I did not want to thread jack anyone and I could not find anyone attempting to use a SpinStudio setup in place of the usb dev boards out there for x-ctu.

Thanks in advance,
Brann


*******Edit********

We have a blinky light [noparse]:)[/noparse]
I was looking at the XBee object in the exchange and used the sample code to get the XBee to what I assume is initialized (Waited the 5 second delay then blinked once) So, it looks like something is working. But I still need to figure out this whole X-CTU Business.

Post Edited (Brann Fenix) : 9/11/2009 3:22:53 AM GMT

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-09-11 05:40
    I had a thread similar to this a while ago. Nothing has been done since then. http://forums.parallax.com/showthread.php?p=814317

    Note that you can use a prop plug as a serial converter for the xbee.
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-09-11 14:16
    I configured my XBees by mounting them on Selmaware SIP boards, powering them up, and using the Propplug with the X-CTU software.

    It looks to me like if you want to·use X-CTU with an XBee mounted on the SpinStudio board you'll need to set up a serial connection with it, perhaps connecting Propplug pins to the appropriate pins on the SpinStudio board (I don't know if the levels are right! Get someone who does to confirm it·before you do this!).

    Alternatively the XBee settings can be read and changed through regular Prop programs. Here

    http://selmaware.com/appbee/AppBee_Doc.PDF

    is documentation for sending those commands from a Stamp: you should be able to modify them for use with a Prop. I think it'd be a whole lot easier to make a serial connection and use X-CTU, though.
  • Brann FenixBrann Fenix Posts: 57
    edited 2009-09-12 02:51
    SRLM said...
    I had a thread similar to this a while ago. Nothing has been done since then. http://forums.parallax.com/showthread.php?p=814317

    Note that you can use a prop plug as a serial converter for the xbee.


    Can you tell me more about using the Prop Plug as a serial converter for the xbee? I read that and it really got me thinking... Looking at the sparkfun USB explorer schematics over at www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Explorer.pdf to me at least it just looks like there is a usb to serial connecting to some pins on the xbee and supplying the required 3.3 volts for the xbee to power up. The Prop Plug to my understanding is pretty much just a usb to serial chip in a very nice little setup... Why can't I breadboard a USB interface to connect my xbee to my computer via the prop plug? I assume you are talking about the same thing... and any tips you can kick my way in this process would be great. I see that the Tx from the Prop Plug would go to pin 3 on the xbee, Rx to pin2 and reset to pin5. Is it really that simple to talk to the xbee? I would have to feed it 3.3v on pin1, but other than that am I missing something? This could save me $30 and a wasted few days for a usb xbee interface to come in the mail if I can work this out [noparse]:)[/noparse]
  • SRLMSRLM Posts: 5,045
    edited 2009-09-12 06:14
    It's fairly straight forward. Basically, you need to connect the prop plug tx to the XBee rx, and the prop plug rx to the XBee tx. You also need to connect the prop plug ground and the XBee ground. You'll need a source of 3.3v for the XBee. The Prop plug reset line is left unconnected. From there, it's no different than a XBee USB platform. I found X-CTU to be fairly simple to use.
  • Brann FenixBrann Fenix Posts: 57
    edited 2009-09-13 22:58
    I GOT IT!!! [noparse]:)[/noparse]

    Thanks to SRLM for confirming I can use the prop plug to talk to the xbee, Tracy Allen for talking about the whole Coordinator flash and EndPoint/Router Flash and Martin Hebel for his example code [noparse]:)[/noparse]


    I built up my breadboard with my 3.3v supply, a pin header for the prop plug and connected everything up to a xbee adapter board from www.ucontroller.com. From there I was able to see my xbee in X-CTU and flash one of my xbees into the Coordinator AT firmware . I then tried to fire up Martin's example code and it sent some random garbage from my endpoint xbee connected to my prop. This boggled me for a day and a half... I was reading over the 100 page xbee manual and coming up with not a lot of help and honestly I am not 100% what was causing the problem.

    I did the restore on both xbee devices via X-CTU and loaded the Coordinator into my usb interface to monitor on the X-CTU then loading up this code on the prop with the end point:

    CON 
        _clkmode = xtal1 + pll16x      '80MHz operating frequency.
        _xinfreq = 5_000_000                      
    
    
    OBJ 
      XB   : "XBee_Object"       
      Comm : "FullDuplexSerial"  
      Num  : "Numbers"
    
    Pub Start | check
        XB.start(22,23,0,9600)           ' XBee Comms - RX,TX, Mode, Baud
        XB.AT_Init                     ' Initialize for fast AT command use - 5 second delay to perform
        Comm.start(31,30,0,9600)       ' Initialize comms from Prop to PC
        num.init                       ' Initialize Numbers object
    
        
        XB.AT_Config(string("ATDL 0"))            ' Set destination address to 0 which is ALWAYS the address of the Coordinator
        XB.Str(string(13,"Hello World!",13))    ' TX string
        XB.Dec(1)                               ' TX value
        XB.tx(13)                                 ' TX carraige return
    
        XB.Str(string(13,"Hello Word!!",13))    ' TX string
        XB.Dec(2)                               ' TX value
        XB.tx(13)                                 ' TX carraige return                                                 
    
    
    




    I powered on the prop with that program load and what do you know... In my terminal window on the other xbee chip I got back:

    Hello World!
    1

    Hello World!!
    2

    WooFREAKINhoo it took me the weekend of screwing with it BUT now I can send data from one device to the other. Range is perfect too where I can send from my 2nd floor to my basement [noparse]:)[/noparse]

    If anyone is still having issues with AT mode and they can not get a simple point to point serial emulation connect setup please hit me up. I would love to give you a hand and save you from the weekend of head scratching I went through.


    Thanks again,
    -Brann
  • RSimontonRSimonton Posts: 10
    edited 2009-09-13 23:16
    That's great!·

    Some people think we are crazy spending·so much time just to turn on an LED or transmit a few characters!

    I will probably take you up on your offer.· I am ordering xbees tonight.· Can I ask what model you are using?· I am just looking for a couple hundred feet and I would rather not have the external or whip antenna.

    Thanks

    Rob
  • Brann FenixBrann Fenix Posts: 57
    edited 2009-09-14 00:41
    Those people just don't get that if you can get it to turn on a single LED you can use that same logic to arm a nuclear warhead [noparse]:)[/noparse] It all starts with that first step of getting your project to do something on command... ANYTHING! [noparse]:)[/noparse] hehe...

    Goofing aside I grabbed the XBees from sparkfun and went with series 2.5 ones. I picked the XBee 2mW Series 2.5 Chip Antenna because of the on board antenna for low profile installs. I hope that does not come back to bite me when I mount it in a project box... only time will tell [noparse]:)[/noparse]
    What I would seriously recommend unless money is really tight is the XBee Explorer USB for like $25. I had to rig up a mess with my bread board to supply 3.3v and connect my prop plug to get it working because I was being cheap. If could of went to a store and got the usb explorer I would of had one 2 hours into my project. It would be VERY nice to monitor the prop side with the prop plug and then the usb side with dedicated hardware in a nice neat form factor. With my current setup I would need a keyboard and a tv/monitor to monitor my prop side since my prop plug is tied up being xbee interface. Also, be sure to buy the adapters for the XBee units since they do not fit into a bread board [noparse]:([/noparse]

    I will be sure to post more of my adventures in xbee land as they progress and post your success stories or questions... I am not an expert, but I did go through the motions and can tell you what NOT to do... [noparse]:)[/noparse]
  • RSimontonRSimonton Posts: 10
    edited 2009-09-14 15:35
    I would only need one of the Explorer USB boards, the one could be used to configure the both Xbees?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Rob Simonton
  • Brann FenixBrann Fenix Posts: 57
    edited 2009-09-14 16:01
    1 usb interface will do the trick [noparse]:)[/noparse]

    The usb interface just kind of works like a base station for the XBee modules. You can swap them out in the socket of the board when you want to configure one and you can monitor the one currently connected to the interface via a terminal or the X-CTU app. The usb connection is also useful for sending data to your remote XBee installed on the propeller board for testing. For example if I want to change what my Propeller based XBee does or sends I would normally need to reprogram the prop, but with the usb interface I can feed configuration and data commands directly to the XBee via the usb cable and have that be the coordinator device. VERY helpful!
  • AnandaAnanda Posts: 2
    edited 2009-09-28 11:13
    RSimonton & Brann Fenix,

    If you are willing to spend $25.00 for USB Explorer from Sparkfun, you might instead consider buying the XBIB-U USB board manufactured by Digi International (http://www.digi.com/support/kbase/kbaseresultdetl.jsp?id=2118&hit=Interface board schematic#knowledgebase) for $60.

    You can buy at this price from Digikey.com (Part # XBIB-U-ND; http://search.digikey.com/scripts/DkSearch/dksus.dll?lang=en&site=US&WT.z_homepage_link=hp_go_button&KeyWords=XBIB-U&x=27&y=13 ).

    I bought this board to use for XBee firmware upgrades, and as a base station connected to the PC. I had read that firmware upgrades would not be possible with USB adapters from third parties. However, I am pleased to hear that the Sparkfun USB board worked just as well for Brian. In addition, I bought a Prop Plug for use with Prop Proto Boards.
  • Ken GraceyKen Gracey Posts: 7,401
    edited 2009-10-27 18:48
    Nothing to add here except to say "thanks" to the various posters and replies in this thread. I was able to cut my initial XBee hookup time down from a day to an hour thanks to the information found on this forum.

    Must say, that X-CTU software and these XBee modules are really slick!

    Ken Gracey
    Parallax Inc.
Sign In or Register to comment.