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.
I have tried several for both the Digital and Analog signal. Right now they are AI = AD2, DO = AD3. The API frame I am sending is 0x17 Remote command request.
Espen
I don`t understand your question… Im sending a API frame from arduino that has frame type 0x17. This frame works as long as I dont have analog input enabled on the end device. But when a analog input channel is enabled the end device is sending a 0x92 frame that I am reading the analog sample from. I compare the analog signal in arduino program, when the analog signal reach threshold arduino program sends a 0x17 frame (I can see this in the serial monitor). After the end device recive the frame it stops reading the analog signal.
Another words if I wanted to test this, What is the FULL API frame that is being sent to the transmitting XBee and what lines, settings or AT Commands that are NOT at their default values on the remote side?
That does not tell us what your API frame is that you are sending out the UART.
The API frame would be something like:
7E 00 10 17 00 00 00 00 00 00 00 FF FF FF FE 02 44 31 03 73
Notice that the frame is entirely in Hex and includes the value and the checksum. Now I am not sure you can issue a Remote AT command to ALL nodes like this but you should try and do this as a Unicast packet instead.
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.