# How to get RSSI of latest packet received? (XBee3 + micropython)

**URL:** <https://forums.digi.com/t/how-to-get-rssi-of-latest-packet-received-xbee3-micropython/21322>\
**Category:** XBee - 802.15.4\
**Tags:** micropython, rssi, rf, xbee3\
**Created:** [April 29, 2020, 7:48am UTC](https://forums.digi.com/t/how-to-get-rssi-of-latest-packet-received-xbee3-micropython/21322 "2020-04-29T07:48:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oiturra](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@oiturra](https://forums.digi.com/u/oiturra)\
**Post date:** [April 29, 2020, 7:48am UTC](https://forums.digi.com/t/how-to-get-rssi-of-latest-packet-received-xbee3-micropython/21322/1 "2020-04-29T07:48:43Z")

</div>

Hello.

I need to get the RSSI of received packets. For a network with few devices, where all of them transmit once in a while I could use AT command ‘DB’ (page 146 of [https://www.digi.com/resources/documentation/digidocs/PDFs/90002273.pdf](https://www.digi.com/resources/documentation/digidocs/PDFs/90002273.pdf)) to show the RSSI of the latest packet received. But when the network has more devices and they could be transmitting at the same time, I think that I can’t use that ‘DB’ command. Also “The XBee device has a MicroPython receive queue that stores up to four incoming packets” (Receive(), page 123 of [https://www.digi.com/resources/documentation/digidocs/PDFs/90002219.pdf](https://www.digi.com/resources/documentation/digidocs/PDFs/90002219.pdf)).

I’m using something like this:

while True:  
…packet\_recvd = xbee.receive()

…if packet\_recvd is not None:  
…rssi = xbee.atcmd(“DB”)  
…process\_packet(packet\_recvd, rssi)

Questions:  
1.- In the code above, can I be sure that rssi has the RSSI of the packet received in packet\_recvd during high XBee3 communication traffic?

2.- Is ‘DB’ updated as soon as a packet arrive at the device?

3.- Or, is ‘DB’ updated as soon as I use XBee.receive()?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [April 29, 2020, 8:06am UTC](https://forums.digi.com/t/how-to-get-rssi-of-latest-packet-received-xbee3-micropython/21322/2 "2020-04-29T08:06:00Z")

</div>

Oiturra,

Yes, the RSSI would be of the last packet received. The DB value is updated when the packet is received and validated it is for that module.

Digi Support

---

<div class="post-metadata">

**Author:** ![kapetan](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@kapetan](https://forums.digi.com/u/kapetan)\
**Post date:** [February 22, 2021, 9:57am UTC](https://forums.digi.com/t/how-to-get-rssi-of-latest-packet-received-xbee3-micropython/21322/3 "2021-02-22T09:57:48Z")

</div>

Hi. I’m a bit confused by the answer. Does that mean the DB value is not in any way related to xbee.receive() in the MicroPython code? Is there a reliable way to associate a packet from xbee.receive() with a RSSI value?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [February 22, 2021, 10:03am UTC](https://forums.digi.com/t/how-to-get-rssi-of-latest-packet-received-xbee3-micropython/21322/4 "2021-02-22T10:03:06Z")

</div>

If you query the DB command just after reading the data port, then yes, they would co-inside with each other.
