Hi all,

I am using connman v1.20 in an embedded system (MIPS arch). Using the
connman client it's easy to connect to a wifi with password. I perform the
following steps

   1. connmanctl> scan wifi: Scan wifi for services
   2. connmanctl> agent on: Register agent
   3. connmanctl> connect wifi_0123456789ab_0123456789_managed_psk: Connect
   to the wifi service and add the password when requested

I am trying to do the same as above using the dbus-send command. I want to
do that because I would like to use the node-dbus module from node.js in
order to control connman using dbus commands.

So

1. For scanning I used the following command

dbus-send --system --dest=net.connman --print-reply
/net/connman/technology/wifi net.connman.Technology.Scan


No problems there.


2. For registering the agent I used the following

dbus-send --system --dest=net.connman --print-reply /
net.connman.Manager.RegisterAgent objpath:"/test/agent"

I selected a test object path, as it is in the simple agent python script.
No problems there.

3. For connecting I used the following


dbus-send --system --dest=net.connman --print-reply
/net/connman/service/wifi_0123456789ab_0123456789_managed_psk
net.connman.Service.Connect

I am getting the following error

Error org.freedesktop.DBus.Error.UnknownObject: Method "Connect" with
signature "" on interface "net.connman.Service" doesn't exist

which seems that the agent registration failed or there is something else
going on.


In order to investigate more, I enabled debugging and I noticed that when I
register the agent using the client I get the following output

connmand[1942]: src/manager.c:register_agent() conn 0x55638980
connmand[1942]: src/agent.c:connman_agent_register() sender :1.29 path
/net/connman/connmanctl1998
connmand[1942]: src/agent.c:agent_ref_debug() 0x55641890 ref 1 by
src/agent.c:308:agent_create()
connmand[1942]: src/agent.c:connman_agent_register() agent :1.29
connmand[1942]: src/agent.c:set_default_agent() default agent set to :1.29
/net/connman/connmanctl1998


where the object path is set as "/net/connman/connmanctl$PID_CONNMANCTL"
but when I use the dbus-send command I get the following

connmand[1942]: src/service.c:connect_service() service 0x55641530
connmand[1942]: src/service.c:__connman_service_connect() service
0x55641530 state idle
connmand[1942]: src/network.c:__connman_network_disconnect() network
0x55649060
connmand[1942]:
src/agent-connman.c:__connman_agent_request_passphrase_input() agent (nil)
service 0x55641530 path (null)
connmand[1942]: src/manager.c:register_agent() conn 0x55638980
connmand[1942]: src/agent.c:connman_agent_register() sender :1.27 path
/test/agent
connmand[1942]: src/agent.c:agent_ref_debug() 0x55652240 ref 1 by
src/agent.c:308:agent_create()
connmand[1942]: src/agent.c:connman_agent_register() agent :1.27
connmand[1942]: src/agent.c:set_default_agent() default agent set to :1.27
/test/agent
connmand[1942]: src/agent.c:agent_disconnect() agent :1.27 disconnected
connmand[1942]: src/agent.c:agent_destroy() agent :1.27 req (nil)
connmand[1942]: src/agent.c:agent_unref_debug() 0x55652240 ref 0 by
src/agent.c:627:agent_destroy()
connmand[1942]: src/agent.c:cancel_all_requests() request (nil) pending
(nil)
connmand[1942]: src/agent.c:set_default_agent() default agent cleared

It seems that it gets disconnected almost immediately. I would expect to
disconnect using the unregister method. So I have the following questions


   1. Is there something else that I have to do in the registration of the
   agent ?
   2. Is there something else in general that I have to do ?
   3. Do I do something wrong using the dbus-send commands ?


I know that the dbus-send utility it's not the best thing in order to test
connman, because there are function signatures that have nested containers
which are not supported by dbus-send. But it's the quickest way to test the
functionality parts of connman. I know also that there are a number of
python tests and utilities, but in the embedded system that I use it's not
installed.

Any help appreciated.

Kind regards,

Stavros
_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to