I’m currently dabbling in a BeaconDB submission client for cell IDs, using the org.nemomobile.ofono
QML Plugin.
All works well as it looks, but I’m having trouble mapping some the cell info properties to the ones required for a request in the submission API:
https://ichnaea.readthedocs.io/en/latest/api/geosubmit2.html
Would anyone kindly tell me which of the properties in a OfonoExtCell
object map to the request payload properties of ichnaea?
@slava maybe?
3 Likes
/****************************************************************************
**
** Copyright (C) 2015-2023 Slava Monich <slava@monich.com>
** Copyright (C) 2015-2021 Jolla Ltd.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
****************************************************************************/
#ifndef QOFONOEXTCELL_H
#define QOFONOEXTCELL_H
#include "qofonoext_types.h"
This file has been truncated. show original
maybe this helps a tiny bit
>mobileCountryCode
sounds like mcc
>mobileNetworkCode
sounds like mnc
>locationAreaCode
guess what sounds like lac
>cellId
guess again cid
>primaryScramblingCode
mmmm psc
signal strength and timingAdvance is quite obvoius
asu/serving i’m not sure of
if (iValid) {
iValid = false;
Q_EMIT cell()->validChanged();
}
}
}
int QOfonoExtCell::Private::getRssiDbm(int aValue)
{
// Range for RSSI in ASU (0-31, 99) as defined in TS 27.007 8.69
return (aValue < 0 || aValue > 31) ? QOFONOEXT_INVALID_VALUE : (-113 + (2 * aValue));
}
int QOfonoExtCell::Private::inRange(int aValue, int aMin, int aMax)
{
return (aValue < aMin || aValue > aMax) ? QOFONOEXT_INVALID_VALUE : aValue;
}
void QOfonoExtCell::Private::getAllSyncInit()
{
this could be asu aka signalLevelDbm
so just serving left, but maybe its just “is it serving the network” and since it reports only available cells maybe you can just set 1 permanently
A value of 1
indicates this as the serving cell, a value of 0
indicates a neighboring cell.
so here you go, registered also could be serving not sure. All values mapped
Thanks!
Not sure which one of the signal strength values is required (signallstrength from ofono is always 31 for me). (Edit: ah that’s ASU as you write! )
And which unit is expected.
The api comments are not very clear!
This is what I do currently:
var payload = { "items": [
{ "timestamp": ts,
"cellTowers": [],
"position": {}
}
]
}
//console.debug(JSON.stringify(cells.getCells()))
var cta = cells.getCells().map(function(cell, idx, arr) {
const types = [ "Unknown", "gsm", "wcdma", "lte", "nr" ]
var ret = {
"radioType": types[cell.type],
"mobileCountryCode": cell.mcc,
"mobileNetworkCode": cell.mnc,
"cellId": cell.ci,
//"age": cell.earfcn,
"serving": cell.registered,
"asu": cell.signalStrength,
"signalStrength": cell.signalLevelDbm
}
if (!!cell.tac && (cell.tac != cells.invalidValue))
It does get accepted by the endpoint, but I really don’t want to push some garbage data.
1 Like
Mister_Magister:
signalLevelDbm
asu is signalLevelDbm
signalStrength is signalStrength
you got them swapped
From watching the actual values I see that e.g.
"signalStrength": 31,
"signalLevelDbm": -106
and “signalStrength” is always(?) 31. From the comment in the code you posted above, that’s an ASU value.
This also matches the values in the api doc example.
So I think my “swapping” them is correct.
That’s weird then, carry on
other than that looks good does it work?
maybe you can talk to the beacondb folk?
I shall try, once I did some more polishing of the app.
It does work, and submission shows no errors. (But that could just be a very lenient server implementation).
Thanks for your help!
no worries mate, good luck
Just for reference:
If radio type
is 3/LTE, Cell id is ci
and only one cell, the registered one, has valid values.
If radio type is 1/GSM, cell id is cid
and both registered, and neighbouring cells are returned with valid info, though only the registered one knows mcc/mnc.
1 Like
btw CSD has cell info in “cell positioning” page
1 Like