How to convert Wifi RSSI to level of Wifi strength in menu bar in Mac OSX?

2.8k Views Asked by At

I can get the value of Wifi RSSI. but don't know how to convert it into level of Wifi strength as we can see in the menubar in Mac OSX (If I receive a strong Wifi, the wifi status will be bold black on all 4 lines of wifi icon).

Is there any methods or library that I can use to do this? Thx in advance.

2

There are 2 best solutions below

0
On

I don't think you'll find anything in the API to do this.

I think you might have to Use Science™ and do a manual check, literally walking away from your WiFi access point with laptop in hand, noting down the RSSI values at which the WiFi signal indicator icon changes. Do this a few times and you'll likely find a correlation. I can't imagine it would take more than ten or fifteen minutes to get a good range of sample values.

It's probably worth trying it with more than one type of Mac, if possible.

0
On

There is no public API for this. You'll have to figure it out yourself. You might be able to use something simple like (RSSI+100)/8 and then clamp the result between 0 and 4 bars. Also, you'll want to use a rolling average over a few seconds to keep the bars from jumping around if the signal ends up at a boundary case or jumps around. PS: AFAIK, Apple uses a more complex algorithm which takes Transmit Rate into consideration.