Xbee and Arduino IO for Matlab

I am not sure if anyone is familiar with the Arduino IO package for Matlab (http://www.mathworks.com/matlabcentral/fileexchange/32374) it is an arduino sketch that allows the arduino to talk through serial communication with Matlab and have matlab do computations and graphing for inputs given specific commands. It works great through the USB serial cable straight to the arduino.

Now it’s time to go wireless. I have just recently purchased 2 xbee series 1, 2 xbee Adapter kits, and the FTDI cable from the adafruit store. I know everything works as I have done the tutorials provided by the wonderful ladyada.

So I decided to add the NewSoftSerial library into the Arduino IO sketch and do point to point into Matlab. When I try to call the arduino in matlab using the a=arduino(‘COM5’) command you can see that the xbees are communicating but it inevitably times out. Just to make clear COM5 is the port into which the FTDI cable with the Xbee is plugged into the computer.

I am sure it’s a lot more complicated to get it to work and I am using the wrong method completely, however I was wondering if anyone would be able to help. If there is a forum that you believe this would get better exposure I will post it there as well.

Thanks for your time.
Ronix

ok first youll need some level shifting because xbee's are 3.3v strict devices - and if your not using an arduino pro which runs at 3.3v your xbee won't like the 5v coming from the data lines from your arduino also i hope that the ftdi cable you got works @3.3v because youll have troubles again i know that the xbee explorer takes care of this problem after that you should make sure you can use your xbee's to communicate with your arduino via the IDE once everything works from the IDE youll have no problem connecting it to matlab

probably should have read the first post twice before posting one question why are you using softserial and your not using the built in serial arduino provides ?

There is no reason for the softserial I just used it incase I needed to upload another sketch. I just want the Xbees to act like the USB would between the arduino and PC/matlab. So that matlab thinks it is talking directly to the arduino.

If the lights on the XBee boards are blinking, the XBees are communicating. If there is no data being exchanged, it is because the one XBee is not getting anything to/from the Arduino to exchange with the other XBee. This could be a hardware issue, a software issue, or a configuration issue.

You've not described your configuration or posted any code. Makes it hard to help you.

2 xbee Adapter kits,

Links?

Paul,

I am using the $10 Xbee adapter kits from adafruit. (http://www.adafruit.com/products/126)

Also the code I am running on the arduino is the Matlab Arduino IO sketch, the link was in my original post works great with USB connection. I was just hoping to use the Xbees as a way of serial communication between the arduino and matlab in place of the USB.

The Xbees are definitely communicating with each other as I have done the basic "hello world" stuff.

I was just hoping to use the Xbees as a way of serial communication between the arduino and matlab in place of the USB.

The actual connection between the serial port on the PC and the serial port on the Arduino, whether wire or XBee, is not something the Arduino OR the PC knows about.

If there is a problem with the transfer of data over that connection, you must examine each side of the connection for issues - hardware or software.

A clear photo, and schematic, of your physical connections, would be helpful. How is that XBee adapter connected to the Arduino? How is is connected to the PC?

Paul thanks for trying to help me trouble shoot. I will take pictures for everyone in the next day or two. But until then the xbee hooked to the computer is running through an FTDI cable, and right now I just have the one hooked to the arduino through a bread board using the arduinos ground and +5V and then tx-rx and rx-tx.

I just have the one hooked to the arduino through a bread board using the arduinos ground and +5V and then tx-rx and rx-tx.

Just for giggles, swap the TX/RX connections, so that RX->RX and TX->TX.

I am not sure if that helps, but the newest version allows a longer delay in the serial communication between MATLAB and the Arduino before calling it quits. In any case i would be interested in knowing what you are doing more in detail. Google for me and write me an email so we can talk about it, if you are still working on this. Giampiero