lenovo / lenovo-wwan-unlock

FCC and DPR unlock for Lenovo PCs
16 stars 3 forks source link

Seems not working on (X)ubuntu 24.04 #9

Closed zaikunzhang closed 2 months ago

zaikunzhang commented 2 months ago

I tried it on Xubuntu 24.04 with Thinkpad X1 Carbon gen 12 with Quectel modems - the RM520N-GL for 5G, but it did not work.

Some information.

$ uname -a
Linux 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

$ NetworkManager --version
1.46.0

$ ModemManager --version
ModemManager 1.23.4

$ mbimcli -p -d /dev/wwan0mbim0 -v --quectel-query-radio-state
[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] opening device...
[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] couldn't find descriptors file, possibly not using cdc_mbim
[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] fallback to default max control message size: 4096
[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] sent message...
<<<<<< RAW:
<<<<<<   length = 92
<<<<<<   data   = 03:00:00:00:5C:00:00:00:01:00:00:00...

[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] sent message (translated)...
<<<<<< Header:
<<<<<<   length      = 92
<<<<<<   type        = command (0x00000003)
<<<<<<   transaction = 1
<<<<<< Fragment header:
<<<<<<   total   = 1
<<<<<<   current = 0
<<<<<< Contents:
<<<<<<   service = 'proxy-control' (838cf7fb-8d0d-4d7f-871e-d71dbefbb39b)
<<<<<<   cid     = 'configuration' (0x00000001)
<<<<<<   type    = 'set' (0x00000001)
<<<<<< Fields:
<<<<<<   DevicePath = '/dev/wwan0mbim0'
<<<<<<   Timeout = '30'

[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] unexpected port hangup!
[02 May 2024, 23:00:51] [Debug] [/dev/wwan0mbim0] channel destroyed
error: couldn't open the MbimDevice: Transaction timed out

$ mmcli --modem 0 --enable
error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: Wrong state: modem in failed state'
nitinexclusively commented 2 months ago

@zaikunzhang Thank you for your comment and apologize for my late reply as i was away due to holiday in japan. We will test it using Ubuntu 24.04 and update. Meanwhile , can you please share log of "mmcli -m any "

Thank you !

zaikunzhang commented 2 months ago

Thank you @nitinexclusively !

Here it is.

$ mmcli -m any 
  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/10
           |               device id: b3252a644d301f30859a1db395be82305352bba2
  -----------------------------------
  Hardware |            manufacturer: quectel
           |                   model: RM520N-GL
           |       firmware revision: RM520NGLAAR03A03M4G
           |          carrier config: ROW_Commercial
           | carrier config revision: 0A010809
           |            h/w revision: RM520N-GL
           |               supported: gsm-umts, lte, 5gnr
           |                 current: gsm-umts, lte, 5gnr
           |            equipment id: 016508000123509
  -----------------------------------
  System   |                  device: /sys/devices/pci0000:00/0000:00:1c.6/0000:08:00.0
           |                 physdev: /sys/devices/pci0000:00/0000:00:1c.6/0000:08:00.0
           |                 drivers: mhi-pci-generic
           |                  plugin: quectel
           |            primary port: wwan0mbim0
           |                   ports: wwan0 (net), wwan0at0 (at), wwan0mbim0 (mbim), 
           |                          wwan0qcdm0 (ignored)
  -----------------------------------
  Status   |                   state: failed
           |           failed reason: esim-without-profiles
           |             power state: low
  -----------------------------------
  Modes    |               supported: allowed: 3g; preferred: none
           |                          allowed: 4g; preferred: none
           |                          allowed: 3g, 4g; preferred: 4g
           |                          allowed: 3g, 4g; preferred: 3g
           |                          allowed: 5g; preferred: none
           |                          allowed: 4g, 5g; preferred: 5g
           |                          allowed: 4g, 5g; preferred: 4g
           |                          allowed: 3g, 5g; preferred: 5g
           |                          allowed: 3g, 5g; preferred: 3g
           |                          allowed: 3g, 4g, 5g; preferred: 5g
           |                          allowed: 3g, 4g, 5g; preferred: 4g
           |                          allowed: 3g, 4g, 5g; preferred: 3g
           |                 current: allowed: 3g, 4g, 5g; preferred: 5g
  -----------------------------------
  Bands    |               supported: utran-1, utran-4, utran-6, utran-5, utran-8, utran-2, 
           |                          eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8, 
           |                          eutran-12, eutran-13, eutran-14, eutran-17, eutran-18, eutran-19, 
           |                          eutran-20, eutran-25, eutran-26, eutran-28, eutran-29, eutran-30, 
           |                          eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41, 
           |                          eutran-42, eutran-43, eutran-46, eutran-48, eutran-66, eutran-71, 
           |                          utran-19, ngran-1, ngran-2, ngran-3, ngran-5, ngran-7, ngran-8, 
           |                          ngran-12, ngran-13, ngran-14, ngran-18, ngran-20, ngran-25, ngran-26, 
           |                          ngran-28, ngran-29, ngran-30, ngran-38, ngran-40, ngran-41, ngran-48, 
           |                          ngran-66, ngran-70, ngran-71, ngran-75, ngran-76, ngran-77, ngran-78, 
           |                          ngran-79
           |                 current: utran-1, utran-4, utran-5, utran-8, utran-2, eutran-1, 
           |                          eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8, 
           |                          eutran-12, eutran-13, eutran-14, eutran-17, eutran-18, eutran-19, 
           |                          eutran-20, eutran-25, eutran-26, eutran-28, eutran-29, eutran-30, 
           |                          eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41, 
           |                          eutran-42, eutran-43, eutran-46, eutran-48, eutran-66, eutran-71, 
           |                          utran-19, ngran-1, ngran-2, ngran-3, ngran-5, ngran-7, ngran-8, 
           |                          ngran-12, ngran-13, ngran-14, ngran-18, ngran-20, ngran-25, ngran-26, 
           |                          ngran-28, ngran-29, ngran-30, ngran-38, ngran-40, ngran-41, ngran-48, 
           |                          ngran-66, ngran-71, ngran-75, ngran-76, ngran-77, ngran-78, ngran-79
  -----------------------------------
  IP       |               supported: ipv4, ipv6, ipv4v6
  -----------------------------------
  3GPP     |                    imei: 016508000123509
  -----------------------------------
  SIM      |        primary sim path: /org/freedesktop/ModemManager1/SIM/10
           |          sim slot paths: slot 1: none
           |                          slot 2: none (active)
nitinexclusively commented 2 months ago

@zaikunzhang - It seems your E-SIM slot is active . So , can you please enter below command ,reboot machine and retry it. mmcli -m any --set-primary-sim-slot=1

Please Note : - 1) E-SIM support is not available now 2) Slot 1 is the primary slot i.e using Physical SIM Slot 2 is the slot for E-SIM

Thank you !

zaikunzhang commented 2 months ago

mmcli -m any --set-primary-sim-slot=1

Great! This works! Thank you!

It seems your E-SIM slot is active . So , can you please enter below command ,reboot machine and retry it.

However, I do not understand how this happened. I do not think I have done this explicitly --- I lack such knowledge. What is your speculation?

nitinexclusively commented 2 months ago

However, I do not understand how this happened. I do not think I have done this explicitly --- I lack such knowledge. What is your speculation?

I guess this might happen when system boot up at manufacturing w/o physical SIM . Although integrated eSIM is always there, hence , eSIM is selected from the beginning with Windows preload. With that, if you installs Linux OS to the system that has Windows preloaded, it is possible that you would see e-SIM slot is selected from the beginning.

If you are OK with this then i can close this issue ?

Thank you !

zaikunzhang commented 2 months ago

Your speculation sounds reasonable to me.

Maybe you could remind users to make sure esim is not being selected in your documentation.

Maybe fcc_unlock_setup.sh could even check whether esim is being selected, and, if yes then switch the selection to the physical sim (if it is within the scope of your script) or print a warning.

Thank you very much.

nitinexclusively commented 2 months ago

Maybe you could remind users to make sure esim is not being selected in your documentation.

Maybe fcc_unlock_setup.sh could even check whether esim is being selected, and, if yes then switch the selection to the physical sim (if it is within the scope of your script) or print a warning.

Yes , We are going to check regarding this. Thank you !

zaikunzhang commented 2 months ago

Maybe fcc_unlock_setup.sh could even check whether esim is being selected, and, if yes then switch the selection to the physical sim (if it is within the scope of your script) or print a warning.

Yes , We are going to check regarding this.

This will be great! It will save the time of many users, as the situation I encountered sounds quite typical according to your speculation. Thank you.