UART moisture sensor in API mode

Hello everyone, i am new in zigbee networks, i have 1 coordinator and 5 routers. I need to transmit data from sensor node. This node includes 2 channel moisture sensor, xbee3 - pro. We succeeded to transmit data from my sensor in transparent mode, it looks like this:

Wee need to recieve this data in api mode, because i have many routers and i need to identify everyone.
We can only read data from sensor by UART interface. Sensor sends data every second. In some nodes i am planning to use the sensor which will send more data.
How do I put the data received from the moisture sensor in a frame in the API mode?
Can you give me advise how to send data from moisture sensor wiressly in API mode.

This is actually easier than you think. You don’t need to modify anything on the sensor side. That is, leave it in the transparent mode just as it is working now.

In this case, what you change is the UART setting on the Coordinator since that is where you are sending the data. So in this case, set the ATAP command to a value of 1. Once this is enabled, ALL data going in and out of the UART of the Coordinator will be in the Digi API frames.

Thank you very much for your advise. I have recieved packet in api mode, but that packet divides by many api frames, for example in one packet i have first half of data in next pacet i have three symbols and in third packed i have last part of data. Why it happens? I need to recieve full data in one frame.

What is the size of the data packet you are sending? The maximum packet size for 1 RF packet is 80 bytes.

If you are sending less than 80 bytes, then you may need to adjust your RO command on your remote radios.

The maximum amount of data i can have is 80 bytes, and we have delimeteter: in our data in screenshot is 01 and zigbee delimiter is @.

Then I would suggest looking at adjusting your RO command on the transmitter. The RO is the number of character times of silence on the UART before a packet is sent.

1 Like

When i am changing RO to 28 - 30 my packet splits to two equal parts, and when i get bigger data, the packet splits randomly to many parts.

That means that it is the sensor that is sending it as broken packets into the radio. You will need to either adjust the RO to a larger packet or adjust the code in the sensor to send it as one continuous data packet.

What do the values ​​of the RO parameter mean? Are there any examples of setting up RO? The fact that sometimes packets go through completely indicates the need for some kind of adjustment.

RO is RO character times of silence on the UART before the radio starts the transmit process. Generally the default is what is used for the bulk of applications. In your case, you may need to connect a scope to the output UART of the device to see what timing it is doing.