Hi everyone, this is my first arduino forum post I've dug around and I wasn't able to find anyone with a similar problem. I have 2 Wifi Xbees connected to Unos via sainsmart shields. I attached my a quick sketch of my configuration. I have both radios in transparent mode and I'm able to send data bidirectionally while directly connected to each laptop. However, when I connect the Xbees to the Uno with the shield I can't seem to send or receive data. Here is my Master code:
I have the shield switched to the DLINE (and not Xbee) on both boards. Please let me know if you have any suggestions, I've been troubleshooting this for a long time!
I thought I prefaced this post by saying that I'm a noob and that this is my first project with Xbees, but thanks for the encouraging, insightful feedback. Actually, you didn't point me in any direction or tell how I could go about fixing my problems.
So I'm guessing that I should remove the serial.flush() and the if(XBee.available()>0);. Also, I know I'm not using the Xbee Wifi in the standard configuration of connecting 2 radios via an AP but I wanted to ensure that they can do point to point communication without an AP as that is what the project I'm working on requires.
If anyone could explain what I'm doing wrong or at least point me towards documentation or an example it would be much appreciated.
So I'm guessing that I should remove the serial.flush()
I thought I made that clear. Do NOT call functions when you do not know what they do.
The problem with the XBee.available() line is the ; on the end. If statements RARELY end with semicolons.
Also, I know I'm not using the Xbee Wifi in the standard configuration of connecting 2 radios via an AP but I wanted to ensure that they can do point to point communication without an AP as that is what the project I'm working on requires.
They can't. What you are trying to do is like using a tennis shoe for a baseball bat. Just because they both come from the sporting goods store does not mean that they are interchangeable.
Ad hoc networks
Wireless devices can get on a wireless network without an access point. This is called an Ad Hoc or IBSS (Independent Basic Service Set) network.
That statement makes me believe that you connect 2 Xbees together without an AP. Also
Note Ad hoc networks are point to point: there can only be two nodes in the network, a creator an a joiner. Set up the creator first, and then the joiner.
So please tell me why I can't connect two Wifi Modules together in IBSS Mode?