Shop OBEX P1 Docs P2 Docs Learn Events
Sooooo Close; XBee problem with base station receiving data from remote station — Parallax Forums

Sooooo Close; XBee problem with base station receiving data from remote station

vanmunchvanmunch Posts: 568
edited 2013-07-25 15:11 in Propeller 1
Solved, kept working on it and finally figured it out :)
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~


Hello, could some please take a look at my set of XBee programs? It’s a simple program where a base control station asks a user if they want to control the robot or if they want to know what the light and soil moisture levels are. Everything works except the very last part where the plant station sends the requested data back to the control base station. It looks like the station never receives the data. I’m guessing that I have something incorrectly set-up with the “AcceptData” method in the Remote_Control_Demo.

I’m sure that a second set of eyes would see the problem right away. :) Thanks for your time.

Comments

  • TtailspinTtailspin Posts: 1,326
    edited 2013-06-26 17:14
    Just off the wall, but wouldn't the "AcceptData" method need to make its own pin assignments, since you are using Cognew?.
    Also, I am not sure why you would want to add one(1) to the string pointer address?
    PlantStationIDReceived   := XB.ParseDEC(XB.RxData+1,1)     'should be "987654321"
    
    I'm sure there's a good reason, but I don't know enough to understand what it is...:smile:

    -Tommy
  • vanmunchvanmunch Posts: 568
    edited 2013-06-26 19:09
    Ttailspin wrote: »
    Just off the wall, but wouldn't the "AcceptData" method need to make its own pin assignments, since you are using Cognew?.
    Also, I am not sure why you would want to add one(1) to the string pointer address?
    PlantStationIDReceived   := XB.ParseDEC(XB.RxData+1,1)     'should be "987654321"
    
    I'm sure there's a good reason, but I don't know enough to understand what it is...:smile:

    -Tommy

    Hey Tommy thanks for looking. :) From the examples in the "Getting started with XBee ..." they just set the pin assignment at the top before they launch the cog. One cog uses the "out" and the other cog listens to the "in."

    The +1 is because it's extra awesome.... :D No, it's because you want to skip the first byte; the "c" that was sent.

    This stuff is always so confusing.... :/
  • David CarrierDavid Carrier Posts: 294
    edited 2013-07-01 14:54
    I moved the thread from the Wireless forum to the Propeller 1 forum, at Dave's request, due to the question being more of a Propeller programming question.

    — David Carrier
    Parallax Inc.
  • Wayne PWayne P Posts: 1
    edited 2013-07-25 07:45
    So, what was the basis of your solution? My MicroMedic submission required a lot of XBee programming and we were able to get most of the bugs solved. I'm trying to get two cogs to talk to each other so that, as you say, one can transmit while the other receives data. I guess I have to re-read the programming guide on how to work with cogs...
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-25 15:11
    Wayne P wrote: »
    So, what was the basis of your solution? My MicroMedic submission required a lot of XBee programming and we were able to get most of the bugs solved. I'm trying to get two cogs to talk to each other so that, as you say, one can transmit while the other receives data. I guess I have to re-read the programming guide on how to work with cogs...

    Cogs running Spin code can easily "talk" using global variables. Just define the variables in the "VAR" section or a "DAT" section. This can be a little tricker if your various cogs are started in child objects but still doable.

    Feel free to post any code that's giving your trouble. I don't think vanmunch will mind loaning you his thread (he appears to be finished with it). Alternatively you could start another thread describing your problem (I'm guessing the Propeller forum would be the place to post if you start of new thread).

    I you don't know how to use code tags, there's a link to a tutorial in post #3 of my index (see signature).

    BTW, Welcome to the forum.
Sign In or Register to comment.