Skip to main content
HPham.3
Associate II
July 20, 2021
Solved

STM32WB55 scan Beacon tag and read RSSI

  • July 20, 2021
  • 5 replies
  • 2614 views

I'm new to STM32WB and using BLE_MeshLightingPRFNode example.

With the function BLEMesh_CustomBeaconReceivedCallBack, I get the data and data is true but RSSI is wrong

How can I fix it or other way to get RSSI from beacon? Sorry for my bad english

Regard

This topic has been closed for replies.
Best answer by Remi QUINTIN

3 is a weird value. How far is the device you are communicating with?

You could use the HCI_READ_RSSI function to get its value.

The ACI_HAL_READ_RAW_RSSI function is also possible but the raw value is not considering internal active elements that have an impact on the accuracy of this RSSI value.

Have a look at AN5270.

5 replies

Remi QUINTIN
ST Technical Moderator
July 21, 2021

The RSSI value is computed from power values measured at the RF input pin of the WB using also values from other internal active elements existing on the RX path (AGC, LNA, ...). This value is then inserted in the received advertising packet.

It is difficult to compare this value with one measured by an external beacon.

What makes you think the RSSI value is wrong?

HPham.3
HPham.3Author
Associate II
July 21, 2021

value I get is always equal to 3 every time my bluetooth beacon moves

Remi QUINTIN
Remi QUINTINBest answer
ST Technical Moderator
July 21, 2021

3 is a weird value. How far is the device you are communicating with?

You could use the HCI_READ_RSSI function to get its value.

The ACI_HAL_READ_RAW_RSSI function is also possible but the raw value is not considering internal active elements that have an impact on the accuracy of this RSSI value.

Have a look at AN5270.

HPham.3
HPham.3Author
Associate II
July 21, 2021

At least, I can get signal through my room about 20 meters

HPham.3
HPham.3Author
Associate II
July 21, 2021

0693W00000D0CPyQAN.pngIs my code OK

I don't understand about connection handle in function HCI_READ_RSSI

Remi QUINTIN
ST Technical Moderator
July 21, 2021

The connection handle is the handle used to identify the connection.

This connection handle is returned in the connection_complete_event once the connection is established.

Its structure is the following:

typedef PACKED(struct)

{

 uint8_t Status;

 uint16_t Connection_Handle;

 uint8_t Role;

 uint8_t Peer_Address_Type;

 uint8_t Peer_Address[6];

 uint16_t Conn_Interval;

 uint16_t Conn_Latency;

 uint16_t Supervision_Timeout;

 uint8_t Master_Clock_Accuracy;

} hci_le_connection_complete_event_rp0;

HPham.3
HPham.3Author
Associate II
July 22, 2021

At 0m, Tx power of my beacon is -24 dBm, but the value of function HCI_READ_RSSI is about 5 or 6, sometime it is 110