Hi,
with my nrf9160 I need to send a gps location every 3 sec to azure, so I combined the agps and the azure iot hub sample.
It's working pretty good but 10 sec as a periodic interval for the gps samples is to high (especially since it's more like 14 sec).
I experimented with continuous mode, so that it gets a location every 1 sec and sends it to azure. But it seems, that it got sent in batches.
Every 16th location sample, he pauses at D: (0x20022f08): [0x200235f0]: Transport writing message. (MQTT log), all gets sent and he starts over (until the 15-17 sample is reached).
When he trys to send, the log looks like the following:
D: (0x20022f08): [0x200235f0]: Transport writing message.
+CSCON: 1
D: (0x20022f08): [0x200235f0]: Transport write complete.
The CSCON: 1 only appears when he sends the data.
It should be:
Get GPS position
Send to Azure
Get GPS position
Send to Azure
.
.
But it seems to be:
Get GPS position
Get GPS position
Get GPS position
Get GPS position
.
.
Send to Azure
Is there any way to send gps data in continuous mode immediately when I call azure_iot_hub_send ?
I guess the lte doesnt get time to send the data, but how can I ensure that the order is GPS, LTE, GPS, LTE... ?
Best regards
Update: I'm currently using the gps sample, where the switching between lte and gps done manually, but it seems to be slower since it needs to reconnect every time I call activate_lte (besides, after 8 to 15 calls it hangs at k_sem_take(<e_ready, K_FOREVER); for 1 hour then the CERREG: 5 finnaly comes. Could this be that my provider blocks me since I connect and disconenct so often?).
I tried to also set PSM mode by calling t_cmd_write("AT+CPSMS=1,,,\"00000110\",\"00000001\"", NULL, 0, NULL); in activate_lte, but now when i leave LTE and GPS activated it just crashes when sending the position through LTE.
Is there any better way?