Conversation

@LaF0rge Thanks a lot for all your videos about eSIM and everything, you explain it in a really good way!

Just watched https://tube.tchncs.de/w/312add55-ba77-4e97-9dc0-1f5f37da9cae and I think slowly I start to understand how the eSIM ecosystem actually works ;)

1
1
0

@z3ntu @LaF0rge You might also be interested in this post with a link to a FOSS Android LPA: https://chaos.social/@LaF0rge/110933954051458423

1
0
0

@darkdragon @LaF0rge Oh that's also cool, thanks for sharing!

I'm also getting the urge to try and experiment a bit on mainline Linux + postmarketOS having some kind of LPA there. Though I'm still unsure how the Qualcomm modem and ModemManager need to play together to do these operations. I'm feeling QMI will be involved on some level or another. What lpac is doing with pcscd I'm quite sure won't work on Qualcomm phones.

3
0
0

@darkdragon @LaF0rge One thing that maybe either of you can answer which I don't quite understand yet is inhowfar putting a FF4 eSIM in a slot vs the soldered-on eSIM differs. As far as I understand from a pySim/card reader perspective it would be exactly the same but I can imagine that on phones (with 1x physical slot + 1x soldered-on eSIM) it works a bit differently depending which one you want to talk to?

1
0
0

@z3ntu @darkdragon if you look at the lpac source code, you will see it actually has a pcsc and and at-command "apdu driver" implemented. If you want to interface QMI, then for sure you'll need to add such a driver there. It even has a "stdio" driver where you pipe the APDUs through stdin/stdout. I believe this may be how OpenEUICC on android is using it.

1
0
0

@z3ntu @darkdragon I'm really not a big fan of ModemManager. Conceptually it seems so much less comprehensive than ofono - but then it appears everyone is betting on ModemManager even when it only covers a fraction of what you'd *really* want to have when trying to expose all features of a cellular modem. Last time I checked, there was for example no way to directly talk to the SIM card via some API. How would they ever do eSIM or VoLTE/IMS soft-clients?

2
0
1

@z3ntu @darkdragon note the AT-driver of lpac just caters to one specific modem type. The much more widely supported TS 27.007 standard AT+CSIM / AT+CRSM (which we support from pySim, for example) is not supported. But it should be trivial to add.

0
0
0
@LaF0rge @z3ntu @darkdragon Noone in mobile land is fan of ModemManager, I'm afraid. But ofono does not have qmi, IIRC, so MM won.
1
0
0

@z3ntu @darkdragon Modern basebands have multiple physical UARTS for talking to SIM or eUICC. No change from a dual sim phone. I'd expect in qmi you simply have some kind of channel number to select. In Android each gets exposed separately

1
0
0

@LaF0rge While I don't know much about the inner workings of either, yes, in the Linux on phones space ofono definitely lost a while ago in favor of ModemManager. At least some years ago ofono still didn't have voice call support on QMI and probably missing many other features while MM had this support, and also quickly gained support for the new-gen Qualcomm modems using QRTR.
And also Phosh UI started out using MM and Plasma Mobile switched to MM 2(?) years ago because of hardware support

0
0
0

@LaF0rge I guess I (or someone) will find out whether a removable eSIM behaves the same way as a soldered eSIM on these phones :) Would be useful to be able to test also using an eSIM with test keys with the same code - just a different slot - compared to the soldered-on version.

1
0
0

@pavel @darkdragon @LaF0rge @z3ntu Mobile land is really big, a lot of people in there prefer ModemManager and some apparently not ;)
oFono and ModemManager have their own philosophy regarding exposing modems etc. oFono wants to do it all and have a lot of features it can expose which is nice. ModemManager does not have VoLTE for example, but does not need that as you can do it in a separate daemon. It is all how you look at things...

1
0
0

@dylanvanassche @pavel @darkdragon @z3ntu you cannot meaningfully do a VoLTE/IMS soft client if ModemManager "owns" the AT command channel to the modem and doesn't expose any API to talk to the USIM/ISIM. You need to be able to perform the ISIM AUTHENTICATE command and read all the varous files of ADF.ISIM like EF.IMPU, EF.IMPI, EF.DOMAIN, EF.IMSConfigData, etc.

1
0
0

@LaF0rge @pavel @darkdragon @z3ntu Agreed. At Aleksander, ModemManager's maintainer presented next steps. One of them is separating more things, and allow an AT proxy, similar to QMI proxy. ModemManager talks then to the AT proxy instead of owning it. Other daemons and applications can then also do AT commands. For example: a time daemon executing an AT command to get the time from the modem provided by the carrier. I think this solves a lot.

0
0
1

@z3ntu @LaF0rge As far as my research goes, it should behave exactly the same. On the PCB side, it should even be possible to replace a physical SIM slot with an eUICC module with the only change to always pull the SIM detect pin to high (https://discord.com/channels/463237927984693259/543382344782970881/730839630466908261).

More links from my research:
- Whitepaper: https://www.gsma.com/esim/wp-content/uploads/2018/12/esim-whitepaper.pdf
- Standard SGP.02: https://www.gsma.com/newsroom/wp-content/uploads/SGP.02_v3.1.pdf
- Generate a QR Code for setup: https://forum.xda-developers.com/smartwatch/gear-s3/discuss-how-to-creat-qr-code-to-t3758970

2
0
0

@z3ntu @LaF0rge As far as I understand if you have an already provisioned eSIM and put it in your phone, it should just work. The only difference is the provisioning process.

I haven't had the time, hardware and testing environment to try it out myself though.

1
0
0

@darkdragon @z3ntu yes, of course. The downloaded and enabled eSIM profile on the eUICC is indistinguishable from a classic USIM to a phone / modem.

0
0
0

@darkdragon @z3ntu note that SGP.02 describes the M2M eSIM, which is completely different thant the consumer eSIM that people know from smartphones. It's also incompatible. M2M has no QR codes and you cannot install a consumer eSIM profile to a M2M eUICC. The relevant specs for consumer are GSMA SGP.21 and SGP.22 (v2.x for current deployments)

0
0
0

@darkdragon Yes! Made a good amount of progress. The only QMI APIs that you need seem to be the ones I've added here: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/376
With this I made a hacky wrapper around lpac that uses qmicli from libqmi to the work and lpac seems fully functional with that, so enabling, disabling and downloading profiles all work.
Now I'm in the process of writing a proper QMI/QRTR backend for lpac so that I can drop my wrapper script.

1
0
0

@darkdragon (in terms of eSIM on qcom, only tested with built-in eUICC. I don't have a removable eUICC (yet))

0
0
0