SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By cobnut
#185055
Hi all, I know this question crops up a lot but I've not been able to find a precise answer to my situation, so apologies for asking again.

I have two Fio v3 and two XBee S2. All I want to do is for one to send the other some data. I've configured the Fios so XCTU can communicate with the XBees when connected to the Fios, and that appears to work fine (I can read the XBees and set them, etc.). HOWEVER, according to the tutorials here, once XCTU is connected to both Fios, I should be able to use the Serial console to communicate and that just isn't happening. I can enter data in the console and the relevant Fio flashes it's TX light briefly, but nothing is received by the other.

I've reset to factory (more than once) and yes, made sure it's written. I've changed baud rates. I've changed PIN, I've changed MY. I've reset again (and again). Nothing.

There are no "red" entries in the settings - everything looks fine, they just won't talk to each other.

Any ideas?

Jon
By Valen
#185064
cobnut wrote:... I've configured the Fios so XCTU can communicate with the XBees when connected to the Fios, and that appears to work fine (I can read the XBees and set them, etc.).
Please elaborate how you did that.
HOWEVER, according to the tutorials here, once XCTU is connected to both Fios, I should be able to use the Serial console to communicate and that just isn't happening. I can enter data in the console and the relevant Fio flashes it's TX light briefly, but nothing is received by the other.
The Fio has a hardware serial port to pins 0 and 1 to which the Xbee is connected. The serial monitor of the Arduin IDE is connected to the USB based serial port. Each serial port has a different name (Serial and Serial1 or something like that). By default no communication is crossing this divide. So XCTU should not be able to communicate with the Xbees without some programming, which sends any character available on one side to the other and vice versa.

As for getting the Xbees to connect, with default settings they should. (EDIT: not 100% sure with series 2, never had them myself) But if you tweaked any of them, then you better upload their configuration in the next message here. Guessing is rather inefficient.
By cobnut
#185066
Hi Valen, thanks for replying.

To communicate with the XBees via the Fio I used a simple script to rewrite the Serial output/input as follows (with a setup to begin serial and serial1):
Code: Select all
void loop() {
if(Serial1.available()) {
Serial.print(Serial1.read());
}
if(Serial.available()) {
Serial1.print(Serial.read());
}
Not mine, found it online, possibly here. No tweaking done, or at least if there was any tweaking I've tried resetting to factory via the XCTU several times. When the above script is in place, XCTU can talk to both the XBees just fine - everything works exactly as it should according to the manuals, except for actually sending/receiving data.

If I try a simple script like this:
Code: Select all
void loop()
{
  Serial.println("This is SERIAL");
  delay(2000);
}
Then the TX light on the FIO flashes briefly every 2 seconds but only when the serial monitor is open. Not sure if that's a clue, but from what you've said, it sounds as though the IDE serial port is connected to TX/RX (would that be why it only flashes when the Serial monitor is open?). If I amend the script to write to Serial1 nothing appears to happen, no lights, nothing.

Jon
By Valen
#185067
From the Hardware Fio Overview on the hookup guide:
Two LEDs towards the bottom – labeled RX and TX – help indicate when data is transferring to and from the Fio through USB. A blue LED represents USB data coming into (‘RX’) the the Pro Micro, and a yellow LED indicates USB data going out (‘TX’).
So those leds do NOT indicate communication with the XBee itself. (Unless you have that above program running in it, then Xbee RX and TX would be replicating the USB RX and TX data in a fraction of a second) I highly suggest you wire a led/resistor pair between the Xbee RX and the 3.3 Volt of the Xbee. (and likewise between Xbee TX and 3.3volt) To make sure that there is communication there. If there is data on Din and Dout the voltage goes down to 0 volt, and current can flow through the led to light it up. Make sure the cathode of the led is towards the Xbee RX and TX.

The Series 2 Xbees are a bit more involved to get working reliably. I don't have any personal experience in it, but some others may pitch in. First you need to make sure the data actually ends up at the Xbee. Download the config settings with XCTU from them and post it here anyway.
By cobnut
#185068
Hi Valen, with a little (well, quite a lot) more digging about it seems the problem is that one of the two Fio's needs to be a co-ordinator. To do this, I need to update the firmware and while I can do many things via XCTU, apparently updating the firmware isn't one of them (it throws an error, unable to read device).

Almost all of what I've found uses either the XBee Explorer and obviously this "cuts out the middle man" in terms of config, as I suspect the Fio acting in this way is confusing things. There's little point in trying to get the XBees working with the Fio if I can't even be 100% certain they're configured correctly in the first place.

So, I'll order an Explorer and see what trouble I can cause once it arrives. Stay tuned, and thanks for your help so far.

Jon
By Valen
#185072
Yeah, the program trick to bridge the serial ports works to some extent, but it is a slow fix with potential for lag. There is a good chance that this messes up the XCTU vs XBee configuration communication.

And you don't need to use those Explorers (USB) exclusively for XBees. If you can solder pinheaders to them you can use it to eavesdrop on other serial port lines, like software based serial ports to sniff if they work correctly.