On 2/26/19 8:21 PM, JH wrote:
I am currently debating with my colleague about if it is necessary
use connection manager in a small embedded Linux device with network
interfaces of LTE, WiFi and BLE.
Short answer: don't try implementing it your own way.
We are successfully using Connman in an embedded product with WiFi and
Ethernet. Connman does a good job at managing these two interfaces and
switches between them automatically without any issues. You should
also know that wpa_supplicant is pretty messy to deal with directly
(consider using iwd instead), and Connman does it already for you. So
that's a big time saver for your development. Also, Connman is not at
all restricted for use on the desktop; it's quite the other way
around: Connman can help you a lot with dealing with the complex
dynamics of network connectivity experienced on mobile devices which
are typically not an issue on the desktop computer. Desktops are
usually much simpler in this respect.
On the downside, you *have* to talk to Connman via D-Bus. There is no
C API for Connman. Your D-Bus options for C are libdbus (bugs, bugs,
bugs), GDBus (pulls GLib into your application, which is what we do
and hate), and sd-bus. For C++ there are a few other libraries and
wrappers around the C libraries, but we haven't tried any of them yet.
You could also try messing around with connmanctl (the command line
interface to Connman which uses D-Bus) or D-Bus command line tools
such as dbus-send or busctl to send your configuration to Connman. For
simple things this should work pretty well, but monitoring of changes
would be a bit challenging.
Anyway, we are quite satisfied with Connman. We had discussions about
using a network manager vs doing it by hand here as well (and
sometimes these discussions come up again when something goes wrong).
In retrospect, however, I'd say going with Connman was the right
decision. I wouldn't try to implement my own way of network
management, especially if there are multiple networking interfaces
involved. It can get really complex, and you would just end up
reimplementing parts of Connman, but with your own set of bugs which
you would have to solve all by yourself.
Whatever you do, however, do not try to mix Connman with manual
management. If you go with Connman, then you should use it exclusively
and avoid using external tools for network configuration.