Stuck with setting up communication between LilyPad Arduino and process via XBee

I am trying to configure a Lilypad hooked up to a LilyPad Xbee to communicate with a processing sketch on my MacBook in order to transmit the values of various sensors attached to the Lilypad.

Something a bit like this.. Tutorial: Simple Wireless Textile Stretch Sensor with XBee and LilyPad – Costumes and Sensors

I am using a single USB Xbee explorer connected to my Mac and Using this I have configured the 2 Xbees to recognise each other (based on this tutorial Exploring XBees and XCTU - learn.sparkfun.com).

I believe this configuration to be correct as if I select the Xbee that is connected to the Explorer it is able to see and add the remote Xbee (attached to the Lilypad via the Lilpad Xbee board) and inspect its configuration but with only one Explorer I am unable to open 2 consoles alongside each other to test sending and receiving as suggested in the sparkfun tutorial above).

However I am unable to receive any signal in processing, I have set the Lilypad to print various values out to Serial at regular intervals but nothing.

I have attached the lilypad directly (via a FTDI -> USB cable) to my MacBook and this Processing sketch will pick up the output fine.

I have made sure that arduino and XCTU are not running so as to avoid conflicts over serial

I have run out of ideas as to what to try next. Any suggestions?

Using this I have configured the 2 Xbees to recognise each other

Instead of pointing to a site that may, or may not, be any good, tell us how you actually configured the XBees. Tell us what kind of XBees they are, too.

Post a schematic, showing how the XBee is connected to the Lilypad.

Put a simple sketch on the Lilypad that does nothing more than set up the serial port and Serial.print("Hello") every second. The XBees just replace the wires, so if the Lilypad can communicate with the PC over a wire, it should be able to communicate the same way using the wire-replacement hardware, IF the wire-replacement hardware is configured, and connected, correctly.

Thanks for your reply.

I used the following settings

Setting Acronym XBee 1 XBee 2
Channel CH C C
PAN ID ID 9050 9050
Destination Address High DH 0 0
Destination Address Low DL 1 0
16-bit Source Address MY 0 1

The XBees are both series 1

The sketch on the Lilypad is like this

void setup() {
 Serial.begin(9600);
}
void loop() {
  Serial.println(200, DEC); 
  delay(500);
}

The Lilypad is connected to the Lilypad Xbee by the Tx and Rx connectors (Rx on one to Tx on the other) and the only other wires currently in use are those connecting the negatives together (and on to a battery pack) and similarly the positives

I hope this helps

XBee Series 1 work and can communicate point to point out the box with default factory settings.

My advice would be to reset each to default factory settings and try it out. If it still isn't working, invest in a second explorer and try using the XCTU. If it still isn't working, make sure you didn't fry the XBee on the Arduino side by applying 5V to the 3V3 pin or something.

I did originally try with the settings as they came out of the box and when they didn't work I tried the ones I posted, based on the article above.

I am still able to see the second Xbee via XCTU and see its setting so don't think it has been fried.

MutantSurvivor:
I did originally try with the settings as they came out of the box and when they didn't work I tried the ones I posted, based on the article above.

I am still able to see the second Xbee via XCTU and see its setting so don't think it has been fried.

If this is the case, you probably wired something wrong. Again, invest in a second explorer.

OK, I have now bought another XBee explorer. I can connect the two XBees and send packets between them using XCTU.

I have also attached them to 2 different computers, and I am able to send packets from XCTU on one machine, and receive them in the serial monitor of arduino on the other machine, but the communication does not work the other way round.

I have also set one XBee attached to an arduino Uno via the explorer (3.3v to Vcc, Gnd to Gnd, Tx to Rx and Rx to Tx) and put a sketch on the arduino that is writing to Serial (9600 baud) the number 200 with a 500 ms delay.

I have connected the other XBee to another computer via the other explorer and cannot see anything coming in, either using XCTU or the arduino serial monitor. Similarly the processing sketch does not read anything coming in on serial.

I have also attached them to 2 different computers, and I am able to send packets from XCTU on one machine, and receive them in the serial monitor of arduino on the other machine, but the communication does not work the other way round.

Then the configuration of the XBees is wrong.

Try values other than 0 and 1. 0 has special meaning that you do NOT want to use.

XBee Series 1 work and can communicate point to point out the box with default factory settings.

But nowhere near as fast, or as reliably, as when properly configured.

OK, will try that tonight.

Any guidelines as to which settings are best. I have to say there are a bewildering amount of settings that can be change and I've not yet found a source that clearly explains what they are all for.

Any guidelines as to which settings are best.

To get Series 1 models to communicate, you only need to consider DH, DL, MY, and PAN ID.

PAN ID can be any value, though I'd stay away from 0 or the upper limit, as long as both XBees use the same value.

DH should be 0, so both XBees have a 8 bit address.

DL (destination) and MY (my address) can be any value between 0 and FF. Both 0 and FF have special meaning, so I recommend not using them. What matters is that DL on one is MY on the other one.

I'd set one up with:
PAN ID=34, DH=0, DL=13, and MY=22.

I'd set the other one up with:
PAN ID=34, DH=0, DL=22, and MY=13.

No luck, can't even send between the serial consoles now