0

problems of ConfigSample between AJTC and AJSC(Arduino+ linux x86)?

asked 2014-04-28 19:21:27 -0700

0502lian gravatar image

updated 2014-05-20 10:46:56 -0700

bspencer gravatar image

Hi, the ConfigSample code is sample_apps/ConfigSample.c ( https://git.allseenalliance.org/cgit/services/base_tcl.git/tree/sample_apps/ConfigSample.c ) It ran on the Arduino, I think it is a config service.

The config client ran on linux( https://git.allseenalliance.org/cgit/services/config.git/tree/cpp/samples/ConfigClientSample/ConfigClientMain.cc )

but they can not find each other.

in the configSample.c

define ROUTER_NAME "org.alljoyn.BusNode"

so it tries to connect to busname of "org.alljoyn.BusNode", but there is on other bus with org.alljoyn.BusNode.

In the AJSC, config client makes use of the Alljoyn About Feature. (The AboutClient sample makes use of the AllJoyn About Feature. The About Feature allows for service level discovery by means of an AllJoyn sessionless signal. A sessionless signal is a feature that allows the publication of an AllJoyn signal without needing to explicitly join a session.The discovery, join, disconnect is all handled internally in the AllJoyn Router software.)

The configSample on AJTC is also use AboutClient, why does it connect to a specific busname "org.alljoyn.BusNode"? what can I do to let them find each other? run another Daemon on the linux(AJSC)?

Thanks a lot.

ps : my network is ok between Arduino and Pc linux, because I run ledctrl demo sucessfully between them.

New Issue:

I run al AllJoyn Standard Client daemon, And it worked. But there is still some problems. Like

while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok status == AJ_ERR_TIMEOUT AJ_CloseMsg(&msg) while() AJApp_ConnectedHandler() AJApp_ConnectedHandler() is ok isUnmarshalingSuccessful 277.446 aj_msg.cpp:1289 AJ_UnmarshalArgs(): AJ_ERR_UNMARSHAL AJApp_MessageProcessor 277.454 aj_msg.cpp:658 Unmarshal(): AJ_ERR_END_OF_DATA AJ_BusHandleBusMessage(&msg) AJ_CloseMsg(&msg)

The code is:

    AJ_Printf("while()\n");
    status = AJ_OK;
    serviceStatus = AJSVC_SERVICE_STATUS_NOT_HANDLED;

    if (!isBusConnected) {
        AJ_Printf("is not BusConnected\n");
        isBusConnected = AJRouter_Connect(&busAttachment, ROUTER_NAME);
        AJ_Printf("is trying BusConnecting\n");
        if (!isBusConnected) { // Failed to connect to daemon.
            AJ_Printf("continue trying BusConnected\n");
            continue; // Retry establishing connection to daemon.
        }
    }

    status = AJApp_ConnectedHandler(&busAttachment);
    AJ_Printf("AJApp_ConnectedHandler()\n");
    if (status == AJ_OK) {
        AJ_Printf("AJApp_ConnectedHandler() is ok\n");      

        status = AJ_UnmarshalMsg(&busAttachment, &msg, AJAPP_UNMARSHAL_TIMEOUT);
        isUnmarshalingSuccessful = (status == AJ_OK);

        if (status == AJ_ERR_TIMEOUT) {
            AJ_Printf("status == AJ_ERR_TIMEOUT\n");
            if (AJ_ERR_LINK_TIMEOUT == AJ_BusLinkStateProc(&busAttachment)) {
                AJ_Printf("AJ_ERR_LINK_TIMEOUT\n");
                status = AJ_ERR_READ;             // something's not right. force disconnect
            }
        }

        if (isUnmarshalingSuccessful) {
            AJ_Printf("isUnmarshalingSuccessful\n");
            if (serviceStatus == AJSVC_SERVICE_STATUS_NOT_HANDLED) {
                serviceStatus = AJApp_MessageProcessor(&busAttachment, &msg, &status);
                AJ_Printf("AJApp_MessageProcessor\n");
            }
            if (serviceStatus == AJSVC_SERVICE_STATUS_NOT_HANDLED) {
                //Pass to the built-in bus message handlers
                status = AJ_BusHandleBusMessage(&msg);
                AJ_Printf("AJ_BusHandleBusMessage(&msg)\n");
            }
            AJ_NotifyLinkActive();
        }
        AJ_Printf("AJ_CloseMsg(&msg)\n");
        //Unmarshaled messages must be closed to free resources
        AJ_CloseMsg(&msg);
    }

    if (status == AJ_ERR_READ || status == AJ_ERR_RESTART || status == AJ_ERR_RESTART_APP) {
        AJ_Printf("status == AJ_ERR_READ || status \n");
        if (isBusConnected) {
            AJApp_DisconnectHandler(&busAttachment, status != AJ_ERR_READ);
            isBusConnected = !AJRouter_Disconnect(&busAttachment, status ...
(more)
edit retag flag offensive close merge delete

Comments

Which .ino file did you use to run the ConfigSample.c source code?

alphaemmeo ( 2014-04-30 09:35:56 -0700 )edit

Can you please provide the interface that you are using? Odds are you are trying to marshal an incorrect return value into a method that is not set up to return a value. Please see this posting that encountered the same error: https://ask.allseenalliance.org/question/143/thin-client-error_-about-aj_marshalargs/

bspencer ( 2014-05-20 10:48:38 -0700 )edit

to Alphaemmeo. a .ino file just like AJ_LedService.ino

0502lian ( 2014-05-20 19:12:05 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-04-29 14:36:12 -0700

mitchw gravatar image

A thin client application needs a standard client daemon (also referred to as a "router" or "routing node") running on the same network that it can discover and connect to, as described here in order to properly function.

What appears to be happening is that the Config Sample application you're running on the Arduino is not able to find a standard client daemon to connect to.

Are you running an AllJoyn Standard Client daemon on your Linux machine? If so, can you try following these instructions to setup the config.xml file used by the daemon, and then re-run your applications. The daemon config file specified in those instructions has a specific entry to advertise the daemon prefix that all of the thin client samples look for, "org.alljoyn.BusNode".

edit flag offensive delete publish link more

Comments

Thanks a lot!!

0502lian ( 2014-05-20 19:10:04 -0700 )edit

hi 0502lian ... if this answered your question, please mark it as answered. thanks!

waynelee ( 2014-05-22 11:18:30 -0700 )edit
Login/Signup to Answer

Stats

Asked: 2014-04-28 19:21:27 -0700

Seen: 236 times

Last updated: May 20 '14