Closed arnoutdekimo closed 12 months ago
Hi there: yes, your assessment is correct. The design of ubxlib
is to keep the module in its lowest power state when no connection is required, hence the behaviour you see. The other aspects are that, in order to make certain choices (APN and associated fields in the uNetworkInterfaceUp() case, also automatic network selection mode versus a specific MCC/MNC in the uCellNetConnect() case) an API would usually be called to activate the connection.
A few questions to understand your use case:
NULL
or any empty string in the pApn
field of uNetworkCfgCell_t?To be clear about AT+CFUN=4
, it should not cause de-registration with the network, it just switches the radio off, the network will still believe you are connected, like you are in a tunnel, until its periodic timers time (a few minutes) time out. However, you are correct that it will cause a delay because the module will stop any initial search occurring. It is bigger than just andRadioOff
of course, since ubxlib
always puts the module into its lowest power state when it shuts down, so the module will likely always come up in airplane mode in any case. In other words, I suspect if you just hack andRadioOff
to false
it would not improve matters.
I'll think about what we might do to add a kind of "most connected" mode behaviour.
Hi!
For my usecase, my device will be not doing anything for extended periods of time (talking days here). Hence the modem will be fully powered off, since that's the most optimal power situation. When it powers on, it needs to do so asap. So ultimately the amount of energy needed to send some data to the cloud is what I want to minimize, but I figured speeding things up only help, so I quickly looked into some things that I found strange.
The scenario I envisioned was that upon powerloss, the modem still "knows" upon it should try to register asap, and that when ubxlib starts talking to it, it does not interrupt this process (and hence lose more time). I did not know that the lib put it into airplane mode upon shutdown, so indeed in this case it shouldn't have been consuming alot of power upfront after powerup trying to register, and then be cut short when ubxlib tried to interrupt it. Instead upon powerup it should be +- idle, and wait until the radio is actually put back on a bit later. Correct?
The APN will be known upfront, and we will probably need to specify it.
Anyway, thanks already for the feedback.
Thanks for the clarification, very useful.
First a correction to what I said above: AT+CFUN=4
does deregister from the network, just like AT+CFUN=0
would, the difference is that AT+CFUN=4
persists across power cycles/reboots (there is an AT+CFUN=10
that does the "but don't deregister" thing, but that is not available on SARA-R4).
So yes, you interpretation is correct that the design of ubxlib
is that the module will already be in "radio off" state at boot, though we don't, for instance, test with a power meter connected so there could always be a bug.
That said, with this behaviour there will be a time short time at start-up when the module hardware will be powered-on but the module radio hardware will not yet be powered on, because it has not been told by the application to do so. It won't be very long but it will be there. If you need to specify an APN then something, at some point, needs to pass that APN to the module and make it stay; I'm not sure off the top of my head if something needs to be done for the APN to persist (as a matter of policy ubxlib
tries not to rely on persistence in the module, making control/configuration a matter for the application).
The other thing we have to be careful of is that, on some modules, certain commands must be issued for the internal clients of the module (IP stack, MQTT, HTTP) to operate correctly after a network connection has been achieved, and these commands are sent in the code that performs the connection, hence wouldn't be done if the ubxlib
code had not caused the connection, IYSWIM. If you look in that big struct
in u_cell_private.c the "feature" in question is U_CELL_PRIVATE_FEATURE_CONTEXT_MAPPING_REQUIRED
and it is, unfortunately, required in the SARA-R422 case; without this sockets won't work because the IP stack inside the module is unaware of the connection.
I think what I'm saying is that it might be possible to optimize that bit of extra power consumption out but it would be a relatively large change; introduce a kind of "don't go off" mode and make sure that all of our cellular modules behave as expected, using the values once passed for APN etc. If you think it is worth it I can put it on the "TODO" list.
Hi,
It's as you say, in part somewhat related to the design goal of ubxlib I think. If you try to move out all persistent state to the application to have more control (which I like), this conflicts with putting the state in the module (to be faster to boot). In a perfect world, you could use the lib in both ways (but then put the responsibility of having the correct retained state back to the application before having put the module in powerdown). I understand that complicates things (and is pretty hard to test / offer guarantees upon bugs, since customers should not only know their own application, but also like dump the persistent state of the module upon boot etc).
Anyway, I still have to properly measure powerdraws in my scenario's, and perhaps the benefit of caching this in the module NVM is negligible. I suggest I do this first before claiming this as an important feature.
And perhaps for completeness - hacking the andRadioOff (to ignore) turned out to be a bad idea The module apparently reports all is well, but name resolving etc does always work anymore
This is the output of a socket example
0:00:00:053 - AT 0:00:00:154 - 0:00:00:193 - OK 0:00:00:193 - U_CELL_PWR: powering on, module is already on. 0:00:00:194 - ATE0 0:00:00:294 - 0:00:00:333 - OK 0:00:00:333 - AT+CMEE=2 0:00:00:434 - 0:00:00:474 - OK 0:00:00:474 - AT+UDCONF=1,0 0:00:00:576 - 0:00:00:615 - OK 0:00:00:615 - ATI9 0:00:00:716 - 0:00:00:755 - 01.24,A01.10 0:00:00:756 - 0:00:00:756 - OK 0:00:00:756 - AT&C1 0:00:00:857 - 0:00:00:897 - OK 0:00:00:897 - AT&D0 0:00:00:998 - 0:00:01:038 - OK 0:00:01:038 - AT+UCGED=2 0:00:01:140 - 0:00:01:179 - OK 0:00:01:179 - AT&K3 0:00:01:280 - 0:00:01:320 - OK 0:00:01:320 - AT+UPSV=0 0:00:01:421 - 0:00:01:461 - OK 0:00:01:461 - AT+UPSMR=1 0:00:01:563 - 0:00:01:602 - OK 0:00:01:602 - AT+CPSMS? 0:00:01:703 - 0:00:01:743 - +CPSMS:0,,,"01100000","00000000" 0:00:01:744 - 0:00:01:744 - OK 0:00:01:745 - AT+CEDRXS? 0:00:01:847 - 0:00:01:886 - +CEDRXS: 0:00:01:887 - 0:00:01:887 - OK 0:00:01:887 - AT+UMNOPROF? 0:00:01:989 - 0:00:02:028 - +UMNOPROF: 90 0:00:02:029 - 0:00:02:029 - OK 0:00:02:029 - AT+UGPRF? 0:00:02:130 - 0:00:02:170 - +UGPRF: 2,0,"" 0:00:02:171 - 0:00:02:171 - 0:00:02:171 - 0:00:02:171 - OK 0:00:02:171 - Opened device with return code 0. 0:00:02:172 - Bringing up the network... 0:00:02:172 - U_CELL_NET: preparing to register/connect... 0:00:02:172 - AT+CREG=2 0:00:02:274 - 0:00:02:313 - OK 0:00:02:313 - AT+CGREG=2 0:00:02:415 - 0:00:02:454 - OK 0:00:02:454 - AT+CEREG=4 0:00:02:556 - 0:00:02:595 - OK 0:00:02:595 - AT+CIMI 0:00:02:696 - 0:00:02:736 - 206010311019587 0:00:02:737 - 0:00:02:737 - OK 0:00:02:737 - AT+CIMI 0:00:02:838 - 0:00:02:878 - 206010311019587 0:00:02:879 - 0:00:02:879 - OK 0:00:02:879 - U_CELL_NET: APN from database is "internet". 0:00:02:880 - AT+CGDCONT=1,"IP","internet" 0:00:02:983 - 0:00:03:023 - OK 0:00:03:023 - U_CELL_NET: setting automatic network selection mode... 0:00:03:024 - AT+COPS? 0:00:03:124 - 0:00:03:164 - +COPS: 0,0,"JIM",7 0:00:03:165 - 0:00:03:165 - OK 0:00:03:165 - AT+CFUN=1 0:00:03:266 - 0:00:03:306 - OK 0:00:03:306 - AT+CREG? 0:00:03:407 - 0:00:03:447 - +CREG: 2,1,"0C3D","02BF6B05",7 0:00:03:448 - 0:00:03:448 - OK 0:00:03:449 - 7: RegH 0:00:03:449 - AT+CGREG? 0:00:03:751 - 0:00:03:790 - +CGREG: 2,4 0:00:03:791 - 0:00:03:791 - OK 0:00:03:791 - 7: OoC 0:00:03:791 - AT+CEREG? 0:00:04:093 - 0:00:04:132 - +CEREG: 4,1,"C3D","2BF6B05",7,,,, 0:00:04:133 - 0:00:04:134 - OK 0:00:04:134 - 7: RegH 0:00:04:134 - AT+COPS=3,0 0:00:04:436 - 0:00:04:475 - OK 0:00:04:475 - AT+COPS? 0:00:04:576 - 0:00:04:616 - +COPS: 0,0,"JIM",7 0:00:04:617 - 0:00:04:617 - OK 0:00:04:617 - AT+CGATT? 0:00:04:718 - 0:00:04:758 - +CGATT: 1 0:00:04:759 - 0:00:04:759 - OK 0:00:04:759 - AT+CGACT? 0:00:04:860 - 0:00:04:900 - +CGACT: 1,1 0:00:04:901 - 0:00:04:901 - OK 0:00:04:901 - AT+UPSD=0,0,0 0:00:05:003 - 0:00:05:043 - OK 0:00:05:043 - AT+UPSD=0,100,1 0:00:05:146 - 0:00:05:185 - OK 0:00:05:185 - U_CELL_NET: connected after 2 second(s). 0:00:05:186 - Looking up server address... 0:00:05:186 - U_CELL_SOCK: looking up IP address of "ubxlib.com". 0:00:05:186 - AT+CGDCONT? 0:00:05:688 - 0:00:05:727 - +CGDCONT: 1,"IP","web.be","100.71.242.161",0,0,0 0:00:05:729 - 0:00:05:729 - OK 0:00:05:729 - AT+UDNSRN=0,"ubxlib.com" 0:00:05:833 - 0:00:07:422 - +CME ERROR: Operation not allowed 0:00:07:423 - 0:00:07:424 - AT+USOER 0:00:07:536 - 0:00:07:576 - +USOER: 0 0:00:07:577 - 0:00:07:577 - OK 0:00:07:577 - U_CELL_SOCK: host not found. 0:00:08:577 - Address is: unknown type (24)
I also ran into this https://portal.u-blox.com/s/question/0D52p0000CK1OiACQV/cant-connect-as-http-client-with-ublox-sara-r422m8s-evaluation-board-quick-start-evkr4-series?t=1699446228430 - Briefly toggling CGACT on off seemed to fix it, but now I am running into this issue again I think.
I could reproduce this as many times as I wanted - the modules says all is fine, but I cannot execute resolving/http commands.
If I allowed the AT#CFUN=4 to complete, the output is now completely different:
0:00:00:003 - APP-BOOT 0:00:00:003 - BOOTLOADER_RESET_REASON_RESET_PIN 0:00:00:003 - Boot 1 0:00:00:004 - GOT TIME: 2023/10/28 4:0:55 0:00:00:004 - Cold boot (or WDT)! 0:00:00:004 - Cold boot already had time. Assuming IWDG or debugger. Restarting 0:00:00:094 - 00:00:004 - APP-BOOT 0:00:00:004 - BOOTLOADER_RESET_REASON_WAKEUP_FROM_STANDBY 0:00:00:004 - SENSORMOD_WAKEUPSOURCE_RTC 0:00:00:004 - Boot 1 0:00:00:004 - GOT TIME: 2023/10/28 4:0:55 0:00:00:005 - ADC: 908 0:00:00:006 - Gravity-x : 0.11, Gravity-y : -0.21, Gravity-z : 9.88 0:00:00:007 - Magnetic field [mG]:133.50 192.00 -414.00 0:00:00:007 - Temperature [degC]: 21.62 0:00:00:008 - Accelero orientation change 0:00:00:008 - Magneto orientation change 0:00:00:008 - ADC threshold state crossing 0:00:00:008 - Valid trigger during measurement: Reason: 3. Logging candidate measurement to flash 0:00:00:008 - Currently stored pulses: 0 0:00:00:009 - Starting CLOUD MODE 0:00:00:009 - Configuring DMA channelsStarting cloud module 0:00:00:048 - U_CELL: initialising with enable power pin not connected, PWR_ON pin 42 (0x2a) (and is toggled from 1 to 0) and VInt pin not connected. 0:00:00:054 - AT 0:00:00:154 - 0:00:00:194 - OK 0:00:00:194 - U_CELL_PWR: powering on, module is already on. 0:00:00:194 - ATE0 0:00:00:294 - 0:00:00:334 - OK 0:00:00:334 - AT+CMEE=2 0:00:00:435 - 0:00:00:475 - OK 0:00:00:475 - AT+UDCONF=1,0 0:00:00:576 - 0:00:00:616 - OK 0:00:00:616 - ATI9 0:00:00:716 - 0:00:00:756 - 01.24,A01.10 0:00:00:756 - 0:00:00:756 - OK 0:00:00:757 - AT&C1 0:00:00:858 - 0:00:00:898 - OK 0:00:00:898 - AT&D0 0:00:00:999 - 0:00:01:039 - OK 0:00:01:039 - AT+UCGED=2 0:00:01:140 - 0:00:01:180 - OK 0:00:01:180 - AT&K3 0:00:01:281 - 0:00:01:321 - OK 0:00:01:321 - AT+UPSV=0 0:00:01:422 - 0:00:01:462 - OK 0:00:01:462 - AT+UPSMR=1 0:00:01:563 - 0:00:01:603 - OK 0:00:01:603 - AT+CPSMS? 0:00:01:704 - 0:00:01:744 - +CPSMS:0,,,"01100000","00000000" 0:00:01:745 - 0:00:01:745 - OK 0:00:01:745 - AT+CEDRXS? 0:00:01:847 - 0:00:01:887 - +CEDRXS: 0:00:01:887 - 0:00:01:887 - OK 0:00:01:888 - AT+UMNOPROF? 0:00:01:989 - 0:00:02:029 - +UMNOPROF: 90 0:00:02:029 - 0:00:02:029 - OK 0:00:02:030 - AT+UGPRF? 0:00:02:131 - 0:00:02:171 - +UGPRF: 2,0,"" 0:00:02:171 - 0:00:02:171 - 0:00:02:172 - 0:00:02:172 - OK 0:00:02:172 - AT+CFUN=4 0:00:02:273 - 0:00:02:313 - OK 0:00:02:313 - Opened device with return code 0. 0:00:02:313 - Bringing up the network... 0:00:02:313 - U_CELL_NET: preparing to register/connect... 0:00:02:314 - AT+CREG=2 0:00:02:415 - 0:00:02:455 - OK 0:00:02:455 - AT+CGREG=2 0:00:02:556 - 0:00:02:596 - OK 0:00:02:596 - AT+CEREG=4 0:00:02:697 - 0:00:02:737 - OK 0:00:02:737 - AT+CIMI 0:00:02:838 - 0:00:02:878 - 206010311019587 0:00:02:878 - 0:00:02:879 - OK 0:00:02:879 - AT+CIMI 0:00:02:980 - 0:00:03:020 - 206010311019587 0:00:03:020 - 0:00:03:021 - OK 0:00:03:021 - U_CELL_NET: APN from database is "internet". 0:00:03:021 - AT+CGDCONT=1,"IP","internet" 0:00:03:125 - 0:00:03:165 - OK 0:00:03:165 - U_CELL_NET: setting automatic network selection mode... 0:00:03:165 - AT+COPS? 0:00:03:266 - 0:00:03:306 - +COPS: 0 0:00:03:306 - 0:00:03:306 - OK 0:00:03:307 - AT+CFUN=1 0:00:04:308 - 0:00:04:348 - OK 0:00:04:348 - AT+CREG? 0:00:04:449 - 0:00:04:489 - +CREG: 2,0 0:00:04:489 - 0:00:04:489 - OK 0:00:04:490 - 0: NReg 0:00:04:490 - AT+CGREG? 0:00:04:791 - 0:00:04:831 - +CGREG: 2,4 0:00:04:831 - 0:00:04:831 - OK 0:00:04:832 - 0: OoC 0:00:04:832 - AT+CEREG? 0:00:05:133 - 0:00:05:173 - +CEREG: 4,0 0:00:05:173 - 0:00:05:173 - OK 0:00:05:174 - 0: NReg 0:00:05:174 - 0:00:05:246 - +CREG: 2 0:00:05:246 - 0:00:05:246 - +CGREG: 2 0:00:05:247 - -1: Search 0:00:05:247 - -1: Search 0:00:05:247 - 0:00:05:267 - +CEREG: 2,,,,,,,, 0:00:05:267 - -1: Search 0:00:05:268 - AT+CREG? 0:00:05:475 - 0:00:05:515 - +CREG: 2,2 0:00:05:515 - 0:00:05:515 - OK 0:00:05:516 - 0: Search 0:00:05:516 - AT+CGREG? 0:00:05:817 - 0:00:05:857 - +CGREG: 2,4 0:00:05:857 - 0:00:05:857 - OK 0:00:05:858 - 0: OoC 0:00:05:858 - AT+CEREG? 0:00:06:159 - 0:00:06:199 - +CEREG: 4,2 0:00:06:199 - 0:00:06:199 - OK 0:00:06:200 - 0: Search 0:00:06:200 - AT+CREG? 0:00:06:501 - 0:00:06:541 - +CREG: 2,2 0:00:06:541 - 0:00:06:541 - OK 0:00:06:542 - 0: Search 0:00:06:542 - AT+CGREG? 0:00:06:843 - 0:00:06:883 - +CGREG: 2,4 0:00:06:883 - 0:00:06:883 - OK 0:00:06:884 - 0: OoC 0:00:06:884 - AT+CEREG? 0:00:07:185 - 0:00:07:225 - +CEREG: 4,2 0:00:07:225 - 0:00:07:225 - OK 0:00:07:226 - 0: Search 0:00:07:226 - AT+CREG? 0:00:07:527 - 0:00:07:567 - +CREG: 2,2 0:00:07:567 - 0:00:07:567 - OK 0:00:07:568 - 0: Search 0:00:07:568 - AT+CGREG? 0:00:07:869 - 0:00:07:909 - +CGREG: 2,4 0:00:07:909 - 0:00:07:909 - OK 0:00:07:910 - 0: OoC 0:00:07:910 - AT+CEREG? 0:00:08:211 - 0:00:08:251 - +CEREG: 4,2 0:00:08:251 - 0:00:08:251 - OK 0:00:08:252 - 0: Search 0:00:08:252 - AT+CREG? 0:00:08:553 - 0:00:08:593 - +CREG: 2,2 0:00:08:593 - 0:00:08:593 - OK 0:00:08:594 - 0: Search 0:00:08:594 - AT+CGREG? 0:00:08:895 - 0:00:08:935 - +CGREG: 2,4 0:00:08:935 - 0:00:08:935 - OK 0:00:08:936 - 0: OoC 0:00:08:936 - AT+CEREG? 0:00:09:237 - 0:00:09:277 - +CEREG: 4,2 0:00:09:277 - 0:00:09:277 - OK 0:00:09:278 - 0: Search 0:00:09:278 - AT+CREG? 0:00:09:579 - 0:00:09:619 - +CREG: 2,2 0:00:09:619 - 0:00:09:619 - OK 0:00:09:620 - 0: Search 0:00:09:620 - AT+CGREG? 0:00:09:921 - 0:00:09:961 - +CGREG: 2,4 0:00:09:961 - ...
0:01:00:972 - OK 0:01:00:973 - 0: Search 0:01:00:973 - AT+CGREG? 0:01:01:274 - 0:01:01:314 - +CGREG: 2,4 0:01:01:314 - 0:01:01:314 - OK 0:01:01:315 - 0:01:01:315 - +CREG: 1,"0BBB","000042BC",3 0:01:01:316 - 0:01:01:316 - 0:01:01:316 - 0: OoC 0:01:01:316 - 3: RegH 0:01:01:318 - AT+CEREG? 0:01:01:619 - 0:01:01:659 - +CEREG: 4,4 0:01:01:659 - 0:01:01:659 - OK 0:01:01:660 - 0: OoC 0:01:01:660 - AT+CREG? 0:01:01:961 - 0:01:02:001 - +CREG: 2,1,"0BBB","000042BC",3 0:01:02:002 - 0:01:02:002 - OK 0:01:02:002 - 3: RegH 0:01:02:003 - AT+CGREG? 0:01:02:304 - 0:01:02:344 - +CGREG: 2,2 0:01:02:344 - 0:01:02:344 - OK 0:01:02:345 - 3: Search 0:01:02:345 - AT+CEREG? 0:01:02:646 - 0:01:02:686 - +CEREG: 4,4 0:01:02:686 - 0:01:02:686 - OK 0:01:02:687 - 0:01:02:687 - +CGREG: 1,"0BBB","000042BC",3,"87" 0:01:02:688 - 3: OoC 0:01:02:688 - 3: RegH 0:01:02:690 - AT+COPS=3,0 0:01:02:991 - 0:01:03:031 - OK 0:01:03:031 - AT+COPS? 0:01:03:132 - 0:01:03:172 - +COPS: 0,0,"JIM",3 0:01:03:172 - 0:01:03:173 - OK 0:01:03:173 - AT+CGATT? 0:01:03:274 - 0:01:03:314 - +CGATT: 1 0:01:03:314 - 0:01:03:314 - OK 0:01:03:315 - AT+CGACT? 0:01:03:416 - 0:01:03:456 - +CGACT: 1,0 0:01:03:456 - 0:01:03:456 - OK 0:01:03:457 - AT+CGACT=1,1 0:01:05:459 - 0:01:06:339 - +CME ERROR: requested service option not subscribed 0:01:06:340 - U_CELL_NET: unable to activate a PDP context, is APN "internet" correct? 0:01:06:341 - AT+CFUN=4 0:01:06:442 - 0:01:08:592 - OK 0:01:08:592 - 0:01:08:592 - +CREG: 0 0:01:08:593 - 0:01:08:593 - +CGREG: 0 0:01:08:593 - U_CELL_NET: connection attempt stopped after 65 second(s). 0:01:08:595 - -1: NReg 0:01:08:595 - -1: NReg 0:01:08:595 - Unable to bring up the network! 0:01:08:596 - Done.
This was due to the wrong APN being configured in my socket example => When fixing that, resolving worked again:
0:00:00:054 - AT 0:00:00:154 - 0:00:00:194 - OK 0:00:00:194 - U_CELL_PWR: powering on, module is already on. 0:00:00:194 - ATE0 0:00:00:295 - 0:00:00:334 - OK 0:00:00:334 - AT+CMEE=2 0:00:00:435 - 0:00:00:475 - OK 0:00:00:475 - AT+UDCONF=1,0 0:00:00:577 - 0:00:00:616 - OK 0:00:00:616 - ATI9 0:00:00:717 - 0:00:00:756 - 01.24,A01.10 0:00:00:756 - 0:00:00:757 - OK 0:00:00:757 - AT&C1 0:00:00:858 - 0:00:00:898 - OK 0:00:00:898 - AT&D0 0:00:00:999 - 0:00:01:039 - OK 0:00:01:039 - AT+UCGED=2 0:00:01:140 - 0:00:01:180 - OK 0:00:01:180 - AT&K3 0:00:01:281 - 0:00:01:321 - OK 0:00:01:321 - AT+UPSV=0 0:00:01:422 - 0:00:01:462 - OK 0:00:01:462 - AT+UPSMR=1 0:00:01:563 - 0:00:01:603 - OK 0:00:01:603 - AT+CPSMS? 0:00:01:704 - 0:00:01:744 - +CPSMS:0,"01100000","00000000",,"00000000" 0:00:01:745 - 0:00:01:745 - OK 0:00:01:746 - AT+CEDRXS? 0:00:01:847 - 0:00:01:887 - +CEDRXS: 0:00:01:887 - 0:00:01:887 - OK 0:00:01:888 - AT+UMNOPROF? 0:00:01:989 - 0:00:02:029 - +UMNOPROF: 90 0:00:02:029 - 0:00:02:030 - OK 0:00:02:030 - AT+UGPRF? 0:00:02:131 - 0:00:02:171 - +UGPRF: 2,0,"" 0:00:02:171 - 0:00:02:172 - 0:00:02:172 - 0:00:02:172 - OK 0:00:02:172 - AT+CFUN=4 0:00:02:273 - 0:00:02:313 - OK 0:00:02:313 - Opened device with return code 0. 0:00:02:313 - Bringing up the network... 0:00:02:314 - U_CELL_NET: preparing to register/connect... 0:00:02:314 - AT+CREG=2 0:00:02:415 - 0:00:02:455 - OK 0:00:02:455 - AT+CGREG=2 0:00:02:556 - 0:00:02:596 - OK 0:00:02:596 - AT+CEREG=4 0:00:02:697 - 0:00:02:737 - OK 0:00:02:737 - AT+CIMI 0:00:02:838 - 0:00:02:878 - 206010311019587 0:00:02:878 - 0:00:02:879 - OK 0:00:02:879 - U_CELL_NET: user-specified APN is "web.be". 0:00:02:879 - AT+CGDCONT=1,"IP","web.be" 0:00:02:983 - 0:00:03:033 - OK 0:00:03:033 - U_CELL_NET: setting automatic network selection mode... 0:00:03:033 - AT+COPS? 0:00:03:134 - 0:00:03:174 - +COPS: 0 0:00:03:174 - 0:00:03:174 - OK 0:00:03:175 - AT+CFUN=1 0:00:04:176 - 0:00:04:216 - OK 0:00:04:216 - AT+CREG? 0:00:04:317 - 0:00:04:357 - +CREG: 2,0 0:00:04:357 - 0:00:04:358 - OK 0:00:04:358 - 0: NReg 0:00:04:358 - AT+CGREG? 0:00:04:659 - 0:00:04:699 - +CGREG: 2,0 0:00:04:699 - 0:00:04:700 - OK 0:00:04:700 - 0: NReg 0:00:04:700 - AT+CEREG? 0:00:05:001 - 0:00:05:041 - +CEREG: 4,4 0:00:05:041 - 0:00:05:042 - OK 0:00:05:042 - 0: OoC 0:00:05:042 - AT+CREG? 0:00:05:343 - 0:00:05:383 - +CREG: 2,0 0:00:05:383 - 0:00:05:384 - OK 0:00:05:384 - 0: NReg 0:00:05:384 - AT+CGREG? 0:00:05:685 - 0:00:05:725 - +CGREG: 2,0 0:00:05:725 - 0:00:05:726 - OK 0:00:05:726 - 0: NReg 0:00:05:726 - AT+CEREG? 0:00:06:027 - 0:00:06:067 - +CEREG: 4,4 0:00:06:067 - 0:00:06:068 - OK 0:00:06:068 - 0: OoC 0:00:06:068 - AT+CREG? 0:00:06:369 - 0:00:06:409 - +CREG: 2 0:00:06:409 - 0:00:06:409 - +CGREG: 2 0:00:06:410 - 0:00:06:410 - +CREG: 2,2 0:00:06:411 - 0:00:06:411 - OK 0:00:06:411 - 0:00:06:421 - +CREG: 1,"0BBB","000042BC",3 0:00:06:422 - 0:00:06:422 - 0:00:06:422 - -1: Search 0:00:06:422 - 0: Search 0:00:06:423 - 3: RegH 0:00:06:425 - AT+CGREG? 0:00:06:726 - 0:00:06:766 - +CGREG: 2,2 0:00:06:766 - 0:00:06:767 - OK 0:00:06:767 - 0: Search 0:00:06:767 - AT+CEREG? 0:00:07:068 - 0:00:07:108 - +CEREG: 4,4 0:00:07:108 - 0:00:07:109 - OK 0:00:07:109 - 0: OoC 0:00:07:109 - AT+CREG? 0:00:07:410 - 0:00:07:450 - +CREG: 2,1,"0BBB","000042BC",3 0:00:07:451 - 0:00:07:451 - OK 0:00:07:451 - 3: RegH 0:00:07:452 - AT+CGREG? 0:00:07:753 - 0:00:07:793 - +CGREG: 2,2 0:00:07:793 - 0:00:07:794 - OK 0:00:07:794 - 3: Search 0:00:07:794 - AT+CEREG? 0:00:08:095 - 0:00:08:135 - +CEREG: 4,4 0:00:08:135 - 0:00:08:136 - OK 0:00:08:136 - 3: OoC 0:00:08:136 - AT+CREG? 0:00:08:437 - 0:00:08:477 - +CREG: 2,1,"0BBB","000042BC",3 0:00:08:478 - 0:00:08:478 - OK 0:00:08:478 - 3: RegH 0:00:08:479 - AT+CGREG? 0:00:08:780 - 0:00:08:820 - +CGREG: 2,2 0:00:08:820 - 0:00:08:821 - OK 0:00:08:821 - 3: Search 0:00:08:821 - AT+CEREG? 0:00:09:122 - 0:00:09:162 - +CEREG: 4,4 0:00:09:162 - 0:00:09:163 - OK 0:00:09:163 - 3: OoC 0:00:09:163 - AT+CREG? 0:00:09:464 - 0:00:09:504 - +CREG: 2,1,"0BBB","000042BC",3 0:00:09:505 - 0:00:09:505 - OK 0:00:09:505 - 3: RegH 0:00:09:506 - AT+CGREG? 0:00:09:807 - 0:00:09:847 - +CGREG: 2,2 0:00:09:847 - 0:00:09:848 - OK 0:00:09:848 - 3: Search 0:00:09:848 - 0:00:10:081 - +CGREG: 1,"0BBB","000042BC",3,"87" 0:00:10:082 - 3: RegH 0:00:10:082 - AT+COPS=3,0 0:00:10:194 - 0:00:10:233 - OK 0:00:10:233 - AT+COPS? 0:00:10:334 - 0:00:10:374 - +COPS: 0,0,"JIM",3 0:00:10:375 - 0:00:10:375 - OK 0:00:10:375 - AT+CGATT? 0:00:10:476 - 0:00:10:516 - +CGATT: 1 0:00:10:516 - 0:00:10:516 - OK 0:00:10:517 - AT+CGACT? 0:00:10:618 - 0:00:10:658 - +CGACT: 1,0 0:00:10:658 - 0:00:10:659 - OK 0:00:10:659 - AT+CGACT=1,1 0:00:12:661 - 0:00:13:551 - OK 0:00:13:551 - AT+CGACT? 0:00:13:652 - 0:00:13:692 - +CGACT: 1,1 0:00:13:692 - 0:00:13:693 - OK 0:00:13:693 - AT+UPSD=0,0,0 0:00:13:795 - 0:00:13:835 - OK 0:00:13:835 - AT+UPSD=0,100,1 0:00:13:937 - 0:00:13:977 - OK 0:00:13:977 - U_CELL_NET: connected after 11 second(s). 0:00:13:977 - Looking up server address... 0:00:13:978 - U_CELL_SOCK: looking up IP address of "ubxlib.com". 0:00:13:978 - AT+CGDCONT? 0:00:14:479 - 0:00:14:519 - +CGDCONT: 1,"IP","web.be","100.71.33.56",0,0,0 0:00:14:520 - 0:00:14:521 - OK 0:00:14:521 - AT+UDNSRN=0,"ubxlib.com" 0:00:14:624 - 0:00:14:954 - +UDNSRN: "18.133.144.142" 0:00:15:104 - 0:00:15:105 - OK 0:00:15:105 - U_CELL_SOCK: found it at "18.133.144.142". 0:00:15:105 - Address is: IPV4 18.133.144.142
But so long story short - cutting corners to skip AT#CFUN=4 gave me lots of issues. I'm keeping it in:)
Ah, yes, I do recall there being issues with one or other SARA-R4 version with the need to do the step-by-step process, you can see that I invoked @philwareublox in a comment:
This step shouldn't be necessary. However, for reasons I don't understand, SARA-R4 can be registered but not attached (i.e.
AT+CGATT
returns 0) on both RATs (unh?). Phil Ware, who knows about these things, always goes through (a) register, (b) wait forAT+CGATT
to return 1 and then (c) check that a context is active withAT+CGACT
or usingAT+UPSD
(even for EUTRAN). Since this sequence works for both RANs, it is best to be consistent.
Generally speaking, though, it should be ubxlib
's aim to accommodate the kind of performance tuning you need in your final application, preferably without you having to modify the code, so please do raise these things as you reach them.
By the way, even with the correct APN AND AT+CFUN=4 I am now getting that issue: :(
Not sure what I am supposed to do with this? I am not sure what is the cause, but in any case, the "ubxlib should absract all quirks away" mentality does not hold in this case.
(fyi the output, which remains the same if I reboot the module)
0:00:00:193 - U_CELL_PWR: powering on, module is already on. 0:00:00:193 - ATE0 0:00:00:293 - 0:00:00:333 - OK 0:00:00:333 - AT+CMEE=2 0:00:00:434 - 0:00:00:474 - OK 0:00:00:474 - AT+UDCONF=1,0 0:00:00:575 - 0:00:00:615 - OK 0:00:00:615 - ATI9 0:00:00:715 - 0:00:00:755 - 01.24,A01.10 0:00:00:755 - 0:00:00:755 - OK 0:00:00:755 - AT&C1 0:00:00:856 - 0:00:00:897 - OK 0:00:00:897 - AT&D0 0:00:00:997 - 0:00:01:038 - OK 0:00:01:038 - AT+UCGED=2 0:00:01:139 - 0:00:01:179 - OK 0:00:01:179 - AT&K3 0:00:01:279 - 0:00:01:320 - OK 0:00:01:320 - AT+UPSV=0 0:00:01:421 - 0:00:01:461 - OK 0:00:01:461 - AT+UPSMR=1 0:00:01:562 - 0:00:01:602 - OK 0:00:01:602 - AT+CPSMS? 0:00:01:703 - 0:00:01:743 - +CPSMS:0,,,"01100000","00000000" 0:00:01:744 - 0:00:01:744 - OK 0:00:01:744 - AT+CEDRXS? 0:00:01:846 - 0:00:01:886 - +CEDRXS: 0:00:01:886 - 0:00:01:886 - OK 0:00:01:886 - AT+UMNOPROF? 0:00:01:988 - 0:00:02:028 - +UMNOPROF: 90 0:00:02:028 - 0:00:02:028 - OK 0:00:02:028 - AT+UGPRF? 0:00:02:130 - 0:00:02:170 - +UGPRF: 2,0,"" 0:00:02:170 - 0:00:02:170 - 0:00:02:170 - 0:00:02:171 - OK 0:00:02:171 - AT+CFUN=4 0:00:02:272 - 0:00:02:602 - OK 0:00:02:602 - DEVICE UPAT+CMUX=0,0,,128 0:00:02:705 - 0:00:02:925 - OK 0:00:02:925 - ATE0 0:00:03:558 - 0:00:03:598 - OK 0:00:03:598 - AT+CMEE=2 0:00:03:701 - 0:00:03:741 - OK 0:00:03:741 - U_GNSS: initialising with ENABLE_POWER pin not connected, transport type Virtual Serial. 0:00:03:753 - ATI 0:00:03:844 - 0:00:03:884 - SARA-R422M10S-01B-01 0:00:03:884 - 0:00:03:884 - OK 0:00:03:885 - AT+UGIND=0 0:00:03:988 - 0:00:04:028 - 0:00:04:028 - 0:00:04:028 - OK 0:00:04:028 - AT+UGPS? 0:00:04:130 - 0:00:04:170 - +UGPS: 0 0:00:04:170 - 0:00:04:170 - 0:00:04:170 - 0:00:04:170 - OK 0:00:04:171 - AT+UGPS=1,15,127 0:00:04:677 - 0:00:05:877 - 0:00:05:877 - 0:00:05:877 - OK 0:00:05:877 - GNSS UPU_CELL_NET: preparing to register/connect... 0:00:05:877 - AT+CREG=2 0:00:05:981 - 0:00:06:021 - OK 0:00:06:021 - AT+CGREG=2 0:00:06:124 - 0:00:06:164 - OK 0:00:06:164 - AT+CEREG=4 0:00:06:267 - 0:00:06:307 - OK 0:00:06:307 - AT+CIMI 0:00:06:409 - 0:00:06:449 - 206010311019587 0:00:06:449 - 0:00:06:449 - OK 0:00:06:450 - U_CELL_NET: user-specified APN is "web.be". 0:00:06:450 - AT+CGDCONT=1,"IP","web.be" 0:00:06:560 - 0:00:06:600 - OK 0:00:06:600 - U_CELL_NET: setting automatic network selection mode... 0:00:06:600 - AT+COPS? 0:00:06:702 - 0:00:06:742 - +COPS: 0 0:00:06:742 - 0:00:06:742 - OK 0:00:06:742 - AT+CFUN=1 0:00:06:845 - 0:00:06:895 - OK 0:00:06:895 - AT+CREG? 0:00:06:997 - 0:00:07:037 - +CREG: 2,0 0:00:07:037 - 0:00:07:037 - OK 0:00:07:037 - 0: NReg 0:00:07:038 - AT+CGREG? 0:00:07:340 - 0:00:07:380 - +CGREG: 2,4 0:00:07:380 - 0:00:07:380 - OK 0:00:07:380 - 0: OoC 0:00:07:381 - AT+CEREG? 0:00:07:683 - 0:00:07:723 - +CEREG: 4,0 0:00:07:723 - 0:00:07:723 - OK 0:00:07:723 - 0: NReg 0:00:07:724 - 0:00:07:772 - +CREG: 2 0:00:07:772 - 0:00:07:772 - +CGREG: 2 0:00:07:773 - 0:00:07:773 - +CEREG: 2,,,,,,,, 0:00:07:773 - -1: Search 0:00:07:774 - -1: Search 0:00:07:774 - -1: Search 0:00:07:774 - AT+CREG? 0:00:08:026 - 0:00:08:066 - +CREG: 2,2 0:00:08:066 - 0:00:08:066 - OK 0:00:08:066 - 0: Search 0:00:08:067 - AT+CGREG? 0:00:08:369 - 0:00:08:409 - +CGREG: 2,4 0:00:08:409 - 0:00:08:409 - OK 0:00:08:409 - 0: OoC 0:00:08:410 - 0:00:08:616 - +CREG: 1,"0C3D","02BF6B05",7 0:00:08:617 - 0:00:08:617 - 0:00:08:617 - 7: RegH 0:00:08:617 - 0:00:08:637 - +CEREG: 1,"C3D","2BF6B05",7,,,, 0:00:08:638 - 7: RegH 0:00:08:638 - AT+COPS=3,0 0:00:08:751 - 0:00:08:791 - OK 0:00:08:791 - AT+COPS? 0:00:08:893 - 0:00:08:933 - +COPS: 0,0,"JIM",7 0:00:08:933 - 0:00:08:933 - OK 0:00:08:934 - AT+CGATT? 0:00:09:036 - 0:00:09:076 - +CGATT: 1 0:00:09:076 - 0:00:09:076 - OK 0:00:09:076 - AT+CGACT? 0:00:09:179 - 0:00:09:219 - +CGACT: 1,1 0:00:09:219 - 0:00:09:219 - OK 0:00:09:219 - AT+UPSD=0,0,0 0:00:09:326 - 0:00:09:366 - OK 0:00:09:366 - AT+UPSD=0,100,1 0:00:09:472 - 0:00:09:512 - OK 0:00:09:512 - U_CELL_NET: connected after 3 second(s). 0:00:09:512 - CELL INTERFACE UPAT+CCLK? 0:00:09:614 - 0:00:09:654 - +CCLK: "23/11/08,17:15:03+04" 0:00:09:655 - 0:00:09:655 - OK 0:00:09:655 - U_CELL_INFO: time is 23/11/08,17:15:03+04. 0:00:09:655 - U_CELL_INFO: local time is 1699463703, timezone offset 3600 seconds, hence UTC time is 1699460103. 0:00:09:656 - UTC timestamp according to cellular is 1699460103. 0:00:09:656 - RTC time updated!AT+USECPRF=0 0:00:09:760 - 0:00:09:800 - OK 0:00:09:800 - AT+USECPRF=0,0,0 0:00:09:906 - 0:00:09:946 - OK 0:00:09:946 - AT+USECPRF=0,10,"offline-live1.services.u-blox.com" 0:00:10:057 - 0:00:10:098 - OK 0:00:10:098 - AT+UHTTP=0 0:00:10:204 - 0:00:10:244 - 0:00:10:244 - 0:00:10:244 - OK 0:00:10:244 - AT+UHTTP=0,1,"offline-live1.services.u-blox.com" 0:00:10:356 - 0:00:10:396 - 0:00:10:396 - 0:00:10:396 - OK 0:00:10:396 - AT+UHTTP=0,4,0 0:00:10:502 - 0:00:10:542 - 0:00:10:542 - 0:00:10:542 - OK 0:00:10:542 - AT+UHTTP=0,7,30 0:00:10:648 - 0:00:10:688 - 0:00:10:688 - 0:00:10:688 - OK 0:00:10:688 - AT+UHTTP=0,6,1,0 0:00:10:795 - 0:00:10:835 - 0:00:10:835 - 0:00:10:835 - OK 0:00:10:835 - AT+UHTTP=0,5,443 0:00:10:941 - 0:00:10:981 - 0:00:10:981 - 0:00:10:981 - OK 0:00:10:981 - HTTP GET request will be "/GetOfflineData.ashx?token=HCJx9y-_RKepara6bQJ3pw;gnss=gps;days=1;resolution=1". 0:00:10:981 - AT+UHTTPC=0,1,"/GetOfflineData.ashx?token=HCJx9y-_RKepara6bQJ3pw;gnss=gps;days=1;resolution=1","ubxlibhttp_0" 0:00:11:103 - 0:00:11:143 - 0:00:11:143 - 0:00:11:143 - OK 0:00:11:143 - 0:00:11:143 - +UUHTTPCR: 0,1,0 0:00:11:144 - AT+UHTTPER=0 0:00:11:259 - 0:00:11:299 - +UHTTPER: 0,10,22 0:00:11:299 - 0:00:11:299 - 0:00:11:300 -
Very strange indeed. As you say, from the error codes in the back of the AT manual, section A.7, the "22" of your +UHTTPER
means "PSD or CSD connection not established" when, from the AT command sequence, it clearly has been established as you have +CEREG: 1,"C3D","2BF6B05",7,,,,
and the two AT+UPSD
have been issued and OK'ed.
Let me see if I can engage the help of our San Diego office, who should be up and about now and who know SARA-R422.
Something to try, just to see what it does, could you modify the function activateContext() so that it sends AT+CGACT
even if 1 has been returned, something like this:
static int32_t activateContext(const uCellPrivateInstance_t *pInstance,
int32_t contextId, int32_t profileId)
{
int32_t errorCode = (int32_t) U_CELL_ERROR_CONTEXT_ACTIVATION_FAILURE;
uAtClientHandle_t atHandle = pInstance->atHandle;
uAtClientDeviceError_t deviceError;
bool activated = false;
bool ours;
deviceError.type = U_AT_CLIENT_DEVICE_ERROR_TYPE_NO_ERROR;
uAtClientLock(atHandle);
for (size_t x = 5; (x > 0) && keepGoingLocalCb(pInstance) &&
(errorCode != 0) &&
((deviceError.type == U_AT_CLIENT_DEVICE_ERROR_TYPE_NO_ERROR) ||
(deviceError.type == U_AT_CLIENT_DEVICE_ERROR_TYPE_ERROR)); x--) {
uAtClientLockExtend(atHandle);
// CODE BLOCK MOVED UP FROM if() STATEMENT BELOW
// Help it on its way.
uAtClientLockExtend(atHandle);
uAtClientCommandStart(atHandle, "AT+CGACT=");
uAtClientWriteInt(atHandle, 1);
uAtClientWriteInt(atHandle, contextId);
uAtClientCommandStopReadResponse(atHandle);
// If we get back ERROR then the module wasn't
// ready, if we get back CMS/CME error then
// likely the network has actively rejected us,
// e.g. due to an invalid APN
uAtClientDeviceErrorGet(atHandle, &deviceError);
// END OF CODE BLOCK MOVED UP FROM if() STATEMENT BELOW
uAtClientTimeoutSet(atHandle,
pInstance->pModule->responseMaxWaitMs);
uAtClientCommandStart(atHandle, "AT+CGACT?");
uAtClientCommandStop(atHandle);
ours = false;
for (size_t y = 0; (y < U_CELL_NET_MAX_NUM_CONTEXTS) &&
!ours; y++) {
uAtClientResponseStart(atHandle, "+CGACT:");
// Check if this is our context ID
if (uAtClientReadInt(atHandle) == contextId) {
ours = true;
// If it is, 1 means activated
activated = (uAtClientReadInt(atHandle) == 1);
}
}
uAtClientResponseStop(atHandle);
// Do NOT unlock the AT client here
if (activated) {
errorCode = uCellPrivateActivateProfileNoAtLock(pInstance, contextId,
profileId, 5, keepGoingLocalCb);
} else {
// THIS IS WHERE THE CODE WAS, JUST LEAVE THE DELAY HERE
uPortTaskBlock(2000);
}
}
uAtClientUnlock(atHandle);
return errorCode;
}
Another thing to try: before doing your HTTP stuff, could you call [uCellNetGetIpAddressStr()](https://github.com/u-blox/ubxlib/blob/99b6f24580192d36ae75ae0c2e3390678915f32e/cell/api/u_cell_net.h#L759())? Our man in San Diego is wondering if you might have been given an IPV6 address only, which is not something we[I] have seen before and may require different handling.
Hi Rob,
Left the module off for the night, and tested again this morning. Same thing. httpnotworking.txt ipaddr.txt
Then I tried to get the IP address before and after calling uNetworkInterfaceUp. The first time it failed (which is normal), the second time it just gave a nice IPv4 address:
0:00:18:894 - U_CELL_NET: IP address "100.64.145.89".
Regarding your other post, I was indeed thinking of trying to send some AT+CGACT commands to stop and restart the PSD, but that's not so simple with the existing API's. uCellNetDeactivate
and friends check if the network is registered, but they don't actually check this through AT commands, but read out a cached variable in uCellPrivateIsRegistered
which is never filled in. So even though the module -is- registered, the API's dont support deregistering unless you first explicitly try to register.
Anyway, will try you redit and come back to you!
Darn. One straw down.
a cached variable in uCellPrivateIsRegistered which is never filled in
That variable is updated in the URC handler for the registration status, so that it always reflects the true registration status as seen by the module (i.e. when something like +CEREG: blah
appears), rather than the one we think it might have, IYSWIM.
Hi,
So, the code change in activateContext did fix it. The next attempt, I got a clear "delay" when doing the HTTP command, and I am (sometimes) getting the correct data in.
There is still an issue with the HTTP parsing, which I think I figured out what it relates to (I'll make another ticket about that in a minute, to avoid spawning a 3rd issue in this thread :), but indeed, your code change with the AT+CGACT clearly fixed the "HTTP 22 error". => So that's good news!
.. 0:00:08:749 - 0:00:08:789 - 0:00:08:789 - 0:00:08:789 - OK 0:00:08:789 - HTTP GET request will be "/GetOfflineData.ashx?token=HCJx9y-_RKepara6bQJ3pw;gnss=gps;days=1;resolution=1". 0:00:08:789 - AT+UHTTPC=0,1,"/GetOfflineData.ashx?token=HCJx9y-_RKepara6bQJ3pw;gnss=gps;days=1;resolution=1","ubxlibhttp_0" 0:00:08:904 - 0:00:08:944 - 0:00:08:944 - 0:00:08:944 - OK 0:00:08:944 - 0:00:10:402 - +UUHTTPCR: 0,1,1 0:00:10:402 - HTTP GET response received, 2604 byte(s). 0:00:12:243 - AT+CCLK? 0:00:12:345 - 0:00:12:385 - +CCLK: "23/11/09,10:19:15+04" 0:00:12:386 - 0:00:12:386 - OK 0:00:12:386 - U_CELL_INFO: time is 23/11/09,10:19:15+04. 0:00:12:387 - U_CELL_INFO: local time is 1699525155, timezone offset 3600 seconds, hence UTC time is 1699521555. 0:00:12:388 - UTC timestamp according to cellular is 1699521555. 0:00:12:388 - Unable to download to the GNSS device (-5)! 0:00:12:388 - AT+ULSTFILE=0 0:00:12:490 - 0:00:12:660 - 0:00:12:660 - +ULSTFILE: "ubxlibhttp_0" 0:00:12:661 - 0:00:12:661 - OK 0:00:12:662 - AT+UDELFILE="ubxlibhttp_0" 0:00:12:765 - 0:00:12:765 - 0:00:12:805 - OK ...
the code change in
activateContext()
did fix it.
Fascinating: this code has been actively used on SARA-R422 for years, very difficult to understand why you should have a problem with it; maybe others have but have not reported it and fixed it themselves?
I suggested the change because we had determined that our Thingstream guys take the "blind AT+CGACT=" approach in their driver, but obviously it should not be necessary. That said, I can't see a way it could do any harm (ignoring the fact that I also can't see why it is necessary), so I will test the change here and if all is OK will push it here
Commit cba2456bf025d18b2dd0af763fe21e1164ae0310 has the SARA-R422-force-CGACT code in it: in the end it had to be done just for SARA-R422 'cos SARA-R412M-02B/SARA-R410M-02B objected to the change. Gonna close this one, please-reopen or start a new one if there is more to do on this.
Hi,
For the usecase I am considering using ubxlib for, my embedded device would wake up the modem and want to send data to the cloud asap. Normally I think, when the (SARA-R4 in my case) device boots, it can automatically try to reassociate. When using ubxlib though, when calling
uDeviceOpen
, at some point it callsuCellPwrPrivateOn
, which then callsmoduleConfigure
. In moduleConfigure, the argument andRadioOff is checked to see if the code should first unpower the radio or not. It -always- does this, since the caller function fills this in by!uCellPrivateIsRegistered(pInstance)
. This function just checks a flag, that is never filled in when first calling the code, and I don't see a way for the lib to just poll the device to check if it is first registered or not.The result is that upon boot, the library -always- sends AT#CFUN=4, then needs to reenable the radio and then needs to reregister. This loses some precious time (and battery power), which I'd like to avoid.
Is my conclusion correct here? And what would be the recommended way to use ubxlib to get actual (e.g. socket API's) up asap?
Thanks for your feedback!