Xbee Communications with propeller.
medelman
Posts: 21
Maybe I don't have a very good understanding of serial communication, but I want to try and use the zig bee chips from max stream for communication between my robot and the pc. I have all of the hardware interfaced properly as I can send a few AT commands from the Propeller to the PC through the xbee. My idea is to create an interface to control the robot remote via the pc. Eventually it will be autonomous. For the PC interface I'll using some programming language such as C#, I want to have buttons or use a joystick to control my tread based robot. Eventually a video feed from the wireless camera on board the robot will also be displayed on screen so that I can see where I'm actually moving. I found Martin Hebel's xBee object and understand how to call it within my program, but I'm trying to understand the methodology behind the communication process.
Let's say I press the button on the computer that says go forward.. Do I keep sending the command until the propeller sends back a command saying it got it? What happens if a command gets passed more then once, but I only want to go forward once? There is some sort of api command mode for the xbee protocol, but I don't really understand the format that I would need to send from the PC to the Propeller or even if it's necessary for my application.
Thanks
Matt
Let's say I press the button on the computer that says go forward.. Do I keep sending the command until the propeller sends back a command saying it got it? What happens if a command gets passed more then once, but I only want to go forward once? There is some sort of api command mode for the xbee protocol, but I don't really understand the format that I would need to send from the PC to the Propeller or even if it's necessary for my application.
Thanks
Matt
Comments
The xBee devices are pretty good at error checking and retrying the transmission and all of that is hidden from the outside world. You will still need some kind of "fail-safe" behavior between the robot and the PC. Periodically, the PC ought to send a command to the robot that's just an "are you still there?" and the robot should respond with something that the PC recognizes as "yep". Sometimes, systems like these number the messages going back and forth with the numbers wrapping around (like 0-15, then back to 0 again). If a message gets dropped, it's easy to detect and to reinitialize everything to a known state on both ends.