Shop OBEX P1 Docs P2 Docs Learn Events
Xbee with Basic Stamp garbage data - Page 2 — Parallax Forums

Xbee with Basic Stamp garbage data

2»

Comments

  • With the 5V 3.3V board adapter? Or directly? I have to power the Xbee with 3,3V anyways. What can I do?
    Thanks

    @JonnyMac said:
    A simple interface between BS2 TX and XBee DIN would be a voltage divider.



    6.8K on top gives an output of 2.98v (best choice)
    4.7K on top gives an output of 3.4v (XBee max Vin is 3.6v, but could be problem with 3.3v supply on board)
    10K on top gives an output of 2.5v (falls below XBee VIH)

  • JonnyMacJonnyMac Posts: 8,973
    edited 2023-08-10 00:20

    I work for a laser tag company that has sold several thousand P1-controlled 'taggers' and hundreds of P1-controlled accessories (I designed the circuits and wrote the code). All of them use XBee. I have P2 code for the XBee as well, but the P1 is probably better suited for your project. The FLiP module from Parallax has double the IO pins as the BS2 and costs less. The P1 gives you much more programming space, a more advanced language, and the ability to buffer serial messages so you don't miss anything.

    BTW... I am available for consulting at a reasonable price. :)

  • Luis_P,

    What is the goal of your project? Are you just trying to send button states to the PC? You can encode the inputs into 2 bytes and send them to the PC directly where they can be decoded in binary form. In this manner, you can send 16 binary values to the PC. This would not be using API mode though. I guess I am trying to understand why you were using that approach.

  • Im at my other job :) I will reply tomorrow. Ok? Thanks

    @SavageCircuits said:
    Luis_P,

    What is the goal of your project? Are you just trying to send button states to the PC? You can encode the inputs into 2 bytes and send them to the PC directly where they can be decoded in binary form. In this manner, you can send 16 binary values to the PC. This would not be using API mode though. I guess I am trying to understand why you were using that approach.

  • @Luis_P said:
    Im at my other job :) I will reply tomorrow. Ok? Thanks

    No problem...like JonnyMac, I'm just trying to help. Have a good evening.

  • VonSzarvas,

    The download that you attached is perfect, thanks.

  • GenetixGenetix Posts: 1,746
    edited 2023-08-10 10:22

    Luis_P,

    The information is this book is dated, but it might be a handy reference.
    https://www.parallax.com/package/getting-started-with-xbee-rf-modules-text-and-code/

  • Luis_PLuis_P Posts: 246
    edited 2023-08-10 18:20

    Thanks for the suggestion but my BIG confusion is: With this approach are we using any Xbee board adapter????? or just the Bs2 and Xbee ????
    Should I tried this circuit with the Waveshare board that we know is working but does not have a shift level?

    @JonnyMac said:
    A simple interface between BS2 TX and XBee DIN would be a voltage divider.



    6.8K on top gives an output of 2.98v (best choice)
    4.7K on top gives an output of 3.4v (XBee max Vin is 3.6v, but could be problem with 3.3v supply on board)
    10K on top gives an output of 2.5v (falls below XBee VIH)

  • @JonnyMac
    @SavageCircuits

    Uffff time to make a decision. I wish I can keep the same setup and devices because I already have some of them. I like the BS2 because I'm familiar with it. If I switch to Propeller I have to learn how to programmed.
    What is frustrating is that everything works except for the Garbage xtra characters I received. I can have that, creates a lot of traffic and ids annoying. I like the transparent mode because was easy to setup. Savage Circuits is telling me API message would create issues. Is that the problem? I received garbage data because I'm using an API message in Transparent mode? what other option do I have that works in Transparent mode? I have 1 Xbee3 as a "Coordinator", 4 Xbee Pro as a "Routers" and many Xbee's as an "End Devices" with BS2 as the data sender PIN15 to PIN4 (Xbee DIN).
    What options do I have? Adding 10K resistor between PIN15 and DIN will solved the problem? Using the USB board from Waveshare works but there is no shift level 5V to 3.3V. How about adding a shift level to that board and problem solved? this is for a movie theater so Im going to need a lot of Xbee running inside Auditoriums.

    @SavageCircuits said:

    @JonnyMac said:
    That is an API message and would likely create issues when running in Transparent mode.
    Read this:
    -- https://www.digi.com/resources/documentation/Digidocs/90001942-13/concepts/c_xbee_comparing_at_api_modes.htm?TocPath=How XBee devices work|Serial communication|_____2

    Beat me to it. o:) I was originally assuming he was just sending serial packets.

  • or just the Bs2 and Xbee ????

    The voltage divider is needed between the BS2 TX pin and the XBee DIN pin because Ohm's LAW is not a suggestion -- if you jam 5v into a 3.3v input you may do damage. You can use a 5v microcontroller like the BS2 with an XBee, but any signal out of the BS2 will have to be modified so that it meets the rules. If you look in the Schmarschmino world you'll see lots of voltage dividers knocking down a 5v signal for a 3.3v device. Luckily, the 3.3v signal from the XBee to the BS2 is well above the VIH threshold (~1.4v).

    I know you want to finish your project, but you really should take a step back and do some studying of the tech you want to use -- tossing it together like a salad is not working. Transparent mode is like a wired connection between TWO devices: what is sent on on end is receiver on the other, so the API message you're trying to send in Transparent is likely causing a problem. The Coordinator/Router thing is for mesh networks which you're not doing. You have endpoints. Period. I know this works because we have laser-tag fields with 100 or more weapons in use at the same time. All are endpoints. All the messages in the system are API-1 style. Our control program can "talk" to one or all weapons, and weapons can talk back to the control system or to the other weapon (or all with a global message).

    We have a "Ping" process in our control system that you could use (if you switch to the Propeller). It sends a message from the controller to an individual device and has a bit set so that the XBee radio will acknowledge the message. Inside our message parser that message is ignored -- the XBee layer takes care of letting the control system know that the device is online. Now, in our case we are using 64-bit (MAC) addressing so that we don't have to worry about duplicate addresses; you can use 16-bits addresses, but you have to make sure that all of your devices have a unique 16-bit (MY) address.

    Yes, this stuff is involved, but it can be done. You are simply handcuffing yourself using the BS2 in a project that requires somewhat sophisticated communications.

  • @Luis_P said:
    Thanks for the suggestion but my BIG confusion is: With this approach are we using any Xbee board adapter????? or just the Bs2 and Xbee ????
    Should I tried this circuit with the Waveshare board that we know is working but does not have a shift level?

    Luis_P,

    I jumped in because I designed the board you were having the problem with and wanted to see if I could help. My endgame was to potentially recreate the setup here to see if I had the same issues, however, I cannot, as I don't have the same XBee setup as you. I thought you were doing things point-to-point.

    I would defer to Jon for design advice, since he's working with these systems. If you need help with the Parallax Adapter, I would be happy to help with that.

  • 1) The voltage divider is needed between the BS2 TX pin and the XBee DIN pin because Ohm's LAW is not a suggestion -- if you jam 5v into a 3.3v input you may do damage. You can use a 5v microcontroller like the BS2 with an XBee, but any signal out of the BS2 will have to be modified so that it meets the rules. If you look in the Schmarschmino world you'll see lots of voltage dividers knocking down a 5v signal for a 3.3v device. Luckily, the 3.3v signal from the XBee to the BS2 is well above the VIH threshold (~1.4v).
    ---Do you recommend the Propeller Flip? the Propeller Flip communicates at the same voltage that the Xbee, Correct?

    2) I know you want to finish your project, but you really should take a step back and do some studying of the tech you want to use -- tossing it together like a salad is not working. Transparent mode is like a wired connection between TWO devices: what is sent on on end is receiver on the other, so the API message you're trying to send in Transparent is likely causing a problem.
    I'm using Coordinator/router/end device, because the router helped me to extend the range. I cannot use only Two devices. If Transparent mode is an issue what other Mode can I use that works with my setup? and how can I send the message with a Propeller Flip?
    If I this answer I can backup and start working on something different.

    Thanks a lot!

    @JonnyMac said:

    or just the Bs2 and Xbee ????

    1) The voltage divider is needed between the BS2 TX pin and the XBee DIN pin because Ohm's LAW is not a suggestion -- if you jam 5v into a 3.3v input you may do damage. You can use a 5v microcontroller like the BS2 with an XBee, but any signal out of the BS2 will have to be modified so that it meets the rules. If you look in the Schmarschmino world you'll see lots of voltage dividers knocking down a 5v signal for a 3.3v device. Luckily, the 3.3v signal from the XBee to the BS2 is well above the VIH threshold (~1.4v).

    2) I know you want to finish your project, but you really should take a step back and do some studying of the tech you want to use -- tossing it together like a salad is not working. Transparent mode is like a wired connection between TWO devices: what is sent on on end is receiver on the other, so the API message you're trying to send in Transparent is likely causing a problem. The Coordinator/Router thing is for mesh networks which you're not doing. You have endpoints. Period. I know this works because we have laser-tag fields with 100 or more weapons in use at the same time. All are endpoints. All the messages in the system are API-1 style. Our control program can "talk" to one or all weapons, and weapons can talk back to the control system or to the other weapon (or all with a global message).

    We have a "Ping" process in our control system that you could use (if you switch to the Propeller). It sends a message from the controller to an individual device and has a bit set so that the XBee radio will acknowledge the message. Inside our message parser that message is ignored -- the XBee layer takes care of letting the control system know that the device is online. Now, in our case we are using 64-bit (MAC) addressing so that we don't have to worry about duplicate addresses; you can use 16-bits addresses, but you have to make sure that all of your devices have a unique 16-bit (MY) address.

    Yes, this stuff is involved, but it can be done. You are simply handcuffing yourself using the BS2 in a project that requires somewhat sophisticated communications.

  • Thanks a lot!
    So we can say the board will not work using a Bs2, sending an API message with an Xbee in Transparent Mode and the devices are Coordinator/router/end device setup.
    If that is incorrect please correct me.

    @SavageCircuits said:

    @Luis_P said:
    Thanks for the suggestion but my BIG confusion is: With this approach are we using any Xbee board adapter????? or just the Bs2 and Xbee ????
    Should I tried this circuit with the Waveshare board that we know is working but does not have a shift level?

    Luis_P,

    I jumped in because I designed the board you were having the problem with and wanted to see if I could help. My endgame was to potentially recreate the setup here to see if I had the same issues, however, I cannot, as I don't have the same XBee setup as you. I thought you were doing things point-to-point.

    I would defer to Jon for design advice, since he's working with these systems. If you need help with the Parallax Adapter, I would be happy to help with that.

  • Do you recommend the Propeller Flip? the Propeller Flip communicates at the same voltage that the Xbee, Correct?

    The FLiP uses the Propeller P1 which is a 3.3v device. You can connect directly to the XBee. Again, I have lots of designs that do that; in fact, I was working on a new design today with a P1 and an XBee. The advantages of the P1 over the BS2 is that it's fasters, has much more code space, and the ability to buffer serial communications which will ensure that you never miss a packet in your system.

    how can I send the message with a Propeller Flip?

    Use API messaging (I have a library that does a lot of the grunt work). You'll have to create a protocol for your system, but you only have a few messages so it will be easy. You'll also have the ability to talk back to your remote devices.

    An API message looks like this (from your code)
    -- $7E, $00, $04, $08, $01, $4E, $44, $64

    You were attempting to use this to find other devices which I think was causing you troubles because any XBee that is in the same channel and PAN will send back its 64-bit ID, its 16-bit ID, and its NI (Node Identifier [name]). In our laser-tag system we use this message to auto-populate a new system. The controller sends this message and then we log all the responses. We use th 64-bit ID when we want to communicate to a specific weapon because we use the 16-bit address to hold our team and player information.

    Here's the thing: You master controller now has to deal with API formatted message -- even if you want to send a simple string of text, you have to embed it in an API message. This would impractical. I think in your case you might craft a message that looks like this:

    7E 00 0A 01 00 00 00 01 01 00 00 00 00 FC

    This is a simple API-1 message what includes a byte for the command and four bytes four data. This message is configured not to return an automatic response from the XBee layer. If you really want the remote devices to ping the master you might do this:

    7E 00 0A 01 00 00 00 00 00 00 00 00 00 FE

    The command is 00 (ping), with no data, and the Disable ACK bit is cleared. The master control software can ignore this message but the XBee subsystem will return an ACK message that lets you know the message landed (this is what we do in laser-tag).

Sign In or Register to comment.