Esim on Xperia 10 iii (and other SFOS devices)

Might really be of interest, since eSIM prevalence increases. My provider offered me eSIM, I declined in believe that eSIM is not supported by SFOS. Not too long in the future there might be the situation that eSIM will be standard and physical SIMs hard to come by.
In addition, when traveling and roaming with the current provider not wanted or possible, eSIM use makes sense…

I have an Xperia 10 V that has hardware eSIM, but since Sailfish does not yet support integrated eSIM chips, I decided to buy a 9eSIM SIM that also comes with a USB-C reader so I can programme it with my mobile phone or from my PC Strengthen(V3) package – 9eSIM.

Yesterday I installed the 9eSIM app in AppSupport and when I ran the compatibility check, it told me that it did not support doing it from the mobile’s integrated SIM reader but it did support USB, so when I get the reader and the SIM, I will try plugging the reader into the mobile to see if it recognises it properly and can be programmed with that app via AppSupport. I will also try lpac via commands from Sailfish to see if it recognises both the internal chip and the reader and if it is possible to have a native app 9eSIM Card Tool Selection Guide – 9eSIM

Currently, there is lpa-gtk for Linux phones using Phosh/GNOME Mobile. Perhaps it could be used as a starting point, and the graphics could be done with QT for Sailfish :smiley: lucaweiss/lpa-gtk: Download and manage eSIM profiles - Codeberg.org .

In my case, I can test things, but I don’t have any programming knowledge about QT and packaging for Sailfish, so it would be a great contribution!

3 Likes

I’m pretty sure designing a entirely new QML app on top of a text-mode binary is way easier than trying to adapt an existing GUI.

I don’t have such a SIM yet but I can do the UI and packaging if you’re willing to try out the lpac binary.

2 Likes

When I receive the order, I will test the binary and let you know about it :smiley:

1 Like

Hmm, I checked my esim me I bought approximately few months ago, and it appears like it does not support standard eUICC. Also I heard that esim me require access to their servers to manage profiles

But I see eiotclub you mentioned also offer card-reader as well as 9esim (means it has eUICC), so there are at least two working options for SailfishOS

Recent versions of lpac have dynamically linked drivers, which seems to cause problems with Sailfish. You have to compile the version from @tvall eSIM and Sailfish OS - #36 by tvall .

As for the version from the official repository, this is the last functional tree in Sailfish, before they introduced dynamic drivers GitHub - estkme-group/lpac at e9e28c4f731b4e5046332d6fc22ef1a219463e4b

I have compiled it with all the drivers supported by Sailfish

cmake -B build -DLPAC_WITH_APDU_GBINDER=ON -DLPAC_WITH_APDU_PCSC=ON -DLPAC_WITH_APDU_AT=ON -DLPAC_WITH_HTTP_CURL=ON -L
cmake --build build
( for -DLPAC_WITH_APDU_QMI=ON and -DLPAC_WITH_APDU_QMI_QRTR=ON requires qmi-glib, for -DLPAC_WITH_APDU_MBIM=ON requires mbim-glib, which are not available in Sailfish), and it seems to work.

[defaultuser@Xperia10V lpac]$ LPAC_APDU_DEBUG=true build/output/lpac version | jq .
{
  "type": "lpa",
  "payload": {
    "code": 0,
    "message": "success",
    "data": "2.3.0.r388.e9e28c4f731b"
  }
}
[defaultuser@Xperia10V lpac]$ LPAC_APDU_DEBUG=true build/output/lpac driver list | jq .
{
  "type": "driver",
  "payload": {
    "LPAC_APDU": [
      "gbinder_hidl",
      "pcsc",
      "at",
      "stdio"
    ],
    "LPAC_HTTP": [
      "curl",
      "stdio"
    ]
  }
}

So far, I have tested that it detects a USB card reader. When I receive the 9eSIM I have ordered, I will test to see if it works to insert profiles with both the external reader and the mobile SIM reader. Esim on Xperia 10 iii (and other SFOS devices) - #23 by Juanro49

[defaultuser@Xperia10V lpac]$ LPAC_APDU_DEBUG=true LPAC_APDU=pcsc build/output/lpac driver apdu list | jq .
{
  "type": "driver",
  "payload": {
    "env": "LPAC_APDU_PCSC_DRV_IFID",
    "data": [
      {
        "env": "0",
        "name": "Alcor Micro AU9540 00 00"
      }
    ]
  }
}

On the downside, it does not seem to detect the eSIM chip on my Xperia 10 V so that I can’t configure it, although this may be due to Sony’s faulty blobs, or because it may be necessary to use the QMI APDU backend (which is not available for Sailfish at the moment, but seems to work on PostmarketOS An eSIM manager for Mobile Linux - Luca Weiss ) instead of GBinder APDU Backend .

[defaultuser@Xperia10V lpac]$ LPAC_APDU_DEBUG=true LPAC_APDU=gbinder_hidl build/output/lpac chip info | jq .
Attempting to connect to android.hardware.radio@1.0::IRadio/slot1
Failed to open APDU logical channel: 17
Attempting to connect to android.hardware.radio@1.0::IRadio/slot2
Failed to open APDU logical channel: 38
{
  "type": "lpa",
  "payload": {
    "code": -1,
    "message": "euicc_init",
    "data": ""
  }
}

2 Likes

Do you maybe have a working binary somewhere to download?

I have it on my phone where I compiled it. I will try to package it and upload it somewhere so it can be downloaded for testing

1 Like

Thank you. Packaging is nice, but should that make any issues I would be happy with a simple binary (or tar.gz) for now.

I have packaged the entire code directory, as certain libraries are generated during the compilation process that may be necessary for the binary to work. The binary is located in build/output/lpac.

If you run cmake --install build, various files will be installed in /usr/local/
– Install configuration: “”
– Installing: /usr/local/include/cjson/cJSON.h
– Installing: /usr/local/lib64/pkgconfig/libcjson.pc
– Installing: /usr/local/lib64/libcjson.a
– Installing: /usr/local/lib64/cmake/cJSON/cjson.cmake
– Installing: /usr/local/lib64/cmake/cJSON/cjson-noconfig.cmake
– Installing: /usr/local/lib64/cmake/cJSON/cJSONConfig.cmake
– Installing: /usr/local/lib64/cmake/cJSON/cJSONConfigVersion.cmake
– Installing: /usr/local/bin/lpac
– Set runtime path of “/usr/local/bin/lpac” to “/usr/local/lib64/lpac”

I have uploaded the tar.gz to this temporary link. Lufi - Disroot file uploader