How to auto connect to network by MC7304 in Linux

Hi @dl5162 ,I follow your suggest. now I using the modemmanager auto control the data-format of host.
But I encounter some problem.

In addition, I using modemmanager and qmicli with “–wds-set-autoconnect-settings” connect network now.

  1. When qmocli autoconnect is enabled and wait for modemmanager set the data-format of host to Y, it can’t use dhcp get an IP address, must use “qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-get-autoconnect-settings” to get an IP address.Do you know why it happend?

root@:~# udhcpc -i wwan0
udhcpc: started, v1.31.0
udhcpc: sending discover
udhcpc: sending discover
^C
root@:~# qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-get-autoconnect-settings
Autoconnect settings retrieved:
Status: ‘enabled’
Roaming: ‘allowed’
root@:~# udhcpc -i wwan0
udhcpc: started, v1.31.0
udhcpc: sending discover
udhcpc: sending select for 100.70.245.152
udhcpc: lease of 100.70.245.152 obtained, lease time 7200
/etc/udhcpc.d/50default: Adding DNS 172.24.9.21
/etc/udhcpc.d/50default: Adding DNS 10.9.121.102

  1. I using systemd-networkd to auto get IP address.When the host does not get IP address, which will keep retry to get IP address. However, when the modemmanager try to set the data-format of host, the dhcp retry get IP address that will make it impossible set the data-format of host.Do you have any idea solve it? Thank you.

[ 592.153521] qmi_wwan 1-1.1:1.2 wwan0: Cannot change a running device

If I don’t use systemd-networkd, and only use udhcpc before the modemmanager to set the data-format of host. It likely below:

root@:~# udhcpc -i wwan0
udhcpc: started, v1.31.0
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
[ 3108.153377] qmi_wwan 1-1.1:1.2 wwan0: Cannot change a running device
udhcpc: sending discover
^C
root@:~# cat /sys/class/net/wwan0/qmi/raw_ip
N