Using Wi-Fi and a GPRS modem

Hi good people,

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'

Is it really that complicated or have I asked stupid question?

if the GRPS connection is working, try mwan3 ...

1 Like

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.

1 Like

You mean like: https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3 ?

Looks pretty complicated. Will try. Thanks

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?

Does the router in question have a built in gprs radio, or are you connecting a modem to an existing OpenWrt router?

What is the output of

ubus call system board 

As I wrote before, it's a GPRS modem connected through UART.
This device is not really a router. It's a Raspberry Pi.

{
	"kernel": "5.10.138",
	"hostname": "CM4NEO6",
	"system": "ARMv8 Processor rev 3",
	"model": "Raspberry Pi Compute Module 4 Rev 1.1",
	"board_name": "raspberrypi,4-compute-module",
	"rootfs_type": "ext4",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.0",
		"revision": "r19685-512e76967f",
		"target": "bcm27xx/bcm2711",
		"description": "OpenWrt 22.03.0 r19685-512e76967f"
	}
}

If you use it as a router, then it's a router.