Home/Support/Support Forum/XBee S1 Communication with Matlab

XBee S1 Communication with Matlab

0 votes
Hi,
I just started working with Xbees. My plan is to have one xbee connected to an analogue sensor while the others receives the sampled data and Matlab reads and stores the data.

Can I use the Matlab Xbee class (http://www.mathworks.com/matlabcentral/fileexchange/45550-wireless-control-and-monitoring-of-an-led-using-xbee) also with a S1?

Is it easier for this application to use the normal serial functions in Matlab?
asked Dec 4, 2014 in RF Solutions and XBee by wortscheune New to the Community (0 points)

Please log in or register to answer this question.

3 Answers

+1 vote
I would say no, not with that driver. That driver is for the XBee ZB modules and not the 802.15.4 modules you are using,
answered Dec 12, 2014 by mvut Veteran of the Digi Community (14,874 points)
Hello Sir,

May I please know which Driver you are referring to
I am referring to your MatLab Xbee Class.
How to make the driver usable by 802.15.4 module.Will be very grateful if you can provide any help.
It did worked as far as decovering the the remote Xbee Pro S1 module and pin configuration but I am stuck with the following warning.

Please help :

Warning: Data returned is not of expected length, discarding.
> In xbee>extractFrameData/extractCmdData at 1110
  In xbee>extractFrameData at 1034
  In xbee>xbee.remoteAtCommand at 807
  In xbee>xbee.readVoltage at 258
Warning: Struct field assignment overwrites a value with class "double". See
MATLAB R14SP2 Release Notes, Assigning Nonstructure Variables As Structures
Displays Warning, for details.
> In xbee>extractFrameData/extractCmdData at 1167
  In xbee>extractFrameData at 1034
  In xbee>xbee.remoteAtCommand at 807
  In xbee>xbee.readVoltage at 258
Warning: Output of your pin is unavailable.

I am just trying to read the voltage from pin 17 of the remote Xbee Module.All the hardware wiring connections were checked and verified.
The library worked as far as discovering the remote Xbee Pro S1 module and pin configuration but I am stuck with the following warning.

Warning: Data returned is not of expected length, discarding.
> In xbee>extractFrameData/extractCmdData at 1110
  In xbee>extractFrameData at 1034
  In xbee>xbee.remoteAtCommand at 807
  In xbee>xbee.readVoltage at 258
Warning: Struct field assignment overwrites a value with class "double". See
MATLAB R14SP2 Release Notes, Assigning Nonstructure Variables As Structures
Displays Warning, for details.
> In xbee>extractFrameData/extractCmdData at 1167
  In xbee>extractFrameData at 1034
  In xbee>xbee.remoteAtCommand at 807
  In xbee>xbee.readVoltage at 258
Warning: Output of your pin is unavailable.

I am just trying to read the voltage from pin 17 of the remote Xbee Module.All the hardware wiring connections were checked and verified.
+1 vote
The lib file was written for a different product which has a different VREF and ADC levels. In order to use that code, you are going to have to modify it to adjust for the 802.15.4 modules VREF level and commands.
answered Jan 15, 2015 by mvut Veteran of the Digi Community (14,874 points)
I found no differences in the VREF as my applied VREF 1.2V falls well in the range of the both Products and also the ADC Levels are found to be same as far as the Data avaliable in the Internet.Please correct me if my information are not valid.Thank you so much.
Good News. I got the values I need.Yes, I have to make the X Bee Library adapt to the Xbee Pro S1 Configurations,Pins and the Format of the Frame Data I need to extract to get the Voltage Values of the required Pin.Thanks
How did you do this? I have the same problem as you
0 votes
hello!
i'm trying to do the same with an Xbee SERIES 1 802.15.4
with the same matlab script, and getting errors while trying to run it.
can you please explain me what i need to change in code
or even share you fixed script code u use if possible?

thanks ahead
answered Apr 6, 2016 by yossidu New to the Community (1 point)
The Code he was using was written for a different product that has a different VREF. You would need to modify this code to use the value of the VREF you are using.
...