
Lenovo は、P16 gen 2 ラップトップ (Ubuntu Linux 認定) に次の wwan カードを搭載して出荷しています: Intel MBIM [8086:7560]。モデム マネージャーは wwan モデムを認識しますが、有効にできません (エラー メッセージ: ** (modem-manager-gui:9178): 警告 **: 10:33:30.084: Modem Manager >= 0.7.0: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Retry: 無効な遷移
Lenovoの指示(ThinkPad P16 Gen 2 Linuxユーザーガイド)によると、「https://support.lenovo.comお使いのコンピュータのエントリを選択します。製品サポート ページから wwan-linux-fcc- unlock パッケージをダウンロードします。README をチェックして、お住まいの地域に適用される制限があるかどうかを確認し、アプリケーションのインストール方法を確認してください。
しかし、残念ながら、Lenovo のサイトにはそのようなファイルはありません。また、FCC ロック解除ファイルを提供できなかったことについて、Lenovo からのコメントもありません。
このリンクも空のようです:https://www.lenovo.com/linux/wwan-enablement-on-Linux.pdf
上記の WWAN カードの FCC ulock ファイルがどこにあるか知っている人がいない限り、P16 シリーズの WWAN モデムは Ubuntu や Linux では使用できません。これについて何か情報はありますか?
前もって感謝します
答え1
8086:7560 のロック解除については、次のスクリプトを使用して ThinkPad X1 Yoga Gen 7 で正常にロック解除できました。https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/751。
スクリプトを として保存し/etc/ModemManager/fcc-unlock.d/8086:7560
、実行可能であることを確認できます ( chmod +x
)。また、ヘッダーのシェバンを から に変更する必要がありpython
ますpython3
。
モデム自体はかなり扱いにくいため、特にサスペンド/休止状態を使用する場合は、いくつかの回避策が必要になります。
大きな問題の 1 つは、PCI バス上のモデムの電源が切れると、再び電源を入れることができなくなり、再度電源を入れる必要があることです。これは、モデム自体と、モデムが接続されているバスに影響します。
次の udev ルールが必要になります。
/etc/udev/rules.d/99-modem-suspend.rules
# The modem fails to wake up ever again after suspend
SUBSYSTEM=="pci", ATTR{vendor}=="0x1cf8", ATTR{device}=="0x8653", ATTR{power/control}="on", GOTO="pci_pm_end"
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x7560", ATTR{power/control}="on", GOTO="pci_pm_end"
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x51b8", ATTR{power/control}="on", GOTO="pci_pm_end"
# Use normal sleeping otherwise
SUBSYSTEM=="pci", ATTR{power/control}="auto"
LABEL="pci_pm_end"
次に、モデムまたは Linux がデバイスをサスペンドせずに常に電源を入れたままにするために、起動時に実行してデバイスの省電力の初期プロパティを設定するスクリプトが必要になります。
/opt/keep-modem-awake.sh
#!/bin/sh
# Enable wakeups
## Bus the modem is on
if grep 'pci:0000:00:1c.0' < /proc/acpi/wakeup | grep disabled
then
echo "Enabling wakeup for bus owning Modem..." > /dev/kmsg
echo RP01 > /proc/acpi/wakeup
fi
## Modem
if grep 'pci:0000:08:00.0' < /proc/acpi/wakeup | grep disabled
then
echo "Enabling wakeup for modem..." > /dev/kmsg
echo PXSX > /proc/acpi/wakeup
fi
# Disable d3cold for the modem
# It is behind the bridge: 00:1c.0 PCI bridge: Intel Corporation Device 51b8 (rev 01)
# https://patchwork.kernel.org/project/linux-pci/patch/[email protected]/
echo "Disabling modem d3cold..." > /dev/kmsg
## The actual modem
echo 0 > /sys/bus/pci/devices/0000:08:00.0/d3cold_allowed
## The owning buses
echo 0 > /sys/devices/pci0000:00/0000:00:1c.0/d3cold_allowed
echo 0 > /sys/bus/acpi/devices/PNP0A08:00/device:4f/physical_node/d3cold_allowed
echo 0 > /sys/bus/acpi/devices/PNP0A08:00/device:4f/device:50/physical_node/d3cold_allowed
# Use ACPI to reset the PCI and not just power off and power on the device
echo "Setting modem reset method to ACPI..." > /dev/kmsg
echo acpi > /sys/bus/pci/devices/0000:08:00.0/reset_method
注意: システムによってデバイス パスが異なる場合があります。たとえば、Lenovo ThinkPad Z16 Gen 1 では、モデムは0000:05:00.0
、所有バスは0000:00:01.3
、ACPI デバイスはですPNP0A08:00/device:07/device:08
。使用する ID を適切に識別するには、次の操作を実行します。
- コマンドを使用してモデムを識別します
lspci
。例:
❯ lspci | grep Modem
05:00.0 Wireless controller [0d40]: Intel Corporation XMM7560 LTE Advanced Pro Modem (rev 01)
これによりデバイスパスが取得されます/sys/bus/pci/devices/0000:05:00.0
- 所有バスを識別します:
❯ ls -l /sys/bus/pci/devices/0000:05:00.0
lrwxrwxrwx. 1 root root 0 Apr 14 10:24 /sys/bus/pci/devices/0000:05:00.0 -> ../../../devices/pci0000:00/0000:00:01.3/0000:05:00.0
バスのパスを所有する/sys/bus/pci/devices/0000:00:01.3
- ACPI 所有バスを識別します。
❯ find /sys/bus/acpi/devices/PNP0A08:00/ -type l -exec ls -l {} + | grep '05:00.0'
lrwxrwxrwx. 1 root root 0 Apr 14 14:25 /sys/bus/acpi/devices/PNP0A08:00/device:07/device:08/physical_node -> ../../../../../pci0000:00/0000:00:01.3/0000:05:00.0
道を与え/sys/bus/acpi/devices/PNP0A08:00/device:07
、/sys/bus/acpi/devices/PNP0A08:00/device:07/device:08
次に、起動時にスクリプトを実行します。
/etc/systemd/system/keep-modem-awake.service
[Unit]
Description="Keep modem awake for suspend."
After=ModemManager.service NetworkManager.service
Wants=ModemManager.service NetworkManager.service
[Service]
ExecStart=/opt/keep-modem-awake.sh
[Install]
WantedBy=multi-user.target
システムがサスペンドおよび再開するたびにモデム ID が変更されるため、後のスクリプトではモデムを検出できるスクリプトが必要になります。
/opt/find-modem.sh
#!/bin/sh
# Make sure path is set
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
for __i in $(seq 1 10)
do
__modem="$(/opt/find-modem-sub.sh | head -n 1)"
if [ -z "$__modem" ]
then
sleep 0.5
else
break
fi
done
if [ -z "$__modem" ]
then
exit 1
fi
echo "$__modem"
exit 0
/opt/find-modem-sub.sh
#!/bin/sh
# Make sure path is set
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Read in commands
mmcli -L | grep '\/Modem\/' | while read __line
do
echo "$__line" | sed 's/^.*\/Modem\/\([0-9]\{1,\}\).*$/\1/'
exit 0
done
exit 1
次に、サスペンドと休止状態を使用する予定の場合は、それが発生する前と後にスクリプトが実行されるように、それに応じてスクリプトを設定する必要があります。
/opt/suspend-modem.sh
#!/bin/sh
# Make sure path is correct
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Get modem ID
__modem="$(/opt/find-modem.sh)"
if [ "$1" = "0" ]
then
echo "Telling NM to not use the modem..." > /dev/kmsg
nmcli c down NetworkName
# Make sure the connection is deactivated
echo "Waiting for NM to show disconnected..." > /dev/kmsg
while nmcli con show --active | grep NetworkName
do
sleep 0.5
done
# Deactivate the modem before suspend as the connection freezes and never comes back
echo "Disabling modem..." > /dev/kmsg
mmcli -m "$__modem" --disable
elif [ "$1" = "1" ]
then
echo "Disabling modem after resume..." > /dev/kmsg
mmcli -m "$__modem" --disable
echo "Entering low power mode after disable..." > /dev/kmsg
mmcli -m "$__modem" --set-power-state-low
echo "Performing enabling loops..." > /dev/kmsg
for __i in $(seq 1 5)
do
echo "Loop $__i..." > /dev/kmsg
echo "Turning on modem and enabling..." 1>&2
mmcli -m "$__modem" --set-power-state-on
if mmcli -m "$__modem" --enable
then
echo "Modem was enabled..." > /dev/kmsg
break
else
echo "Did not enable modem..." > /dev/kmsg
sleep 0.5
fi
done
echo "Telling NM to use the modem now..." > /dev/kmsg
nmcli c up NetworkName
fi
次に、それに応じて次の systemd を実行します。これは再開用です。
rfkill-modem-resume.service
[Unit]
Description=Enable modem after wake-up
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
[Service]
Type=simple
ExecStart=/opt/suspend-modem.sh 1
[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
そしてこれはサスペンド用です:
rfkill-modem-suspend.service
[Unit]
Description=rfkill modem before sleep
Before=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
[Service]
Type=simple
ExecStart=/opt/suspend-modem.sh 0
[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
これらのスクリプトやその他のスクリプトを使用することで、複数回のサスペンドおよび休止状態の後でもモデムを稼働状態に維持することに成功しました。
さらに、NetworkManager 接続を調整して、DNS とルートの優先度をメイン接続よりも低く (高い値に) し、フォールバックとして使用することもできます。
答え2
また、保留中のマージリクエストbash ベースのロック解除スクリプトを使用します。
私が作った修正版AT+XDNS=0,1
それがないと接続が切断され続けるため、コマンドも送信します。