Shop OBEX P1 Docs P2 Docs Learn Events
XBEE RF Contolled UAV — Parallax Forums

XBEE RF Contolled UAV

plau45plau45 Posts: 109
edited 2014-09-04 09:06 in Learn with BlocklyProp
I can't find any tutorial that features the XBee 900HP Module (XBP9B-DMST-002). This agrivates me because I cannot figure out how the two xbees communicate with each other. None of the tutorials I have read will work with the xbees I bought and I will not spend another 70 dollars on two more xbees. Please someone help me. I don't want $76 to go to waste. I am using an activity board and communicating commands to it through a qucik start board with joysticks and buttons. HELP! Any tutorial or PDF that would help me would be amazing. Once my scimatics for the multirotor UAV are done I will send them to this forum. I plan on making a controller that uses a 9 volt power supply along with the plane using the same thing. Thanks

Comments

  • plau45plau45 Posts: 109
    edited 2014-08-31 08:36
    Thanks a bunch. It looks like It will help me a bunch. Much appreciated.
  • plau45plau45 Posts: 109
    edited 2014-08-31 14:09
    I still don't understand how I would transmit the data I get from the controller. I just see a bunch of specifications about the XBee module in particular. Some of it was helpful but not all of it. I need help finding out how to transmit the data I get from the controller and sending it to the activity board in the UAV so I can control pitch, yaw, roll, and things like that.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-08-31 14:57
    A good first step is to transmit with a wire between the Propellers. Once you can use wired communication, add the XBees.
  • plau45plau45 Posts: 109
    edited 2014-09-01 19:26
    I'm talking about the code. I don't get that. I know about connections I just need help with the codes.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-01 20:19
    plau45 wrote: »
    I'm talking about the code. I don't get that. I know about connections I just need help with the codes.

    Most XBees will work in transparent mode where they transmit to each other as if they were connected with a wire. I'm not sure if the XBees you're using need to be setup with X-CTU software before they'll communicate with each other or not. You might need to set the destination serial number of the XBees to match the serial number of the unit you want it to communicate with (as mentioned on page 33 of the manual).

    You could also set the destination serial number to 0x000000000000FFFF which is the broadcast destination.

    I haven't used those particular XBees but I've used the 900MHz XSC version and I think they should work the same way (at least for basic communication).

    There are a lot of ways to connect and set things wrong and if you already had a wired communication between two microcontrollers, you'd at least know the serial communication part of the problem had been solved and you could work on replacing the wired link with the radios.
  • edited 2014-09-02 08:31
    plau45 wrote: »
    None of the tutorials I have read will work with the xbees I bought and...


    I just tested this one with the XBee HP900 modules with this tutorial. They are compatible and work fine with it:

    http://learn.parallax.com/propeller-c-simple-protocols/full-duplex-serial

    P.S.

    IMPORTANT: The tutorial assumes that the XBees still have their factory default settings. If they have been configured some other way with X-CTU software as discussed in other posts on this thread, then it might not work as advertized.
  • edited 2014-09-02 16:06
    I also started an XBee library a while back. It doesn't capture multi-line command mode replies or API mode yet, but it's nice for basic stuff like basic command mode settings and communication in transparent mode.

    Here are a couple examples (attached) that use the library to implement a tilt controlled ActivityBot. They are written for the XBee S1 and for your S3B.

    Wiring info and other instructions are in the comments at the top of each example program.
  • plau45plau45 Posts: 109
    edited 2014-09-02 20:00
    Ok, thanks guys. Andy, I never thought of trying the xbee tutorial with the XBees I have. By the way I read it, it sounded like you had to have those particular XBees. I'll give it a test tomorrow night and see what I can try. I just got m supplies like motors and xbee adapters and bread boards from the main site so I'll start to assemble the whole thin than start coding. Thanks for the support. I'll tell you how it all goes. Thanks for the attachments too. I'd love to see a version for multiline commands. Thanks.
  • GenetixGenetix Posts: 1,754
    edited 2014-09-02 22:00
    Andy, what about the code from the XBee Tutorial?
    http://www.parallax.com/product/32450
  • edited 2014-09-03 16:58
    Yeah, that book is significantly more comprehensive. Both it and the short ones on Learn are for the XBee S1. The XBee Pro S3B starts to the same default mode, so it works with the shorter tutorials on the learn site because they don't start using features that might differ from the XBee Pro S3B. I suspect that there will be some sticking points in the book, where certain features don't work the same. I still think using the book is worth a try with the Pro S3B. Just make sure to keep the manual linked in post #2 ready in case something doesn't work because it needs slightly different parameters or something like that.
  • plau45plau45 Posts: 109
    edited 2014-09-03 19:21
    I got a chance to see those codes. Now correct me if I'm wrong, but the app that controls the activity bot uses its own microcontroller when the activity bot uses its own too. Each code that you wrote goes to different microcontrollers. So in my case I could use both an activity board and a quick start board. And if I can, where would I be able to go and get the "xbeedev05.h" library so I could use these commands. I'm getting more understanding seeing how this code works. I would also like to know if you are going to do a Simple Folders Index category on this if there isn't one already. Thanks. It seems great.
  • plau45plau45 Posts: 109
    edited 2014-09-03 20:03
    Again I'm not sure, but it didn't look like you used any code from the half-duplex or full-duplex serial library. How does this work if you aren't using serial communication.
  • edited 2014-09-03 20:53
    Yes, one of the programs runs in the tilt controller, which sends radio messages to an Xbee that broadcasts them. The XBee on the robot receives them and relays them to the robot's Propeller chip. That Propeller chip controls the robot according to the messages it receives.

    When you unzip the folder, there should be a couple of .side project files, .c code files, and a library folder named libxbeedev05. After installing SimpleIDE http://learn.parallax.com/propeller-c-set-simpleide, you can use it to open one of the project files, edit, compile, and/or load the code into a propeller and run it. There are some primers for editing/compiling/loading & running here http://learn.parallax.com/propeller-c-start-simple and here http://learn.parallax.com/propeller-c-simple-circuits, and lots more to choose from here http://learn.parallax.com/propeller-c-tutorials.

    Just make sure to open the project .side file from a folder you unzipped to, not from within the zip itself. Also, make sure to either keep the libxbeedev05 folder in the same folder or in a sub-folder with your .side and .c files. Alternately, you can place libxbeedev05 inside ...Documents/SimpleIDE/Learn/Simple Libraries/. After putting it there, you can put your .side and .c file (together, both of them) in pretty much any folder on the drive, and it'll still be able to find the library for xbee_open and xbee_cmd. The xbee_open call causes the library to set up a full duplex serial connection and returns you a pointer that you can use with anything in the simpletext libary, like writeChar and dprint.

    The libxbeedev05 library is still pretty early in its development, but I use it a lot because xbee_cmd saves a lot of coding work when configuring XBee modules. I prefer to always have my code configure them on startup because configuring them with X-CTU can create mysteries for other folks trying a variety of different applications. If the XBees always have their factory defaults, the code can normally do any special configurations that X-CTU can do. The only exception is firmware upgrades.

    P.S. Before diving into the libxbeedev05 library to examine the header and code, try the library primer first, its here: http://learn.parallax.com/propeller-c-library-studies
  • Ken GraceyKen Gracey Posts: 7,395
    edited 2014-09-03 21:13
    plau45 wrote: »
    I don't want $76 to go to waste.

    Don't let that be a deterrent to getting this project underway. If it doesn't work out for some reason I'll happily refund the purchase - not a problem whatsoever. Though we can't resell this kind of returned product one of our tech guys (or myself) would be very happy to have a pair of the long-distance XBees on our desk :)

    Oh, one more thing. We have successfully flown an ELEV-8 over XBee last year. We used the Quantam Robotics robotic controller with an XBee Tx/Rx (50 mW, 802.15.11 I think) and sent pulses to another XBee on the ELEV-8 which fed them right into the OPEN board. Worked well enough to fly without experiencing any discernible latency.

    Ken Gracey
  • plau45plau45 Posts: 109
    edited 2014-09-04 09:06
    Wow I didn't know we could do this. Although I think I am going to get this whole thing figured out all right. I'm learning more about this and I should be able to get my project done. And I forgot about the library being with the code when I unzip it. I should of looked closer. :P
Sign In or Register to comment.