Hey all! I have a strange technical issue I would love some assistance with.
The background of what’s happening is this: my boards I’m developing will have up to three different connections: a wi-fi connection, an ethernet connection, and cellular connection. The ethernet connection is most likely just going to be used for a modbus over ethernet connection, the wi-fi connection has the potential to be either connected to the internet or not, and the cellular connection will always have internet access. For this reason, we need to carefully manage outgoing traffic to use the wi-fi connection if its connected to internet, then use the cellular network if not as a fallback.
The primary bit of outgoing traffic for our purposes is traffic to the torizon cloud. Preferably, if the wi-fi connection has internet connectivity, it would use this interface to transmit data to the cloud. Otherwise, it would fall back on the cellular network to transmit this data. To accomplish this, the team made a script on startup to manipulate fluent-bit.
One of the main parts of the script is using a curl command to see if a specific interface has connection. When I use mlan0, my wi-fi interface, this script works and reports data to the cloud. The same is not true if wwan0, my cell-network, is the only interface I have connected. This confuses me a bit as we have had a cellular connection transferring data to the torizon cloud before we did this file output measure. Something I wanted to try was to isolate the curl command to see if that was the issue, and I have narrowed it down to that definitely being the issue.
When running the following command, which is part of the script:
curl --interface wwan0 --cacert /usr/lib/sota/root.crt --key /var/sota/import/pkey.pem --cert /var/sota/import/client.pem --head https://dgw.torizon.io
this gives me a resolve error ONLY when mlan0, my wi-fi connection, is not connected. When I do have mlan0 connected and run the curl command through wwan0, it works just fine. Using the ping command with the -I flag for wwan0 seems to always work for 8.8.8.8, regardless if the mlan0 interface is connected or not.
Does anyone have any knowledge of the next steps I should take to get this to work? Thanks!
EDIT: I feel I was sharing a bit too much about the background, and not enough about the problem itself, so I edited the post to make this clearer. Part of a startup script we have in order to pass outgoing data through different interfaces includes a curl command over several interfaces (mlan0 for wifi and wwan0 for cell-network). We are trying to see if mlan0 would have internet connection before using wwan0 as a fallback with the curl command. The problem we are seeing is that wwan0 only successfully uses the curl command when mlan0 is also connected, despite us using the interface flag for wwan0. These should work independently of each other and I’m unsure of the next steps to take to diagnose this issue.