Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question for assistnow example and LENA-R8 #176

Open
arnoutdekimo opened this issue Dec 13, 2023 · 7 comments
Open

Question for assistnow example and LENA-R8 #176

arnoutdekimo opened this issue Dec 13, 2023 · 7 comments

Comments

@arnoutdekimo
Copy link

Hi,

I've been looking into getting the MGA-based offline/online assistnow data to the LENA-R8 through the ubxlib. So far no luck.
As far as I understand:

  • In uGnssAdd, we check if pInstance->transportType != U_GNSS_TRANSPORT_AT

  • Only then, are the ringbuffers created uRingBufferCreateWithReadHandle(&(pInstance->ringBuffer) ..

  • In case of the LENA-R8, the transport type is AT for GNSS, CMUX is not used, so no ringbuffers are created

  • During the actual uGnssMsgPrivateReceiveStart call (to put the assistnow data into the modem), it is attempted to take a ringbuffer (uRingBufferTakeReadHandle(&(pInstance->ringBuffer));)

  • This fails because of the reasons above

So quick question: Is there a way that we can push the assitnow data manually (using the MGA lib) into the module?

By the way, I was actually initially just using the AT+UGPS commands manually, to let it do the download and pushing of the data to the modem itself internally, but for some reason this works considerably worse/slower than on the SARA-R4. Hence, why I quickly looked into pushing the data myself (what in the end is also just done by ucenter)

Thanks for your feedback!

@RobMeades
Copy link
Contributor

Hi Arnout: I'm otherwise occupied for a few hours, will get back to you later, but a quick response:

From what you're asking, I guess this is with a "LENA-R8001M10"? You're right that, for whatever reason, the current FW version of LENA-R8 does not support access to the on-board GNSS device using CMUX, which, frankly speaking, is an utter pain; all of the ubxlib stuff is designed to work seamlessly (supporting streamed position from the GNSS device and using those ring buffers) with the CMUX mechanism, without it we are stuck with the clunky AT commands, which don't allow us to take advantage of the GNSS device just sending position autonomously.

However, you shouldn't have to do any of this AssistNow stuff "by hand", the intention is that the cellular module downloads all of the assistance data to the internal GNSS chip by itself. This is in the uCellLoc API calls: you configure it with your authentication token with uCellLocSetServer() and then configure the behaviour of the module ref. AssistNow with the functions here. This should cause the module to sort out all of the AssistNow stuff for you, all you need to do is ask it for location fixes in the normal way.

It is probably, of course, possible to do all of this by hand with the AT+UGUBX commands, but that would require rather more code/work/test. It is ultimately more controllable by you, of course, so I would understand if you want to go that way.

@RobMeades
Copy link
Contributor

RobMeades commented Dec 13, 2023

By the way, I was actually initially just using the AT+UGPS commands manually, to let it do the download and pushing of the data to the modem itself internally, but for some reason this works considerably worse/slower than on the SARA-R4. Hence, why I quickly looked into pushing the data myself (what in the end is also just done by ucenter)

Re-reading your post, I see that you've already tried what I was suggesting. I will see if there's a sensible way to make the MGA download working use AT commands later.

@RobMeades
Copy link
Contributor

RobMeades commented Dec 13, 2023

Ugh.

Whatever we do here will be a complete hack I'm afraid. The thing is that the libMga code was designed with the expectation of an asynchronous send/receive interface with the GNSS device, hence the same approach was taken when integrating it into ubxlib. And an asynchronous send/receive world is exactly what we don't have when forced to use the essentially uni-directional, command/response-style, AT+UGUBX interface.

The hack (see branch including this below) is as follows:

sendReceiveUbxMessageAt() requires a non-NULL pResponse pointer but you can set the contents of the pointed-to-variable to be all zeroes, so something like this:

static void writeDeviceCallback(const void *pContext, const UBX_U1 *pData, UBX_I4 iSize)
{
    uGnssPrivateUbxReceiveMessage_t response = {0};
    uGnssPrivateInstance_t *pInstance = (uGnssPrivateInstance_t *) pContext;

    sendReceiveUbxMessageAt((const uAtClientHandle_t) pInstance->transportHandle.pAt,
                            (const char *) pData, iSize, &response, pInstance->timeoutMs,
                            pInstance->printUbxMessages);
}

I have made these changes on a branch which I have pushed here:

https://github.com/u-blox/ubxlib/tree/hack_hack_hack_for_arnout_nothing_to_see_here_rmea

...and run it against a SARA-R510M8S (which should be sufficiently similar for our purposes) and it appears to work, see logged output from running a hacked version of the assist_now_main.c example below (with suitably modified AssistNow authentication token, don't worry).

If this works for you, and means that LENA-R8001M10 becomes a usable beast, I can see if I can find some acceptable way to bring the hack into the ubxlib codebase.

20:12:36 ATE0
20:12:36 OK
20:12:36 AT+CMEE=2
20:12:36 OK
20:12:36 AT+UDCONF=1,0
20:12:36 OK
20:12:36 ATI9
20:12:36 03.15,A00.01
20:12:36 OK
20:12:36 AT&C1
20:12:36 OK
20:12:37 AT&D0
20:12:37 OK
20:12:37 AT&K3
20:12:37 OK
20:12:37 AT+UPSV=0
20:12:37 OK
20:12:37 AT+UPSMR=1
20:12:37 OK
20:12:37 AT+CPSMS?
20:12:37 +CPSMS: 0,,,"00010011","00000011"
20:12:37 OK
20:12:37 AT+UMNOPROF?
20:12:37 +UMNOPROF: 100
20:12:37 OK
20:12:37 AT+UGPRF?
20:12:37 +UGPRF: 18,0,""
20:12:37 OK
20:12:37 AT+CFUN=4
20:12:37 OK
20:12:37 Opened cellular device with return code 0.
20:12:37 Bringing up the cellular network...
20:12:37 U_CELL_NET: preparing to register/connect...
20:12:37 AT+CREG=2
20:12:37 OK
20:12:37 AT+CGREG=2
20:12:37 OK
20:12:37 AT+CEREG=4
20:12:37 OK
20:12:37 AT+CIMI
20:12:37 001010987654368
20:12:37 OK
20:12:37 AT+CIMI
20:12:37 001010987654368
20:12:37 OK
20:12:37 U_CELL_NET: APN from database is "internet".
20:12:37 AT+CGDCONT=1,"IP","internet"
20:12:37 OK
20:12:37 AT+UAUTHREQ=1,0,"",""
20:12:37 OK
20:12:37 U_CELL_NET: setting automatic network selection mode...
20:12:37 AT+COPS?
20:12:37 +COPS: 0
20:12:37 OK
20:12:38 AT+CFUN=1
20:12:38 OK
20:12:38 AT+CREG?
20:12:38 +CREG: 2,0
20:12:38 OK
20:12:38 -1: NReg
20:12:38 AT+CGREG?
20:12:38 +CGREG: 2,4
20:12:38 OK
20:12:38 -1: OoC
20:12:39 AT+CEREG?
20:12:39 +CEREG: 4,0
20:12:39 OK
20:12:39 -1: NReg
20:12:39 +CREG: 6,"0001","01a2d001",7
20:12:39 +CEREG: 1,"0001","01a2d001",7
20:12:39 7: RegS
20:12:39 7: RegH
20:12:39 AT+COPS=3,0
20:12:39 OK
20:12:39 AT+COPS?
20:12:39 +COPS: 0,0,"PicoLTE Network",7
20:12:39 OK
20:12:39 AT+CGATT?
20:12:39 +CGATT: 1
20:12:39 OK
20:12:39 AT+CGACT?
20:12:39 +CGACT: 1,1
20:12:39 OK
20:12:39 AT+UPSD=0,0,0
20:12:39 OK
20:12:39 AT+UPSD=0,100,1
20:12:39 OK
20:12:39 AT+UPSDA=0,3
20:12:40 OK
20:12:40 +UUPSDA: 0,"192.168.3.2"
20:12:40 U_CELL_NET: connected after 2 second(s).
20:12:40 Bringing up the GNSS network inside cellular...
20:12:40 U_GNSS: initialising with ENABLE_POWER pin not connected, transport type AT.
20:12:40 ATI
20:12:40 SARA-R510M8S-01B-00
20:12:40 OK
20:12:40 AT+UGIND=1
20:12:40 OK
20:12:40 AT+UGPS?
20:12:40 +UGPS: 0
20:12:40 OK
20:12:40 ATI
20:12:40 SARA-R510M8S-01B-00
20:12:40 OK
20:12:40 AT+UGPS=1,15,127
20:12:42 OK
20:12:42 AT+USECPRF=0
20:12:42 OK
20:12:42 AT+USECPRF=0,0,0
20:12:42 OK
20:12:42 AT+USECPRF=0,10,"offline-live1.services.u-blox.com"
20:12:42 OK
20:12:42 +UUGIND: 0,99
20:12:42 AT+UHTTP=0
20:12:42 OK
20:12:42 AT+UHTTP=0,1,"offline-live1.services.u-blox.com"
20:12:42 OK
20:12:42 AT+UHTTP=0,4,0
20:12:42 OK
20:12:42 AT+UHTTP=0,7,30
20:12:42 OK
20:12:43 AT+UHTTP=0,6,1,0
20:12:43 OK
20:12:43 AT+UHTTP=0,5,443
20:12:43 OK
20:12:43 HTTP GET request will be "/GetOfflineData.ashx?token=Of6JRba_hKab4ynhA3IXvg;gnss=gps;days=1;resolution=1".
20:12:43 AT+UHTTPC=0,1,"/GetOfflineData.ashx?token=Of6JRba_hKab4ynhA3IXvg;gnss=gps;days=1;resolution=1","ubxlibhttp_0"
20:12:43 +UUGIND: 1,0
20:12:43 +UUGIND: 8,0
20:12:43 OK
20:12:46 +UUGIND: 2,1
20:12:46 +UUGIND: 4,6
20:12:46 +UUGIND: 4,6
20:12:47 +UUHTTPCR: 0,1,1
20:12:48 HTTP GET response received, 2604 byte(s).
20:12:48 AT+CCLK?
20:12:48 +CCLK: "23/12/13,20:12:47+00"
20:12:48 OK
20:12:48 U_CELL_INFO: time is 23/12/13,20:12:47+00.
20:12:48 U_CELL_INFO: local time is 1702498367, timezone offset 0 seconds, hence UTC time is 1702498367.
20:12:48 UTC timestamp according to cellular is 1702498367.
20:12:48 AT+UGUBX="B5621340180010000080E7070C0D140C2F00000000000A000000000000005B60"
20:12:48 U_GNSS: sent UBX command b5 62 13 40 18 00 10 00 00 80 e7 07 0c 0d 14 0c 2f 00 00 00 00 00 0a 00 00 00 00 00 00 00 5b 60.
20:12:48 +UGUBX: "no message"
20:12:48 OK
20:12:48 Download 3% complete.
20:12:48 AT+UGUBX="B56213204C0000000200170C0D0CF408507D6060C03F740100E448333FF39B2BE323A65DE318407F0809B024DE081F18970F5C4560E05A614E557F656F13ED60378A32B25BCF14330313918F651D000000003CFD"
20:12:48 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 02 00 17 0c 0d 0c f4 08 50 7d 60 60 c0 3f 74 01 00 e4 48 33 3f f3 9b 2b e3 23 a6 5d e3 18 40 7f 08 09 b0 24 de 08 1f 18 97 0f 5c 45 60 e0 5a 61 4e 55 7f 65 6f 13 ed 60 37 8a 32 b2 5b cf 14 33 03 13 91 8f 65 1d 00 00 00 00 3c fd.
20:12:48 +UGUBX: "no message"
20:12:48 OK
20:12:48 Download 6% complete.
20:12:48 AT+UGUBX="B56213204C0000000300170C0D0CF40850016060C03F8B0700E4C192C2079B2BE3A3A65DE324637908097E38031B1F18970F5C4560E0F3D1EA30C074BF9202EAE6E2D6F315ED76B4CD21ADDD8A2E000000006D55"
20:12:48 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 03 00 17 0c 0d 0c f4 08 50 01 60 60 c0 3f 8b 07 00 e4 c1 92 c2 07 9b 2b e3 a3 a6 5d e3 24 63 79 08 09 7e 38 03 1b 1f 18 97 0f 5c 45 60 e0 f3 d1 ea 30 c0 74 bf 92 02 ea e6 e2 d6 f3 15 ed 76 b4 cd 21 ad dd 8a 2e 00 00 00 00 6d 55.
20:12:48 +UGUBX: "no message"
20:12:48 OK
20:12:48 Download 9% complete.
20:12:48 AT+UGUBX="B56213204C0000000400170C0D0CF40850016060C03FC90200E441BDFD009B2BE3A3A65DA310CA190609F58F0F151F18970F5C4560E0FE42B85623D45DDB687F9898825CA8D94316CF2E5F49F90100000000BA9B"
20:12:48 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 04 00 17 0c 0d 0c f4 08 50 01 60 60 c0 3f c9 02 00 e4 41 bd fd 00 9b 2b e3 a3 a6 5d a3 10 ca 19 06 09 f5 8f 0f 15 1f 18 97 0f 5c 45 60 e0 fe 42 b8 56 23 d4 5d db 68 7f 98 98 82 5c a8 d9 43 16 cf 2e 5f 49 f9 01 00 00 00 00 ba 9b.
20:12:48 +UGUBX: "no message"
20:12:48 OK
20:12:48 Download 12% complete.
20:12:48 AT+UGUBX="B56213204C0000000500170C0D0CF40850FD6060C0BF9BFF0FE434BFFBF99B2BE3E3A65D6353E6C2070902EBF51D1F18970F5C4560E04F48ADAAD3CD4E3BA08116FBEEABFA224F0931FBD0DB0CCF000000007ED9"
20:12:48 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 05 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf 9b ff 0f e4 34 bf fb f9 9b 2b e3 e3 a6 5d 63 53 e6 c2 07 09 02 eb f5 1d 1f 18 97 0f 5c 45 60 e0 4f 48 ad aa d3 cd 4e 3b a0 81 16 fb ee ab fa 22 4f 09 31 fb d0 db 0c cf 00 00 00 00 7e d9.
20:12:48 +UGUBX: "no message"
20:12:48 OK
20:12:48 Download 15% complete.
20:12:48 AT+UGUBX="B56213204C0000000600170C0D0CF40850816060C03FDCFC0FE44A52000A9B2BE3E3A65DE368FEE308092B791F171F18970F5C4560E0FE5BE4462DACCBEE78FEA302227D3831E79A8E170B1B9D1A000000005D20"
20:12:48 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 06 00 17 0c 0d 0c f4 08 50 81 60 60 c0 3f dc fc 0f e4 4a 52 00 0a 9b 2b e3 e3 a6 5d e3 68 fe e3 08 09 2b 79 1f 17 1f 18 97 0f 5c 45 60 e0 fe 5b e4 46 2d ac cb ee 78 fe a3 02 22 7d 38 31 e7 9a 8e 17 0b 1b 9d 1a 00 00 00 00 5d 20.
20:12:48 +UGUBX: "no message"
20:12:48 OK
20:12:48 Download 18% complete.
20:12:48 AT+UGUBX="B56213204C0000000700170C0D0CF40850FD6060C03F58FD0FE488E4C2F99B2BE323A65D830189FE0709CA58FF011F18970F5C4560E02F31287C9D773B5CA3152B5A89415603FBF1D32338B3B7CE00000000643E"
20:12:48 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 07 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 3f 58 fd 0f e4 88 e4 c2 f9 9b 2b e3 23 a6 5d 83 01 89 fe 07 09 ca 58 ff 01 1f 18 97 0f 5c 45 60 e0 2f 31 28 7c 9d 77 3b 5c a3 15 2b 5a 89 41 56 03 fb f1 d3 23 38 b3 b7 ce 00 00 00 00 64 3e.
20:12:48 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 21% complete.
20:12:49 AT+UGUBX="B56213204C0000000800170C0D0CF40850FD6060C03F77FF0FE462EA400B9B2BE323A65D4320DEE40809DDBCF5091F18970F5C4560E04F879642A9C70A593F7F1F4711C7B8D4EB0B58244A4F93EA00000000B61B"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 08 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 3f 77 ff 0f e4 62 ea 40 0b 9b 2b e3 23 a6 5d 43 20 de e4 08 09 dd bc f5 09 1f 18 97 0f 5c 45 60 e0 4f 87 96 42 a9 c7 0a 59 3f 7f 1f 47 11 c7 b8 d4 eb 0b 58 24 4a 4f 93 ea 00 00 00 00 b6 1b.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 25% complete.
20:12:49 AT+UGUBX="B56213204C0000000900170C0D0CF40850016060C03F350300E44AEC3F079B2BE3E3A65D037924DD08096E9A01161F18970F5C4560E05A08B79C991691F8B17F27BD8C475BEE99133835AD147DE900000000BF34"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 09 00 17 0c 0d 0c f4 08 50 01 60 60 c0 3f 35 03 00 e4 4a ec 3f 07 9b 2b e3 e3 a6 5d 03 79 24 dd 08 09 6e 9a 01 16 1f 18 97 0f 5c 45 60 e0 5a 08 b7 9c 99 16 91 f8 b1 7f 27 bd 8c 47 5b ee 99 13 38 35 ad 14 7d e9 00 00 00 00 bf 34.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 28% complete.
20:12:49 AT+UGUBX="B56213204C0000000A00170C0D0CF40850FD6060C0BF95FF0FE4A9A741089B2BE323A65D4317BE5F080963BDFB0A1F18970F5C4560E02F0012BA5C930C2C76FE1D672E5625E2E2FBCECCF250E90900000000F7AF"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 0a 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf 95 ff 0f e4 a9 a7 41 08 9b 2b e3 23 a6 5d 43 17 be 5f 08 09 63 bd fb 0a 1f 18 97 0f 5c 45 60 e0 2f 00 12 ba 5c 93 0c 2c 76 fe 1d 67 2e 56 25 e2 e2 fb ce cc f2 50 e9 09 00 00 00 00 f7 af.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 31% complete.
20:12:49 AT+UGUBX="B56213204C0000000B00170C0D0CF40850FD6060C03FCDFB0FE477AD7EFC9B2BE3E3A65D2360CFA506098561DF151F18970F5C4560E0DEE4A2A7B65516FCAE6CDE987C048D3BC4EEE00A3E6D0E0200000000AB87"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 0b 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 3f cd fb 0f e4 77 ad 7e fc 9b 2b e3 e3 a6 5d 23 60 cf a5 06 09 85 61 df 15 1f 18 97 0f 5c 45 60 e0 de e4 a2 a7 b6 55 16 fc ae 6c de 98 7c 04 8d 3b c4 ee e0 0a 3e 6d 0e 02 00 00 00 00 ab 87.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 34% complete.
20:12:49 AT+UGUBX="B56213204C0000000C00170C0D0CF40850FD6060C0BFE8FE0FE4F17C84F89B2BE3E3A65D2357803A0809CC12E21C1F18970F5C4560E090D6A272C974A8D890DE71229299C516111060E0D9F72D2E000000004953"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 0c 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf e8 fe 0f e4 f1 7c 84 f8 9b 2b e3 e3 a6 5d 23 57 80 3a 08 09 cc 12 e2 1c 1f 18 97 0f 5c 45 60 e0 90 d6 a2 72 c9 74 a8 d8 90 de 71 22 92 99 c5 16 11 10 60 e0 d9 f7 2d 2e 00 00 00 00 49 53.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 37% complete.
20:12:49 AT+UGUBX="B56213204C0000000D00170C0D0CF40850016060C03F160100E44A7EC1F99B2BE363A65D4354AA39080999A327071F18970F5C4560E0E358BFFF9DFCD8F36C854A145755B32ED5DE97F3C00970DB000000009D34"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 0d 00 17 0c 0d 0c f4 08 50 01 60 60 c0 3f 16 01 00 e4 4a 7e c1 f9 9b 2b e3 63 a6 5d 43 54 aa 39 08 09 99 a3 27 07 1f 18 97 0f 5c 45 60 e0 e3 58 bf ff 9d fc d8 f3 6c 85 4a 14 57 55 b3 2e d5 de 97 f3 c0 09 70 db 00 00 00 00 9d 34.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 40% complete.
20:12:49 AT+UGUBX="B56213204C0000000E00170C0D0CF40850016060C03FE70200E4B1A53DFD9B2BE363A65DC3700F700609959C110A1F18970F5C4560E08EDEFFA50213CAABB48712447DC5471862C75A3735D8F3010000000093F0"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 0e 00 17 0c 0d 0c f4 08 50 01 60 60 c0 3f e7 02 00 e4 b1 a5 3d fd 9b 2b e3 63 a6 5d c3 70 0f 70 06 09 95 9c 11 0a 1f 18 97 0f 5c 45 60 e0 8e de ff a5 02 13 ca ab b4 87 12 44 7d c5 47 18 62 c7 5a 37 35 d8 f3 01 00 00 00 00 93 f0.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 43% complete.
20:12:49 AT+UGUBX="B56213204C0000000F00170C0D0CF40850016060C0BF0C0100E41B9D41FA9B2BE363A65D835F3429080941F506081F18970F5C4560E013F6D5D603942BD4222884F2B181D827495736D72592BCE900000000DFC2"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 0f 00 17 0c 0d 0c f4 08 50 01 60 60 c0 bf 0c 01 00 e4 1b 9d 41 fa 9b 2b e3 63 a6 5d 83 5f 34 29 08 09 41 f5 06 08 1f 18 97 0f 5c 45 60 e0 13 f6 d5 d6 03 94 2b d4 22 28 84 f2 b1 81 d8 27 49 57 36 d7 25 92 bc e9 00 00 00 00 df c2.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 46% complete.
20:12:49 AT+UGUBX="B56213204C0000001000170C0D0CF408507D6060C03FF60100E40701BFFA9B2BE3A3A65D032C797C0809686BE51B1F18970F5C4560E0D2B324CD6A86FEFD99413A845ABE7FDA4C7736F2F24F90D300000000FD03"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 10 00 17 0c 0d 0c f4 08 50 7d 60 60 c0 3f f6 01 00 e4 07 01 bf fa 9b 2b e3 a3 a6 5d 03 2c 79 7c 08 09 68 6b e5 1b 1f 18 97 0f 5c 45 60 e0 d2 b3 24 cd 6a 86 fe fd 99 41 3a 84 5a be 7f da 4c 77 36 f2 f2 4f 90 d3 00 00 00 00 fd 03.
20:12:49 +UGUBX: "no message"
20:12:49 OK
20:12:49 Download 50% complete.
20:12:49 AT+UGUBX="B56213204C0000001100170C0D0CF40850816060C03FD7FF0FE487E0C0F99B2BE363A65D236516350809E7522F041F18970F5C4560E0D644B6BC64F76D5A408638BE38849B062C4B022812F4A92C00000000A144"
20:12:49 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 11 00 17 0c 0d 0c f4 08 50 81 60 60 c0 3f d7 ff 0f e4 87 e0 c0 f9 9b 2b e3 63 a6 5d 23 65 16 35 08 09 e7 52 2f 04 1f 18 97 0f 5c 45 60 e0 d6 44 b6 bc 64 f7 6d 5a 40 86 38 be 38 84 9b 06 2c 4b 02 28 12 f4 a9 2c 00 00 00 00 a1 44.
20:12:49 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 53% complete.
20:12:50 AT+UGUBX="B56213204C0000001200170C0D0CF40850FD6060C0BF36FD0FE4F83BFCFC9B2BE363A65D637E274C070978F4DE011F18970F5C4560E08F76828867F6ACBBF3AAECEE7D1126F9CBFC51DDDB1097CE000000005E4F"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 12 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf 36 fd 0f e4 f8 3b fc fc 9b 2b e3 63 a6 5d 63 7e 27 4c 07 09 78 f4 de 01 1f 18 97 0f 5c 45 60 e0 8f 76 82 88 67 f6 ac bb f3 aa ec ee 7d 11 26 f9 cb fc 51 dd db 10 97 ce 00 00 00 00 5e 4f.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 +UUGIND: 2,1
20:12:50 Download 56% complete.
20:12:50 AT+UGUBX="B56213204C0000001300170C0D0CF40850016060C03F710100E4898142F59B2BE363A65D0359956A080988F61A001F18970F5C4560E0AD536DA696BE96A09BEF7B284C1758185BD1CC17807F873100000000A55D"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 13 00 17 0c 0d 0c f4 08 50 01 60 60 c0 3f 71 01 00 e4 89 81 42 f5 9b 2b e3 63 a6 5d 03 59 95 6a 08 09 88 f6 1a 00 1f 18 97 0f 5c 45 60 e0 ad 53 6d a6 96 be 96 a0 9b ef 7b 28 4c 17 58 18 5b d1 cc 17 80 7f 87 31 00 00 00 00 a5 5d.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 59% complete.
20:12:50 AT+UGUBX="B56213204C0000001400170C0D0CF40850816060C0BF79FF0FE4519F87FC9B2BE3E3A65DE357FCFE070910051A181F18970F5C4560E06A6C1D94424094D543BECB898BD4982CCE0A1F17C884D2DD00000000848A"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 14 00 17 0c 0d 0c f4 08 50 81 60 60 c0 bf 79 ff 0f e4 51 9f 87 fc 9b 2b e3 e3 a6 5d e3 57 fc fe 07 09 10 05 1a 18 1f 18 97 0f 5c 45 60 e0 6a 6c 1d 94 42 40 94 d5 43 be cb 89 8b d4 98 2c ce 0a 1f 17 c8 84 d2 dd 00 00 00 00 84 8a.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 62% complete.
20:12:50 AT+UGUBX="B56213204C0000001500170C0D0CF40850816060C03FB2FF0FE4D47E00FB9B2BE323A65DA31872500809364A09091F18970F5C4560E0B6DB7A3C7F86C0B59DC9387817BFBFC9C57D380EBF82E61500000000F3AC"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 15 00 17 0c 0d 0c f4 08 50 81 60 60 c0 3f b2 ff 0f e4 d4 7e 00 fb 9b 2b e3 23 a6 5d a3 18 72 50 08 09 36 4a 09 09 1f 18 97 0f 5c 45 60 e0 b6 db 7a 3c 7f 86 c0 b5 9d c9 38 78 17 bf bf c9 c5 7d 38 0e bf 82 e6 15 00 00 00 00 f3 ac.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 65% complete.
20:12:50 AT+UGUBX="B56213204C0000001600170C0D0CF40850816060C03F21FE0FE446CF01FA9B2BE363A65DA364F66A08091D6B04091F18970F5C4560E085547A0044CF4D725CCE9FC91999DF1D6A36A630534523120000000001A8"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 16 00 17 0c 0d 0c f4 08 50 81 60 60 c0 3f 21 fe 0f e4 46 cf 01 fa 9b 2b e3 63 a6 5d a3 64 f6 6a 08 09 1d 6b 04 09 1f 18 97 0f 5c 45 60 e0 85 54 7a 00 44 cf 4d 72 5c ce 9f c9 19 99 df 1d 6a 36 a6 30 53 45 23 12 00 00 00 00 01 a8.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 68% complete.
20:12:50 AT+UGUBX="B56213204C0000001700170C0D0CF40850016060C0BFE20100E467A3B9FC9B2BE363A65D037BA41C0609C78407091F18970F5C4560E0A946411976DB33B9EADCD0CCFFA9CBF27498C3C7895EBBED00000000CBAA"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 17 00 17 0c 0d 0c f4 08 50 01 60 60 c0 bf e2 01 00 e4 67 a3 b9 fc 9b 2b e3 63 a6 5d 03 7b a4 1c 06 09 c7 84 07 09 1f 18 97 0f 5c 45 60 e0 a9 46 41 19 76 db 33 b9 ea dc d0 cc ff a9 cb f2 74 98 c3 c7 89 5e bb ed 00 00 00 00 cb aa.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 71% complete.
20:12:50 AT+UGUBX="B56213204C0000001800170C0D0CF40850FD6060C0BFC0FD0FE40153BF089B2BE363A65D036B300F09094F54E6071F18970F5C4560E010AF1C815EE7B301CDAA4AF86C062231CF346EEAB06FEF1D000000009BF0"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 18 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf c0 fd 0f e4 01 53 bf 08 9b 2b e3 63 a6 5d 03 6b 30 0f 09 09 4f 54 e6 07 1f 18 97 0f 5c 45 60 e0 10 af 1c 81 5e e7 b3 01 cd aa 4a f8 6c 06 22 31 cf 34 6e ea b0 6f ef 1d 00 00 00 00 9b f0.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 75% complete.
20:12:50 AT+UGUBX="B56213204C0000001900170C0D0CF40850016060C0BF6A0000E404BD000C9B2BE3E3A65DE36E6EE80809AD881F181F18970F5C4560E0A521D46C13DF79030B48310B2970530192E8C1CCBD3DBB1F00000000B7BE"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 19 00 17 0c 0d 0c f4 08 50 01 60 60 c0 bf 6a 00 00 e4 04 bd 00 0c 9b 2b e3 e3 a6 5d e3 6e 6e e8 08 09 ad 88 1f 18 1f 18 97 0f 5c 45 60 e0 a5 21 d4 6c 13 df 79 03 0b 48 31 0b 29 70 53 01 92 e8 c1 cc bd 3d bb 1f 00 00 00 00 b7 be.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 78% complete.
20:12:50 AT+UGUBX="B56213204C0000001A00170C0D0CF40850816060C0BF2BFF0FE49FBE7E0D9B2BE3A3A65DC327AEF908097EC00D171F18970F5C4560E000F7CF7E80E1EED25DCD59FC370323D61D3AFBE0920228E200000000DEFB"
20:12:50 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 1a 00 17 0c 0d 0c f4 08 50 81 60 60 c0 bf 2b ff 0f e4 9f be 7e 0d 9b 2b e3 a3 a6 5d c3 27 ae f9 08 09 7e c0 0d 17 1f 18 97 0f 5c 45 60 e0 00 f7 cf 7e 80 e1 ee d2 5d cd 59 fc 37 03 23 d6 1d 3a fb e0 92 02 28 e2 00 00 00 00 de fb.
20:12:50 +UGUBX: "no message"
20:12:50 OK
20:12:50 Download 81% complete.
20:12:51 AT+UGUBX="B56213204C0000001B00170C0D0CF40850FD6060C0BFACFE0FE4C0B7FF079B2BE323A65D832FA1D9080930A0FA051F18970F5C4560E03E5A5B5F7DFC2312073F9B157EF837D65E14D406FBA20BD50000000053FF"
20:12:51 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 1b 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf ac fe 0f e4 c0 b7 ff 07 9b 2b e3 23 a6 5d 83 2f a1 d9 08 09 30 a0 fa 05 1f 18 97 0f 5c 45 60 e0 3e 5a 5b 5f 7d fc 23 12 07 3f 9b 15 7e f8 37 d6 5e 14 d4 06 fb a2 0b d5 00 00 00 00 53 ff.
20:12:51 +UGUBX: "no message"
20:12:51 OK
20:12:51 Download 84% complete.
20:12:51 AT+UGUBX="B56213204C0000001C00170C0D0CF40850FD6060C0BF4DFD0FE4EB85BCFB9B2BE3A3A65DE316579F06097888FB171F18970F5C4560E0C81D8EA0E1DACD0C0B9B46F09FDFBED29222D8E60B01481F0000000056E6"
20:12:51 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 1c 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf 4d fd 0f e4 eb 85 bc fb 9b 2b e3 a3 a6 5d e3 16 57 9f 06 09 78 88 fb 17 1f 18 97 0f 5c 45 60 e0 c8 1d 8e a0 e1 da cd 0c 0b 9b 46 f0 9f df be d2 92 22 d8 e6 0b 01 48 1f 00 00 00 00 56 e6.
20:12:51 +UGUBX: "no message"
20:12:51 OK
20:12:51 Download 87% complete.
20:12:51 AT+UGUBX="B56213204C0000001D00170C0D0CF408507D6060C0BF130000E48E1501FB9B2BE3E3A65DE37EC53E0809D008D8161F18970F5C4560E04166638C76B0B2FA7BA3C18F5F5E24184379F0CCBF824BEA00000000BB4D"
20:12:51 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 1d 00 17 0c 0d 0c f4 08 50 7d 60 60 c0 bf 13 00 00 e4 8e 15 01 fb 9b 2b e3 e3 a6 5d e3 7e c5 3e 08 09 d0 08 d8 16 1f 18 97 0f 5c 45 60 e0 41 66 63 8c 76 b0 b2 fa 7b a3 c1 8f 5f 5e 24 18 43 79 f0 cc bf 82 4b ea 00 00 00 00 bb 4d.
20:12:51 +UGUBX: "no message"
20:12:51 OK
20:12:51 Download 90% complete.
20:12:51 AT+UGUBX="B56213204C0000001E00170C0D0CF408507D6060C03F2F0100E4D19F000A9B2BE363A65D437117E10809D9F6E1051F18970F5C4560E050FCF8DB1BCA37F6C09828B270993A1E4D787A218DE267D700000000FF19"
20:12:51 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 1e 00 17 0c 0d 0c f4 08 50 7d 60 60 c0 3f 2f 01 00 e4 d1 9f 00 0a 9b 2b e3 63 a6 5d 43 71 17 e1 08 09 d9 f6 e1 05 1f 18 97 0f 5c 45 60 e0 50 fc f8 db 1b ca 37 f6 c0 98 28 b2 70 99 3a 1e 4d 78 7a 21 8d e2 67 d7 00 00 00 00 ff 19.
20:12:51 +UGUBX: "no message"
20:12:51 OK
20:12:51 Download 93% complete.
20:12:51 AT+UGUBX="B56213204C0000001F00170C0D0CF40850FD6060C0BFECFF0FE4D95142F79B2BE3A3A65D631BB11308095927F1151F18970F5C4560E0BBE3D5DBB86DC8A39FB5DBFA204388C78D8567EF6822190D000000005AA9"
20:12:51 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 1f 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf ec ff 0f e4 d9 51 42 f7 9b 2b e3 a3 a6 5d 63 1b b1 13 08 09 59 27 f1 15 1f 18 97 0f 5c 45 60 e0 bb e3 d5 db b8 6d c8 a3 9f b5 db fa 20 43 88 c7 8d 85 67 ef 68 22 19 0d 00 00 00 00 5a a9.
20:12:51 +UGUBX: "no message"
20:12:51 OK
20:12:51 Download 96% complete.
20:12:51 AT+UGUBX="B56213204C0000002000170C0D0CF40850FD6060C0BFF7FE0FE4ADF2BE069B2BE323A65DE32247CE08096FF8D8031F18970F5C4560E0C934FF26A746E898440F4A2D5923C6EF261F44DE92081E2F0000000080E7"
20:12:51 U_GNSS: sent UBX command b5 62 13 20 4c 00 00 00 20 00 17 0c 0d 0c f4 08 50 fd 60 60 c0 bf f7 fe 0f e4 ad f2 be 06 9b 2b e3 23 a6 5d e3 22 47 ce 08 09 6f f8 d8 03 1f 18 97 0f 5c 45 60 e0 c9 34 ff 26 a7 46 e8 98 44 0f 4a 2d 59 23 c6 ef 26 1f 44 de 92 08 1e 2f 00 00 00 00 80 e7.
20:12:51 +UGUBX: "no message"
20:12:51 OK
20:12:51 Download 100% complete.
20:12:51 AssistNow data downloaded to GNSS.
20:12:51 AT+ULSTFILE=0
20:12:51 +ULSTFILE: "ubxlib_test_http_response","ubxlibhttp_0","ubxlibhttp_1"
20:12:51 OK
20:12:51 AT+UDELFILE="ubxlibhttp_0"
20:12:51 OK
20:12:51 Taking down GNSS network...
20:12:51 AT+UGPS=0
20:12:57 OK
20:12:57 +UUGIND: 8,0
20:12:57 +UUGIND: 1,0
20:12:57 Done.

@arnoutdekimo
Copy link
Author

Cool! Thanks Rob!

I quickly tried your code, and indeed, I manage to transfer the assistnow data to the lena-r8 now.

Unfortunately, is does not make the fix perform better than manually doing the AGPS=1,5 command. (that of course also does local aiding).
I don't know why, but with the same GPS anteanna connected, the SARA-R4 takes only a few seconds from cold boot to lock using assistnow online, while the LENA-R8 takes easily 30s.a few minutes. Hence I thought trying to push assistnow data directly .. but that does not make things faster.

Even though it is interesting in trying to figure out how the assistnow works internally, and I can play with ucenter and manually try to upload assistnow data, I think I am just going to leave it up to the module, and for now have to live with the slower lock times on the lena-r8?

Anyway, many thanks for the branch! At least if I ever want to go back to manual control of the assitnow data, I can now use it this way, also on the lena!

@RobMeades
Copy link
Contributor

RobMeades commented Dec 14, 2023

I think there's something wrong with the LENA-R8001M10 behaviour: the M10 module it contains is our best yet, there is no way it should take 30 seconds or more (which is the usual cold-start time) when it has been given assistance information. I will raise this as a bug internally.

If you have a copy of the branch now, is it OK if I delete it from here? Thinking about it overnight, it wouldn't be so bad if I modified the ubxlib code to allow the download of the assistance data over the AT interface, but LENA-R8001M10 is the only thing that this would be useful for and if this download method doesn't actually improve things over the "let the module do it by itself" approach, things are probably best left as they are.

I will get back to you with any feedback I receive over what LENA-R8001M10 is up to ref. assistance data.

@arnoutdekimo
Copy link
Author

arnoutdekimo commented Dec 14, 2023

Hi,

Ok thanks!
I have the branch locally, so feel free to delete it now.

Regarding the LENA, I think there's something wrong in how it internally handles the AGPS:

  • First of all, it handles the UGSRV command differently than the SARA, and is not doing what the datasheet says it should
    (See my post at https://portal.u-blox.com/s/question/0D5Oj000003LMyMKAW/lenar8001m10s-gps-assistnow-servers, although the reply I got isn't exactly very useful)
  • Secondly, the internal assist now servers to be used are apparently -different- from the ones that can be used in ucenter/your lib code. AND differently from the ones supported by the sara..
  • Thirdly, the UGIND indication 4,0 (saying the assistnow data is processed) either comes much later on the lena, .. or just never comes at all (see example snippet below)
  • And yea, lastly, the end result is that the fix comes much later, which is pretty essential for our application

So all these things combined, make the LENA-R8001M10 pretty inferior to the SARA-R4 for our application unfortunately.
Feel very much free to raise these things internally. My local FAE support isn't budging much (also due to illness/too much work I think), and the online forum isn't given much feedback either. I can raise a support case, but according to the local FAE, that will just circle back to them, and they say just to mail them (which isn't getting me far). I'm glad you're here though!

0:00:20:038 - AT+UGPS=1,5,503
0:00:20:059 -
0:00:20:109 - OK
0:00:20:110 -
0:00:20:381 - +UUGIND: 1,0
0:00:20:382 -
0:00:21:034 - +UUGIND: 0,1
0:00:21:035 -
0:00:22:199 - +UUGIND: 0,503
0:00:22:200 -
0:00:25:166 - +UUGIND: 1,0
0:00:25:167

  • Timeout waiting for assistnow result!

0:00:35:117 -

(more than 10 seconds for the reply, while this is usually very fast on the sara)

@RobMeades
Copy link
Contributor

Sorry about this; internal bug raised, Jira number LS_EL_R80-703 if you need to wield it in any conversations with u-blox support in general. But, as indicated before, unless there's an AT-level workaround this is unlikely to be something where any fix will come around quickly, as is the nature of cellular and, who knows, we may get CMUX in it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants