On 2/27/19, Jonas Bonn <jonas(a)southpole.se> wrote:
Both connman and ofono are primarily controlled via DBus. The
configuration file may get you most of what you want, but you still need
to configure the access point, set up a context for fallback to
UMTS/GSM, etc and this pretty much requires a bit of setup via dbus.
Right, I am learning right now how to set up ConnMan configuration
file and how to interact with dbus.
Calling DBus methods from C is no big deal. If your setup is
though, you might be able to get away with just using the connmanctl
utility on the command line to do whatever minimal setup you need. It
all depends on the use case.
We are using C++ in our application, I don't think I need interact
dbus for switching network interface from LTE to WiFi, I believe the
ConnMan will do it automatically.
The only thing I need in program is to set up WiFi client connection
based on the input of SSID and password or set up an AP. If that can
be done in C API, , calling C API will be much easier than calling
shell command line. Is it right place to learn C API examples in
tools/dbugs-test.c and other test files in that directory?
So most modems expose one or more serial ports (real or virtual)
can be used for sending commands to them; these are primarily
AT-commands, but there are other protocols around. There really aren't
many ioctls in play, though, in the common case.
Yes, we are using USB serial line. You are right, we are not using
ioctls, I was referring to kernel or other system processes use
Whether you have GPIO's involved is a matter of system design,
generally sit on some reset-line of the modem and that's about it.
We are actually toggling LTE modem power key and reset key to set up
LTE through the gpio. Several times I have noticed the crash of
missing the device /dev/ttyUSB0, it is my suspicious either something
is not set up properly between the driver and kernel, or the toggling
LTE power key / reset messed up, but my colleague was not convinced
that could cause the problem.
You are right, though, in that you don't want multiple clients
about with the modem state concurrently. Best to leave that to one
agent and let other clients talk to the agent. That's where ofono comes
into play: ofono manages your modem so you (or connman) can control it
at a higher level of abstraction.
Good to know, I am going to build and to install both connman and ofono.
What connman gets you, primarily, is sane routing depending on
availability of the various types of connection. If WiFi isn't
available, connman can ask ofono to bring up the LTE connection and set
that up as the primary route. When WiFi becomes available, it can move
the default route to that. And so on... depending on your requirements.
That is actually a key requirement for our application I am straggling
to achieve it. My colleague argued we should do it manually using
scripts, I think that is more than just networking interface scripts.
Aside from that, your question isn't easy to answer. Do you
connman? It depends. Do you need ofono? It depends. Do connman and
ofono work well on small embedded devices? Absolutely. Given the
nature of your questions, however, I have a hunch that a connection
manager of some sort is what you want.
Well, you have already answered and explained well to my questions,
your advice boosted my determination to use the ConnMan, my apology to
make lots of noises in this mailing list already, I might have to ask
more questions during building package, configuration and integration,
I am happy to play a testing role if you don't mind.
Thank you so much Jonas