Home/Support/Support Forum/Two way XBee communication with ARDUINO

Two way XBee communication with ARDUINO

0 votes
Hi. I have only 2 XBee`s in my network, 1 Cordinator API and 1 end device AT. My cordinator is hook up to a ARDUINO UNO, my end device is driven by batteries.

My end device is reading a analog temperature signal and my cordinator is reciving this and I can read the value with serial monitor.

My poroblem is this: I want to read the analog signal with my ARDUINO program, check if this signal is greater then 28 C, if the temperatur is greater then 28 I want to set a digital output high on the end device.

I have some experience with the AT command request I have tried to solve my problem with the code

"If (temp > 28)
send a command request with serial.write"

The XBee is able to send the command request, but after this the end device stop reading the analog signal.

Any suggestions to have I should solve this? Any help would be appreciated.

With kind regard

Espen
asked Oct 12, 2015 in XBee Programmable Development by espeno New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
What is the line that is Enabled and what is the API frame you are sending to change the state of the remote DIO line?
answered Oct 12, 2015 by mvut Veteran of the Digi Community (11,242 points)
So what line is enabled as an analog input?  Could it be that your Code does not know how to Parse out the data between the two types?
AD2. The 0x92 frame changes as soon as im trying to send the 0x17 frame. Im not even sure if it`s possible to do this with XBee. Continuously sending one frame and receiving another. The documentation around this is very pore.
Sounds like you are sampling ADC and not aware that it will also sample DIO lines in the same packet.   That is to say, before you Enable the DIO line, your receive frame only shows that you have an Analog Sample and the values is this...  But as soon as you Enable the DIO, that sample packet changes to include all Enabled ADC and DIO lines as well.   So your application need to be able to read the 0x92 frame regardless of what is in that packet.
Thanks! that gave me a few ideas. But will the sample 0x92 also include DO signals? I thought is was not a sample as it`s an output.
By the way, do you know if the receiver will always send at Command Response to the AT command? Or is this only with AT command IS?
I think there is something wrong with my arduino program.
It will not sample an output line but it will sample any enabled inputs.

All AT commands will issue some sort of response when issued.
...