Problem with missing bindings on the target


#1

Hi all,

I’m using the latest legato dev studio 4.1.1 legato version 16.01 - 16.07 to build an app based on the modem demo template on a mangoh, running in a linux VM. I’ve added a component to talk to the Air Vantage interface and I’m trying to bind an interface between the modem and AV components. The modem part works fine and the AV part also works fine on it’s own, the problem is the AV component doesn’t run on the target when both components are in the same app. the developer studio shows this error:

Process 192.168.2.2/project_name/AVIF has 1 missing bindings:
Missing bindings:
Client ID: something.something.AVInterface.setValue
ProtocolID: some_big_hex_number_like_a_uuid
ServiceID: something.something.demomodem.setValue

However, the binding is definitely there in the adef file, the api is listed in the relevant provides and requires sections for each component, the api file and function is there and shows up in the interfaces.h file, the project settings are correct as far as I can tell. There are no errors or warnings during the build process, not a clue that anything is wrong apart from the error about missing bindings above. In short, everything looks correct as per the “hello greet” example in the docs.

There is one line in the documentation here that hints at some issues:

If client-side code was built using the ifgen tool or mkcomp or mkexe with requires or bundles sections, the tool reading your .adef file won’t know about the client-side interface. Use a special work-around to bind those interfaces:

bindings:
{
.le_data -> dataConnectionService.le_data
}
This would bind any unknown client-side le_data interfaces in the current app to the le_data server-side interface on the dataConnectionService app.

But when I try adding a name preceded by a dot the compiler complains I’m using an invalid character and only a-z, numbers, underscores etc. are allowed, so the above workaround doesn’t actually work.

The strangest thing is, that the binding used in the modem demo app itself doesn’t have any problems, but then the client/server directories in the Target_Legato_Debug/api directory are there already for that interface. I checked and the uuid named directory given as the missing protocol isn’t there in my build.

Any clues folks ?


#2

Hi,
Can you share your complete code?
It is difficult to help without looking at the code.
regards,
Ashish


#3

Hi there,

here is my complete code…it’s a .tar.gz

happytunasproject (2.1 MB)

btw, the code will not compile - I took out some port & address settings in modem.c, you’d have to insert some dummy ones to get it to build if you need to. Thanks !


#4

This problem is now getting pretty strange and serious because it’s stopping any development.

I switched to the windows legato ide and although I keep getting the reported missing bindings, ipc works and I can communicate between components.

But now I’m trying to bind to the config tree apis le_cfg and le_cfgAdmin, so not even my own api’s. I get the same missing bindings errors but just on one of the apis, not both of them. And now my app doesn’t initialize, it runs and just hangs before it gets to COMPONENT_INIT


#5

Right, so using this kind of syntax in the .adef file

*.le_cfg -> <root>.le_cfg

seems to make the problems go away…but it’s not in any of the documentation or sample codes…


#6

Hi,

to help understand what’s going wrong when you get troubles with bindings, you can run sdir list on the device.
(This is notably what is parsed by Developer Studio to send you the notifications)


#7

Thanks for the reply…so when sdir lists waiting clients, what exactly are the clients waiting for ? When you create an api, do you have to have a _ConnectService type of call ? The clients - my components - are blocked from running but it’s not clear what’s missing from my server component - the server component doesn’t appear in the sdir list even though the api exists in the provides section of the cdef…


#8

Unless you use the [manual-start] option in your component requires: api: section, you’re not supposed to connect to the service by yourself.
Each api that required must be bound to an api provided by someone else; but by looking rapidly at the sample you gave, it looks like this is something you understood correctly.

Please can you provide the simplest sample you have to highlight your issue, and please can you dump here an example of what is returning sdir list?
Having a look at the logs when the app is about to start could help as well.


#9

Ok, great, I will try to highlight the issue:

First, one component is proving an api:

provides:

{
api:
{
send = send_util.api
sendData = sendData.api
setConnection = setConnectionType.api
}
}

The adef contains the bindings for these apis:

AVIF.AVInterface.setConnection -> modem.modem.setConnection
Serial.SerialIO.sendData -> modem.modem.sendData

The relevant calling functions in the api are implemented and the interface, server, client files are all generated, the app compiles, the only warnings are the permitted unused pack functions which are generated. Sdir list correctly shows the bindings:

<root>.Serial.SerialIO.sendData -> <root>.modem.modem.sendData
<root>.AVIF.AVInterface.setConnection -> <root>.modem.modem.setConnection

BUT: in the SERVICES section of sdir, there is no listing for my services - I would expect something like:
.modem.modem.sendData (protocol ID = ‘xxxxxxxxxxxxxxxxxxx’, max message size = 1104 bytes)

And, there is a WAITING CLIENTS list:

WAITING CLIENTS

    [pid   501] <root>.AVIF.AVInterface.setConnection WAITING for <root>.modem.modem.setConnection  (protocol ID = '80142e41fb4a5776b217dd2f55d3f29e')
    [pid   499] <root>.Serial.SerialIO.sendData WAITING for <root>.modem.modem.sendData  (protocol ID = 'd3c568e9fb5b9a29d0d43342bf9d6efd')

The interesting thing is that the serial process works anyway, maybe because it’s bound to a port and gets woken by an interrupt or because I am calling _ConnectService().

But the avinterface component, although it does start off the legato services it binds to, never enters the component_init part…

The legato log shows that things should be ok: the component is running:

_componentMain.c _AVInterface_Init() 38 | Initializing AVInterface component library

and even the server is running:

sendData_AdvertiseService() 338 | ======= Starting Server modem.modem.sendData ========
setConnection_AdvertiseService() 338 | ======= Starting Server modem.modem.setConnection ========

but I assume this just verifies the code is running but something is still missing for the supervisor to connect the client to the service, otherwise the service would appear in the sdir list


#10

Mmmm… hard to analyze…
Please could you post your app here?