AJ_StartService(): connect failed

asked 2014-11-10 09:08:50 -0700

germanviscuso gravatar image

This is a weird problem. I've been playing with the Thin Client demo for Arduino Due and Ethernet Shield (the led flash service). It was working fine until yesterday, now suddenly the thin client won't connect anymore:

Reminder: Object not yet added to the ObjectList, do not forget to call RegisterObjects
<node name="/org/alljoyn/sample/ledcontroller">
<interface name="org.alljoyn.sample.ledcontroller">
  <method name="Flash">
    <arg name="msec" type="u" direction="in"/>
  <method name="On">
  <method name="Off">
000.000 aj_helper.cpp:285 AJ_StartService(): connect failed: sleeping for 10 seconds
011.007 aj_helper.cpp:285 AJ_StartService(): connect failed: sleeping for 10 seconds
022.014 aj_helper.cpp:285 AJ_StartService(): connect failed: sleeping for 10 seconds
033.021 aj_helper.cpp:285 AJ_StartService(): connect failed: sleeping for 10 seconds

I can confirm that the device is being granted an IP via DHCP (I print out that info to the serial port). In order to connect to it I'm using a ledctrl program in C that used to come with previous versions of AllJoyn (but it was working for me just fine).

How can I determine what the problem is?

Looks like:

status = AJ_StartService(&bus, DaemonServiceName, CONNECT_TIMEOUT, FALSE, ServicePort, ServiceName, AJ_NAME_REQ_DO_NOT_QUEUE, NULL);

never returns, it just sit in the retry loop so I don't know the value of "status".

BTW the thin client demo sketch hasn't been modified (it's the one you find in the thin client source) except for a few debugging messages that I send to the serial port.

Best. Thx a lot.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-11-10 15:40:06 -0700

bspencer gravatar image

The error is occurring because the AJTCL is unable to find the AllJoyn Router (alljoyn-daemon process or application that has the Routing software bundled). If you are running this on a VM on your machine, please double check that the VM has the same subnet (Bridge mode) as the host. If this is on a machine in the network that is running the ledctrl program double check that your firewall rules are not blocking the setup.

Another thing you can do is run the AllJoyn On application on Android which will advertise a BusNode for an AllJoyn Thin Core Library application to connect to.

edit flag offensive delete publish link more


This is strange because with the same setup I was talking to the thin client (a few days ago). I still have the same problem, this is what I did: - Opened AllJoyn On app connected via wi-fi to my home network - Started the Thin Client (it's wired to the same network). No joy (same error described above) - Turned on my Raspberry Pi, runs a dedicated AllJoyn daemon, and the SinkService (wired to my home network). AllJoyn ON sees the service immediately but still, the thin client won't connect. - Turn off/on the thin client just in case, but nothing. This is strange because there are certainly working daemons in the network. And as I said I was connecting to the Raspberry daemon just fine two days ago. The only thing that changed is that I started using AllJoyn ON on the network. Best! Thx for the tips.

germanviscuso ( 2014-11-11 08:53:20 -0700 )edit

Please also check that you are running AJTCL 14.06a on the Arduino. AJTCL 14.06 had some known compatibility issues with older RNs, which may be the case if you have an older version of AllJoynOn.

waynelee ( 2014-11-13 10:44:04 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-11-10 09:08:50 -0700

Seen: 246 times

Last updated: Nov 10 '14