u-blox plugin, questions while implementing support for TOBY-L210

Aleksander Morgado aleksander at aleksander.es
Fri Oct 29 07:43:55 UTC 2021


Hey!

> I am using ModemManager with u-blox TOBY-L210 for a while now with older versions of ModemManager (1.7.x). I did some patches and home-brew code to make that combination work.
> I now want to switch to newer versions of MM (1.18), benefit from the good work on MM, and do it "the right way" this time, so I can contribute to MM :-)
>
> I tested the new version without modifications and found two "problems":
>
> The default bearer interface is not implemented for ublox modems
> The device does only sometimes get a LTE connection, sometimes it doesn't.
>
> While the reason for the first problem is quite obvious ;-), I did some analysis on the second one and found the reason why it does not work:
> Whenever there is a PDP context matching the APN, besides the context with CID 4 -- which is used by the modem to automatically create a connected bearer when it can connect using the default EPS bearer -- MM selects that PDP context and tries to establish a connection using it. But since there is already a connected context with CID 4, connecting a secondary context to the same APN may fail (depending on the SIM card, due to MNO restrictions I guess, see https://www.u-blox.com/sites/default/files/LTE-initial-default-bearer_AppNote_%28UBX-20015573%29.pdf).
> Now the question is why there is a second PDP context when trying to connect. The answer is that this context has been created by MM when it tries to connect while the default bearer is not connected: CID 4 is unused when the initial bearer is not connected, so MM creates a second one that gets in the way when we later on try to connect a connection and the initial bearer is there again
>

What operator is this? Is it Verizon in the US? Or does the TOBY-L2
really always use CID 4 for the initial default bearer?

> Therefore I did some modification in MM to make the Toby work:
>
> I implemented the the initial EPS bearer setting interface (functions  set_initial_eps_bearer_settings*, load_initial_eps_bearer_settings*) similar to the icera plugin. I used the at+ucgdflt command for reading and writing the initial EPS bearer setting (this command is available on Toby-L2 and MPCI-L2 only).

Nice!

> I implemented the profile list interface (functions list_profiles*) to prefer CID 4 when MM tries to reuse a PDP context for connecting
>

I'd like to see how that's done :)

> I got it up and running. But I want to push that changes into MM, so there are some open questions regarding the implementation I want to discuss.
>
> The Toby L210 does not allow to read back the username to use for the initial bearer. Therefore, comparing the username after writing the initial bearer fails. I omitted comparing the username for now when comparing the previous EPS bearer settings with the new ones. This change is not in the ublox plugin, so I doubt this is a good idea. How to handle this properly?

I think you can subclass the modem_3gpp_profile_manager_check_format()
in the profile manager interface, and return a custom
MM3gppProfileCmpFlags that includes MM_3GPP_PROFILE_CMP_FLAGS_NO_AUTH.
But for that I think you may need to implement the initial bearer
setup using the profile manager API somehow. E.g. if updating a
profile associated to the initial lte bearer, use UCGDFLT, otherwise,
use the standard CGDCONT operations. What I'm not sure is if there's
currently some way to say "CMP_FLAGS_NO_AUTH only for the initial
bearer".

> The ucgdflt command is not available for other ublox modems, so the implementation I did only applies to Toby-L2 and MPCI-L2. This information must be gathered somehow. I see two possibilities: using the at+ucfgdlt=? to test the availability of the command (when would I do that?), or introduce a flag similar to the ubandsel flag inside the band configuration struct. What would be the method to prefer?

A query always, e.g. AT+UCFGDLT=?. The udev flags are only for when
there is no other way to query. Depending on how you structure the
logic, if you make the changes using the new profile manager API, you
could subclass modem_3gpp_profile_manager_check_format() and in
addition to running the parent method (that will do the generic check
for AT+CGDCONT=? by itself) you could also do the custom check for
AT+UCFGDLT=?

> Is implementing the profile list interface the right approach? The fact that MM selects an already activated PDP context (cid 4), tries to deactivate it (which fails, but is ignored), tries to activate it again (which fails, but is ignored as well) and then uses it "smells" and indicates to me that this might not be the right solution. A better approach might be that MM accepts using an already activated PDP right away without trying to disconnect and connect again, but this would mean that there are massive changes required in MM to support that. What is your opinion on that?
>

So, this one's tricky. For this very specific case of the TOBY
modules, we may see that we can go on and assume the context is
already connected and don't attempt to reconnect. The problem is
really the settings; if we can confirm the settings that we request
match the settings of the connected context, I think it should be
fine.

> I found other small issues during work (build warnings, const issues etc), but I guess this email is long enough already, so I postpone that .... ;-)
>

If those issues are unrelated to big changes, please go on and suggest
them in https://gitlab.freedesktop.org/mobile-broadband/ModemManager
as merge requests. Actually, for the big changes also, if you want to
split them in separate proper patches and send them as a merge request
that would also be fine.

> I really look forward for any answers and ideas.
>
> I hope I managed to describe the problem and my solution so that one can understand it, otherwise just ask. I can also provide the code with changes I did....)
>

One last question here; are the changes you're suggesting all
applicable and working in both bridge and router mode in the TOBY-L2?

--
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list