Hi,
I have trouble configuring Here service for multicell positioning. I've used the service before, but recently updated to NCS 2.0.0. I don't know what are the configuration flags that would print float numbers to string. Currently the only way I can get a location is to modify the here_integration.c file and ask the location without rsrq information.
The here_integrationc file has this template:
#define HTTP_REQUEST_BODY \
"{" \
"\"lte\":[" \
"{" \
"\"mcc\":%d," \
"\"mnc\":%d," \
"\"cid\":%d," \
"\"tac\":%d," \
"\"rsrp\":%d," \
"\"rsrq\":%.1f," \
"\"ta\":%d," \
"\"nmr\":[" \
"%s" \
"]" \
"}" \
"]" \
"}"
That is later used to format the request json:
len = snprintk(buf, buf_len, HTTP_REQUEST_BODY,
cell_data->current_cell.mcc,
cell_data->current_cell.mnc,
cell_data->current_cell.id,
cell_data->current_cell.tac,
here_adjust_rsrp(cell_data->current_cell.rsrp),
here_adjust_rsrq(cell_data->current_cell.rsrq),
here_adjust_ta(cell_data->current_cell.timing_advance),
neighbors);
This is the log of what is happening:
[00:30:50.569,061] <dbg> location: method_cellular_lte_ind_handler: Cell measurements results received
[00:30:50.572,052] <dbg> multicell_location_here: location_service_get_cell_location_here: Generated request body:
{"lte":[{"mcc":244,"mnc":91,"cid":36945675,"tac":4050,"rsrp":-119,"rsrq":%.1f,"ta":10,"nmr":[{"earfcn":474,"pci":105,"rsrp":-120,"rsrq":%.1f},{"earfcn":6300,"pci":417,"rsrp":-110,"rsrq":%.1f}]}]}
[00:30:50.888,702] <inf> cloud_module: RRC mode: Connected
%CESQ: 24,1,7,1
%CESQ: 24,1,12,1
[00:30:56.234,619] <err> multicell_location_here: HTTP status: 400
[00:30:56.234,710] <dbg> multicell_location_here: location_service_get_cell_location_here: Received response body:
{"title":"Bad Request","status":400,"code":"E606400","action":"Please correct the request and retry","cause":"Request body must be a valid JSON formatted Positioning API request object.","correlationId":"b883f1e5-c9d5-4a25-aa66-140321352089"}
[00:30:56.235,137] <dbg> multicell_location_here: location_service_parse_response: No 'location' object found
[00:30:56.235,229] <err> multicell_location_here: Failed to parse HTTP response
[00:30:56.235,229] <err> location: Failed to acquire location from multicell_location lib, error: -35
[00:30:56.235,260] <err> location: Location acquisition failed and fallbacks are also done
[00:30:56.235,260] <inf> position_module: * location_event_handler *
[00:30:56.235,260] <inf> position_module: Getting location failed
The Here service responds with an error as my request doesn't have numbers in the "rsrq" field. I have copied these settings from modem_shell sample:
CONFIG_CBPRINTF_LIBC_SUBSTS=y
CONFIG_MINIMAL_LIBC=n
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
Regards,
Ilkka