Maintaining connectivity between multiple devices

Kasper Holtze kasper at holtze.dk
Mon Feb 6 13:36:48 UTC 2017


Den 06-02-2017 kl. 10:09 skrev Aleksander Morgado:
> On Sun, Feb 5, 2017 at 10:31 PM, Kasper Holtze <kasper at holtze.dk> wrote:
>> Sorry if this is the wrong place to ask. I'm working on a solution which has
>> multiple interfaces for Internet connection. Two QMI modems (MC7304), a LAN
>> interface and a WiFi interface. The questions is primarily regarding the
>> modems.
>>
>> Each modems has two SIM cards, and I've build a small piece of software to
>> switch between these, and all of the interfaces. All the switching is
>> working fine. I am switching between modems/interfaces by opening/closing
>> the interfaces (ifup/ifdown), and that way making sure the right interface
>> is in use. Only the interface which "should be used right now", is active.
>>
> How does the switching between SIM cards work in your setup? Do you
> have a GPIO to select one or the other?
Yes, I have a switch for each modem, controlled by GPIO. Whenever I need 
to switch SIM, I power down the SIM card, switch the GPIO and power the 
SIM card back up. That works fine.
>
>> However, I am seeing issues getting connectivity through the modems -
>> sometimes I cannot get an IP address from the modem, even though I can see
>> that the modem is connected and has an address.
>>
> Beware when using raw-ip; your DHCP client may not know how to setup
> the IP address in the ethernet-header-less interface. I.e. you could
> manually configure the IP settings you got in
> --wds-get-current-settings instead of relying on HDCP.
Alright. Is it too early to use raw-ip? Unfortunately, I see a lot of 
other (unrelated) issues with Linux 4.9, which may force me to switch 
back to 4.4.8 and 802-3 for now.
>
>> I have recently switched from 802-3 to raw-ip, by upgrading Linux from 4.4
>> to 4.9. That seems to work fine, and /sys/class/net/wwanX/qmi/raw_ip is
>> always set to Y (is echo'ing Y to this the right way to go?).
>>
> Yes, or just:
>
> $ qmicli -d /dev/cdc-wdmX --set-expected-data-format=raw-ip
Thanks!
>> I configured the modems to use autoconnect, so that even if there's issues
>> with the software, the modems itselfes will connect to the internet.
>>
>> So, in the hunt of the most stable solution, my questions are:
>>
>> - I'm wondering if the approach is the best, or if I should not open/close
>> the interfaces all the time, and just switch the default gateway? Or using
>> libqmi connect functions, and disable autoconnect...
>>
> I'm still curious about how you manage multiple SIM cards on the same device...
See above :-) However, the question is more about switching between 
modems/interfaces that between SIM cards. The SIM switch functionality 
is working fine.
>
> Anyway, I'm assuming that autoconnect will internally try to keep the
> modem connected, even if there's no traffic flowing through, so I
> guess it doesn't matter how you maintain the connection.
>
>> - If I just connect the modems at boot, using autoconnect, will the modems
>> reconnect if they are out of coverage for a while? Will the DHCP client
>> automatically fetch the new IP address when the connection is restores? What
>> if it moves cross-border, will it restore connectivity automatically? I
>> guess I could just test this, but it would be nice to know some theory about
>> it.
> I don't have much experience with autoconnect in those situations, but
> I guess that's what should happen.
>
Alright - will test. Thank you very much! :-)



More information about the libqmi-devel mailing list