Ask / Submit
5

How can one retrieve RXLEV / dBm signal strength value?

asked 2015-11-01 12:22:56 +0200

Krum Nevelsen gravatar image

updated 2015-11-01 12:26:54 +0200

Hi, sailors.

It's a common knowledge, that one can retrieve cellular-related parameters by issuing the command:

dbus-send --system --print-reply=literal --type=method_call --dest=org.ofono /ril_0 org.ofono.NetworkRegistration.GetProperties

The number provided by the signal strength parameter seems to be a percentage value. This isn't quite good. Search yielded this link . Jarkko Lehtoranta said that one could just convert percentage value to RSSI. However, the conversion algorithm wasn't discussed. I know, that the scale can be of different nature for different chips/modules/vendors . So, can anyone enlighten me on how can I perform such a conversion? Okay, I know that Jolla CSD tool exists (##310##), and it does show dBm values. I know, that it's a proprietary tool, but can developers clarify, whether they get dBm values directly or convert from percentage values?

Also, if we dig into ofono itself, we'll find many interesting things. For example, this . A special interface called org.ofono.CellInfo could exist as well as a method called GetNeighbors() . As you can see from the patch description, there is RXLEV parameter, that we all really want. Does ofono supplied with Jolla Phone support such an interface?

P.S. Don't tell me that having percentage value is enough. The underlying bindings should provide low-level parameters.

P.P.S. Not only RXLEV is interesting. The full list is:

rxlev: integer type, received signal strength level

ber: integer type; channel bit error rate (in percent)

rscp: integer type, received signal code power

ecno: integer type, ratio of the received energy per PN chip to the total received power spectral density

rsrq: integer type, reference signal received quality

rsrp: integer type, reference signal received power

edit retag flag offensive close delete

2 Answers

Sort by » oldest newest most voted
5

answered 2015-11-01 19:25:56 +0200

Krum Nevelsen gravatar image

updated 2015-11-01 19:26:46 +0200

I looked carefully through rilmodem ofono fork and found out that RSSI / dBm to strength conversion is indeed modem-specific. I also discovered, that every modem had it's own "Maximum RSSI" value (31, 60, etc...). Hence, one can use the formula dBm = (percentage_strength / 100) * max_rssi - 112. I also discovered that our Jolla rilmodem maximum RSSI value seemed to be 60. I checked the numbers several times (comparing dbus-send and csd output) and everything seemed to be okay (and for 3G too). Unfortunately, didn't manage to test the formula on 4G. And, of course, I still appreciate good answers from other community participants.

edit flag offensive delete publish link more

Comments

I tested a bit more. I stood near the LTE base station for a while, and the maximum readings I was able to get were "4G RSRP: >= -51 dBm" (yes-yes, ">=") and "Strength: 100". The latter parameter changed from 90 to 96 and then to 100. I doubt that RSRP value was changing too. But it was inconvenient to switch between Terminal and CSD Tool forth and back, so... I'd prefer thinking that these two parameters are connected with each other. However, on the Nokia N9 the percentage value wasn't derived from RSSI / RSCP. It was a separate parameter possibly connected with the "error bit rate". It showed quality of signal. And, furthermore, situations were possible, when two different percentage values could be observed at a constand dBm ("signal level") value. And it made sense. But there was another kind of modem on Nokia N9...

Krum Nevelsen ( 2015-11-02 21:13:42 +0200 )edit

Web search gave me some knowledge that one can communicate to RIL using '/dev/sockets/rild'. So https://github.com/rilmodem/ofono is indeed worth studying. Let's take a look at 'gril/gril.c'. We can start unleashing the tangle from g_ril_new(...) function. It's first argument is a path to 'rild' (see above). Then we observe create_ril(..) and so forth. What's for g_ril_new(...), it is used by create_gril(..) function in 'plugins/ril.c'. So, I think that if one succeeds unleashing all this stuff, we will be able to retrieve even more parameters, including but not limiting to RSSI / RSCP / RSRP and separate quality value. In example, neighbouring cells list will also be very interesting to get. The main idea is that we somehow can communicate to RIL directly using convenient socket interface. Without ofono. C'mon, folks! New possibilities can be revealed :)

Krum Nevelsen ( 2015-11-02 22:17:25 +0200 )edit

Yeah, I can see the full dictionary of RIL requests here: 'gril/ril_constants.h'. Look! RIL_REQUEST_GET_NEIGHBORING_CELL_IDS . After looking through the code I got a feeling that it would be somehow inconvenient to re-implement such communication mechanisms in userland applications, especially due to the lack of root privileges. But one can try implementing some additional 'dbus' properties directly in 'ofono' to make them visible to all Sailfish app developers via 'dbus'. Got interested, ya? Go ahead...

Krum Nevelsen ( 2015-11-02 23:04:04 +0200 )edit

So, it's better to move to https://git.merproject.org/mer-core/ofono and continue our study there. One can implement additional parameters querying and representing them as dbus-ready parameters. Then one will be able to recompile the package. Heeey, people! What's your opinion? :)

Krum Nevelsen ( 2015-11-02 23:12:48 +0200 )edit
4

answered 2015-11-05 00:13:13 +0200

Krum Nevelsen gravatar image

updated 2015-11-05 00:15:14 +0200

Hey, folks!

After some painful search I managed to discover that our modem was likely to be "Qualcomm Gobi"... I tried to discern some modem-specific things in the "oFono" code, but it was quite hard. Too many abstractions, wrappers, callbacks... Brrr. It is capable of doing things via RIL (which is required for some fast data connections) and via conventional AT commands (ideal for GSM, etc...). But my initial enthusiasm of adding some new functionality to "oFono" was redundant, I think. But at least I found the correct formula which "oFono" used for the strength percentage calculation: percentage = rssi * 100 / 31 (rssi is an index, not a dBm value)

I decided to discover the way of communicating to the modem via AT commands. Didn't know the name of the serial device... Thanks to this post: http://stackoverflow.com/a/28327673 . /dev/smd7 or /dev/smd11 . Thanks a lot! I didn't want to write a program for chatting with the modem, so I just used the free and tiny utility from here: http://atinout.sourceforge.net/ .

Finally, I was able to execute AT+CSQ command. Unfortunately, our modem doesn't support error bit rate reporting (this is confirmed by this document, page 23). That's why the second number in AT+CSQ output will always be 99. Okay. But how can I convert it to a dBm value? Simple. See this document, page 100. One can guess that dBm = 2 * rssi - 113 . Indeed, the maximum signal level can be reported as ">= -51 dBm" (because the maximum rssi is 31). The same formulae can be used in case of 3G (rscp index). Not sure if it suites in LTE case.

If one executes AT+CREG=2 command and after that AT+CREG? , it will be possible to know the hex values of LAC and Cell ID.

Some preliminary summary: 1) We definitely can talk to our modem via AT commands. Root privileges are required. 2) No error bit rate value. No chance to measure signal quality. In example, on Nokia N9 the dBm signal level value and the percentage value were absolutely separate from each other. One could get two different percentage values at a constant dBm value (in different periods of time, of course). 3) I didn't figure out how it was possible to get the neighbouring cells list via AT commands interface.

I'll keep on digging it deeper. Stay online.

edit flag offensive delete publish link more

Comments

Really useful info. Many thanks:)

richardski ( 2016-07-24 13:09:48 +0200 )edit

Thanks for attention. Are you developing some app? Do you have some additional considerations regarding the topic?

Krum Nevelsen ( 2016-07-24 15:50:08 +0200 )edit
Login/Signup to Answer

Question tools

Follow
7 followers

Stats

Asked: 2015-11-01 12:22:56 +0200

Seen: 1,369 times

Last updated: Nov 05 '15