In advance I have to say that I don't have much experience with network configuration and I can imagine I am missing something very simple.
I have OpenWrt installed on a Raspberry Pi CM4 module.
I configured it to use Wi-Fi as client connected to my home network.
I have a GPRS modem connected through UART
Now I can use the Wi-Fi. And I can use also the GPRS modem if I disable the Wi-Fi interface.
However when I take the device from my home network it won't use the GPRS modem.
What do I have to do so the system uses the GPRS modem when there is no Wi-Fo connectivity?
Here is my /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd89:ec6b:fb65::/48'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
config interface 'WiFi'
option proto 'dhcp'
config interface 'gprsmodem'
option proto '3g'
option device '/dev/ttyAMA1'
option service 'gprs_only'
option apn 'internet.eplus.de'
option username 'eplus'
option password 'gprs'
option ipv6 'auto'
config device
option name 'wlan0'
config device
option name '3g-gprsmodem'
option type 'tunnel'
Take that out. Don't refer to any wifi interfaces in /etc/config/network. The configuration in /etc/config/wireless will create them and attach them to a network.
If you have two wan-like interfaces defined, it is a race of which will connect last and install itself as the default route to the Internet. So you should disable the one that you are not using.
Take that out. Don't refer to any wifi interfaces in /etc/config/network. The configuration in /etc/config/wireless will create them and attach them to a network.
I believe it has been added automatically in there. I did not edit any files directly.
So you should disable the one that you are not using.
So there is no way to switch automatically when there is no WiFi nearby?