To enable message logging in connman the code needs to be called with the argument -d. If you are building the code under yocto you can either modify the connman.service.in file in the src directory to include the following lines. This will cause the appropriate changes to be written to the rootfs everytime it’s built.
EnvironmentFile=/home/root/connman.env
ExecStart=@sbindir@/connmand -n $DEBUG
Alternatively the changes could be made directly to the systemd configuration file connman.service.
The lines above make use of an environment variable $DEBUG which is being set in the file /home/root/connman.env, which contains the following lines.
DEBUG=-d
CONNMAN_SUPPLICANT_DEBUG=1
The -d argument is used to turn on debugging. By adding additional parameters to this line it is also possible to specify which files we want to get debug messages from.
The CONNMAN_SUPPLICANT_DEBUG variable is included because some messaging in connman is enabled according to environment variable settings. The wifi.c file for example includes the following function.
static void debug(const char *str) { if (getenv("CONNMAN_SUPPLICANT_DEBUG")) connman_debug("%s", str); }