Use hotspot as backup internet connection

My internet connection is patchy at times and I've been wondering if there is a way to configure the built-in wireless interface on my raspberry pi running OpenWrt 21.02.3, r16554-1d4dea6d4f to connect to my mobile phone hotspots at such time so that it gets used as the connection to the internet without any clients on the LAN being any the wiser. Most clients on the lan connect to openwrt via a separate AP that I have plugged into the lan port.

I'm not sure exactly what your setup is. If the Pi is not normally routing packets as the gateway to the Internet, you would need to reconfigure the rest of the network to make it the gateway when using the hotspot.

Yes, that's what I'd like to do. At a high level I want to instantiate another WAN using the r-pi's onboard wireless and set it to act as a client to my hotspot. Then when the internet gets patchy on the primary lan, disable the primary and activate the secondary lan. But I'm not sure of the details about how to configure the 2nd WAN interface.

So your regular WAN is already routing through this same Raspberry? Using two Ethernet ports?

The mwan3 package is typically used in that situation to have two WANs and have a "failover" if the preferred one is down. This can be found in the wiki.

Yes, 1 pi, 2 ethernet ports. Thanks, I'll take a look.