Armadilloフォーラム

REST APIによるWWANの設定追加(APN登録)について

takamura.eiji

2025年8月20日 14時04分

==========
製品型番:AG9130-C03D0
Debian/ABOSバージョン:v3.22.1-at.1
==========

REST API でWWAN の設定追加(APN登録)について質問があります。

https://manual.atmark-techno.com/armadillo-iot-a9e/armadillo-iotg-a9e_p…
REST API: /api/wwan

本 API で最初に誤った情報を登録すると2回目以降に正規の情報でも失敗します。
以下ホストOS側で試しました。
誤った情報: apn=a, user=b, pass=c
正規の情報: apn=apn.ok, user=user.ok, pass=pass.ok

以下実行例です。

armadillo:~# AUTH="Authorization: Bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
armadillo:~# alias curl_rest='curl -sS -k -H "$AUTH" -w "\n{\"http_status\": %{http_code}}\n" '
armadillo:~# curl_rest -d apn=a -d user=b -d password=c https://127.0.0.1:58080/api/wwan
{"error":"Command [\"wwan_setup.sh\", \"gsm-ttyCommModem\", \"ttyCommModem\", \"a\", \"CHAP\", \"auto\", \"--user\", \"b\", \"--password\", \"c\"] failed with exit status: 4:\nstderr:\nError: Connection activation failed: The base network connection was interrupted\nNothing to do, none of the requested files exist: /etc/NetworkManager/system-connections/gsm-ttyCommModem.nmconnection\nconnection-recover       | * WARNING: connection-recover has already been started\nmodemmanager             | * WARNING: modemmanager has already been started\nCould not set up wwan connection.\n\nstdout:\nConnection 'gsm-ttyCommModem' (a2dafdc8-54cb-42d4-ad92-0fd09c46b9bf) successfully added.\nConnection 'gsm-ttyCommModem' (a2dafdc8-54cb-42d4-ad92-0fd09c46b9bf) successfully deleted.\n"}
{"http_status": 500}
armadillo:~# curl_rest -d apn=apn.ok -d user=user.ok -d password=pass.ok https://127.0.0.1:58080/api/wwan
{"error":"Command [\"wwan_setup.sh\", \"gsm-ttyCommModem\", \"ttyCommModem\", \"apn.ok\", \"CHAP\", \"auto\", \"--user\", \"user.ok\", \"--password\", \"pass.ok\"] failed with exit status: 4:\nstderr:\nError: Connection activation failed: No suitable device found for this connection (device eth0 not available because profile is not compatible with device (mismatching interface name)).\nNothing to do, none of the requested files exist: /etc/NetworkManager/system-connections/gsm-ttyCommModem.nmconnection\nconnection-recover       | * WARNING: connection-recover has already been started\nmodemmanager             | * WARNING: modemmanager has already been started\nCould not set up wwan connection.\n\nstdout:\nConnection 'gsm-ttyCommModem' (abe93630-eb7f-4ccd-90f3-159b3a5340c4) successfully added.\nConnection 'gsm-ttyCommModem' (abe93630-eb7f-4ccd-90f3-159b3a5340c4) successfully deleted.\n"}
{"http_status": 500}
armadillo:~# curl_rest -d apn=apn.ok -d user=user.ok -d password=pass.ok https://127.0.0.1:58080/api/wwan
{"error":"Command [\"wwan_setup.sh\", \"gsm-ttyCommModem\", \"ttyCommModem\", \"apn.ok\", \"CHAP\", \"auto\", \"--user\", \"user.ok\", \"--password\", \"pass.ok\"] failed with exit status: 4:\nstderr:\nError: Connection activation failed: The base network connection was interrupted\nNothing to do, none of the requested files exist: /etc/NetworkManager/system-connections/gsm-ttyCommModem.nmconnection\nconnection-recover       | * WARNING: connection-recover has already been started\nmodemmanager             | * WARNING: modemmanager has already been started\nCould not set up wwan connection.\n\nstdout:\nConnection 'gsm-ttyCommModem' (a0be1c15-99c1-4109-a0c7-768f3f987b3e) successfully added.\nConnection 'gsm-ttyCommModem' (a0be1c15-99c1-4109-a0c7-768f3f987b3e) successfully deleted.\n"}
{"http_status": 500}
armadillo:~# curl_rest -d apn=apn.ok -d user=user.ok -d password=pass.ok https://127.0.0.1:58080/api/wwan
{"error":"Command [\"wwan_setup.sh\", \"gsm-ttyCommModem\", \"ttyCommModem\", \"apn.ok\", \"CHAP\", \"auto\", \"--user\", \"user.ok\", \"--password\", \"pass.ok\"] failed with exit status: 4:\nstderr:\nError: Connection activation failed: No suitable device found for this connection (device eth0 not available because profile is not compatible with device (mismatching interface name)).\nNothing to do, none of the requested files exist: /etc/NetworkManager/system-connections/gsm-ttyCommModem.nmconnection\nconnection-recover       | * WARNING: connection-recover has already been started\nmodemmanager             | * WARNING: modemmanager has already been started\nCould not set up wwan connection.\n\nstdout:\nConnection 'gsm-ttyCommModem' (afa21a88-e022-47e7-960f-8008089c6316) successfully added.\nConnection 'gsm-ttyCommModem' (afa21a88-e022-47e7-960f-8008089c6316) successfully deleted.\n"}
{"http_status": 500}
armadillo:~# curl_rest -d apn=apn.ok -d user=user.ok -d password=pass.ok https://127.0.0.1:58080/api/wwan
{"error":"Command [\"wwan_setup.sh\", \"gsm-ttyCommModem\", \"ttyCommModem\", \"apn.ok\", \"CHAP\", \"auto\", \"--user\", \"user.ok\", \"--password\", \"pass.ok\"] failed with exit status: 4:\nstderr:\nError: Connection activation failed: No suitable device found for this connection (device eth0 not available because profile is not compatible with device (mismatching interface name)).\nNothing to do, none of the requested files exist: /etc/NetworkManager/system-connections/gsm-ttyCommModem.nmconnection\nconnection-recover       | * WARNING: connection-recover has already been started\nmodemmanager             | * WARNING: modemmanager has already been started\nCould not set up wwan connection.\n\nstdout:\nConnection 'gsm-ttyCommModem' (90425885-72d8-4d31-a364-94eb27776b43) successfully added.\nConnection 'gsm-ttyCommModem' (90425885-72d8-4d31-a364-94eb27776b43) successfully deleted.\n"}
{"http_status": 500}
armadillo:~# curl_rest -d apn=apn.ok -d user=user.ok -d password=pass.ok https://127.0.0.1:58080/api/wwan
{"uuid":"09fcfabc-26fa-49bd-826a-57678f8524d6"}
{"http_status": 200}

上記は正規の情報で4回ほど失敗して5回目で成功しました。
正規の情報で失敗する回数はまちまちですが、初回以降に誤った情報を何回も登録してしまうと、その後の失敗回数が増えるように思います。
場合により登録ができない状態になります。ただシステム再起動により初期状態に戻ります。

何かお作法的に誤ってますでしょうか?

※下記のフォーラムとの関連もありますでしょうか?
https://armadillo.atmark-techno.com/forum/armadillo/25946#comment-20194

コメント

at_dominique.m…

2025年8月21日 12時29分

takamura.eiji さん

お世話になっています、
マルティネです。
> 上記は正規の情報で4回ほど失敗して5回目で成功しました。
> 正規の情報で失敗する回数はまちまちですが、初回以降に誤った情報を何回も登録してしまうと、その後の失敗回数が増えるように思います。
> 場合により登録ができない状態になります。ただシステム再起動により初期状態に戻ります。
>
> 何かお作法的に誤ってますでしょうか?

本件を手元でも再現できました。
ModemManager の修正で対応できそうですがまだ完成してません。少し時間をください。

よろしくお願いします。

マルティネ さま

お世話になっております。
こちらの状況は如何でしょうか?
APN 登録の失敗が頻発するケースもあり、困っております。

at_dominique.m…

2025年9月3日 10時23分

takamura.eijiさん

> こちらの状況は如何でしょうか?
> APN 登録の失敗が頻発するケースもあり、困っております。

すみません、まだ追ってるところです。
APN 変更時に modemmanager の不具合で abort (まらは segfault)が発生する問題を解決しましたが、その後に別の問題が発生して調べてる途中です(クラッシュのおかげでいずれ復帰していた状態が固まって、修正前より動作が悪くなってます)

今月のアップデートに修正を間に合わせたいですが、原因がはっきりしてないので試せる物がいつできるかは約束できません。
修正完了できたらテストパッケージを準備してまた連絡します。

お手数ですがよろしくお願いします

at_dominique.m…

2025年9月26日 13時41分

takamura.eijiさん

大変お待たせしました。
必要な変更は予想していたより大きかったので、テスト時間を設けるために9月のアップデートで修正しませんでしたが、テストできるパッケージを準備できました。

添付した zip ファイルを Armadillo に転送して以下の手順で確認していただければと思います。

# ファイル展開
armadillo:~# unzip mm-a9e-apn-change.zip 
Archive:  mm-a9e-apn-change.zip
   creating: mm-a9e-apn-change/
  inflating: mm-a9e-apn-change/wwan_setup.sh
  inflating: mm-a9e-apn-change/libmm-glib-1.22.0-r199.apk
  inflating: mm-a9e-apn-change/modemmanager-1.22.0-r199.apk
  inflating: mm-a9e-apn-change/modemmanager-openrc-1.22.0-r199.apk
armadillo:~# cd mm-a9e-apn-change/
armadillo:~/mm-a9e-apn-change# ls -l
total 1664
-rw-r--r--    1 root     root        352033 Jan  8 12:35 libmm-glib-1.22.0-r199.apk
-rw-r--r--    1 root     root       1340816 Jan  8 12:35 modemmanager-1.22.0-r199.apk
-rw-r--r--    1 root     root          1438 Jan  8 12:35 modemmanager-openrc-1.22.0-r199.apk
-rwxr-xr-x    1 root     root          3449 Jan  8 12:35 wwan_setup.sh
 
# パッケージのインストール
armadillo:~/mm-a9e-apn-change# persist_file -a add --no-network --force-broken-world ./*apk
WARNING: opening from cache https://download.atmark-techno.com/alpine/v3.22/atmark: No such file or directory
WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.22/main: No such file or directory
WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.22/community: No such file or directory
(1/3) Upgrading libmm-glib (1.22.0-r109 -> 1.22.0-r199)
(2/3) Upgrading modemmanager (1.22.0-r109 -> 1.22.0-r199)
(3/3) Upgrading modemmanager-openrc (1.22.0-r109 -> 1.22.0-r199)
Executing busybox-1.37.0-r19.trigger
Executing dbus-1.16.2-r1.trigger
Executing eudev-3.2.14-r5.trigger
OK: 289 MiB in 202 packages
Install succeeded, but might not work in the running system
Please reboot if installed program does not work
 
# abos-web のスクリプトも更新します
armadillo:~/mm-a9e-apn-change# cp wwan_setup.sh /usr/libexec/abos-web/
armadillo:~/mm-a9e-apn-change# persist_file -v /usr/libexec/abos-web/wwan_setup.sh
'/mnt/usr/libexec/abos-web/wwan_setup.sh' -> '/target/usr/libexec/abos-web/wwan_setup.sh'
 
# パッケージ適用のための再起動
armadillo:~/mm-a9e-apn-change# reboot

手元で軽い動作確認はしていますが、10月末までに追加の確認(連続再起動等)を行いますので、追加の修正はまだ入るかもしれません。
なにか気になる動作があれば言ってください。

よろしくお願いします

ファイル ファイルの説明
mm-a9e-apn-change.zip