Shop OBEX P1 Docs P2 Docs Learn Events
XBee Remote control works for a while then receiving program freezes — Parallax Forums

XBee Remote control works for a while then receiving program freezes

vanmunchvanmunch Posts: 568
edited 2011-07-25 19:49 in Accessories
Solved!!!!!!!

After fighting with this problem for the last 2-3 weeks I finally figured it out. I had the "Send" program in it's own cog and had it repeat. The problem was fixed after I had the main program call the "Send" method at the end of each repeat. I stepped back and did some laundry and thought some more about how the DIN LED would freeze on and that maybe having it constantly send the data was the problem. Anyhow, hopefully this all helps someone else and thanks again PJ for your suggestion and encouragement.

Dave
+++++++++++++++++++++++++++++++++++++++++++


Hello,

I've been having a goofy problem with my receiving XBee program that controls my robot and I was hoping that someone could help and that may be this could help someone else. The code that I'm using is attached below. Originally I thought it was interference, I don't think that's the case.

Everything seams to be working fine when I don't have the robot arm or wheel power connected (just the board outputting to the computer). However, once I power up the arm and wheels, the board seems to randomly freeze and sometime it outputs gibberish and both the DOUT and DIN LEDs turn on and stay on instead of just the DIN flashing like it's suppose to. I think the arm is drawing too much power and eventually the battery can't give enough current so the whole thing falls apart, but I'm not sure. I'm currently using a propeller servo controller with the hope that that would fix the problem, but it still happens and I was hoping that someone could take a look at my code and make sure it's not a software problem. I worked through all of the chapters in the "Getting started with XBee...", but I'm still a bit confused. Any help or suggestions would be appreciated. I had thought the XBee part was going to be the easy part.... :)


Robot_V1.3.1usingPSC.spin ControllerV1.3.1ForPSC.spin

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-24 19:46
    Would it be difficult to temporarily rig up a separate power source (a couple of AA or AAA) for the XBee?
  • vanmunchvanmunch Posts: 568
    edited 2011-07-25 06:51
    PJ Allen wrote: »
    Would it be difficult to temporarily rig up a separate power source (a couple of AA or AAA) for the XBee?

    That's a good idea. I'm using proto boards, but I should be able to rig up the same set-up using a propeller demo board and power the XBee using 3.3V regulated power from a GG platform later tonight and I'll let you know what happens.

    Did the code look ok? Thanks again for your suggestion!

    Dave
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-25 11:05
    The best place to seek your code review is likely in the Propeller Forum.
    One of the Spin-Meisters will jump in, I'm still something of a Recursionator :zombie: .
  • vanmunchvanmunch Posts: 568
    edited 2011-07-25 15:32
    Hey PJ,

    I hooked up a second power unit and it did the same thing as before. Everything works well for ~0.2-2 minutes and then it randomly sends gibberish to the serial terminal and the LED for the DIN stays on. It didn't matter if unpowered- repowered the XBee. Any more suggestions before I move it to the propeller forum?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-25 16:16
    Nay, lad.
    Getteth thee to the Propeller Forum.

    (What's the difference between random gibberish and orderly gibberish? Nevermind.)
  • vanmunchvanmunch Posts: 568
    edited 2011-07-25 16:27
    PJ Allen wrote: »
    Nay, lad.
    Getteth thee to the Propeller Forum.

    (What's the difference between random gibberish and orderly gibberish? Nevermind.)

    Ha Ha :)

    WIll do, and I just doubled checked and it does the same thing even with no power to the arm.

    Have fun!
  • vanmunchvanmunch Posts: 568
    edited 2011-07-25 19:25
    Solved!!!!!!!

    After fighting with this problem for the last 2-3 weeks I finally figured it out. I had the "Send" program in it's own cog and had it repeat. The problem was fixed after I had the main program call the "Send" method at the end of each repeat. I stepped back and did some laundry and thought some more about how the DIN LED would freeze on and that maybe having it constantly send the data was the problem. Anyhow, hopefully this all helps someone else and thank PJ for your suggestion and encouragement.

    Dave
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-25 19:49
    It works for me a lot like that, too, only when I'm driving in to work in the morning.
Sign In or Register to comment.