Problems when running le_avc interface, WP7702 will not connect to the airVantage server

We have almost finalized our application and we are now testing how we can update the software from remote, we would like to use the FOTA functionality and this should go through the le_avc interface.

Have tried to implement this using a sample code from the legato github:
legato-af/apps/sample/avcControl/avcControl/
// Register AirVantage status report handler. This makes this app “control app”.
le_avc_AddStatusEventHandler(StatusHandler, NULL);

// Start an AVC session at least once.
LE_ASSERT(LE_FAULT != le_avc_StartSession());

The handler will return the following:
Air Vantage agent reported update status: AUTHENTICATION_STARTED
Air Vantage agent reported update status: AUTHENTICATION_FAILED
Air Vantage agent reported unexpected update status: 16
Air Vantage agent reported update status: SESSION_STOPPED

And after a while also our application will stop sending data to our backend.
Our application is using the le_mdc interface to start the data connection, we are using profile 2 as using profile 1 was giving odd returns from the status change handler function.

So, my question is if the airVantage is already using the le_mdc and if this has to be on a specific profile i.e. if our app is using the profile 2, then running the airVantage which is using the profile 1 will get the modem to stop working…

you can try AT command +WDSS first instead of the avcControl app when using your application to send data on profile 2.
This can isolate if problem related to avcControl only.

It does seems that the airVantage app will use the profile 1 of the cm data to attempt to connect with the server, I have bypassed everything in my app and just running the two commands:
le_avc_AddStatusEventHandler(StatusHandler, NULL);
le_result_t result = le_avc_StartSession();

The app keeps restarting due to the socket hanging up:
Attempt to run the airVantage
Air Vantage agent reported update status: AUTHENTICATION_STARTED
LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (INFO | supervisor[3428]/supervisor T=main | proc.c proc_SigChildHandler() 2050 | Process ‘mqttClient’ (PID: 10049) has exited with exit code 1.
Process ‘mqttClient’ in app ‘mqttClient’ faulted: Restarting process.

I see the profile 1 for the cm data is connected and I can ping the eu.airvantage.net, still the target cannot authenticate, is there anything else I need to do?
The target has been registered in the portal as well.

Can you stop the mqttclient and retry?

Btw, did you stop firewall?

Did you unsandbox the app?

I am now using the avcControl sample app, and yes, the mqttClient wasn`t in a sandbox.
How do you stop the firewall?

I mean stop the mqttclient and just run avccontrol app.

You can shutdown the firewall by
iptables -I INPUT -j ACCEPT

I am running the avcControl app now and not mine, it seems that the app will start the connection on profile 1, modem will connect and I can also ping the eu.airvatnage.com endpoint.
However the airVantage will not authenticate and the status result is
(LE_AVC_CONNECTION_REQUIRED = 16).
I have also run the command from shell for shutting down the firewall and that didn`t help.

However if I stop the app, start the connection through the cm data tool, then start the app, the target will authenticate to the airVantage backend.

What is the reason for this? Possibly without asking to go through the cm data implementation to check what it physically does…

but seems that is the easiest way for you now.

is there anyone you can escalate this issue with internally?
Someone who knows more about this legato framework?

I think problem seems to be on your application as you already confirmed cm data does not have problem

I am not using my application but the sample app, so the question if you can escalate this internally to seek feedback.

which sample application are you talking about?
Modemdemo to establish data connection?
Suggest you porting the cm data code to your “sample” application.
Or you can call “cm data connect” with system() API for unsandboxed application.

there is a specific note on legatos docs NOT TO USE the cm data app from other apps. Beside this, I am checking the cm_data.c source and this differs from the github repository. In my $LEGATO_ROOT I dont have the le_dcs.api which I assume is something for a later revision of the hardware.

In the cm_data.c which I have in my legato profile, the le_mdc is used with the same result, so to say, I have data communication as I can post a JSON file to our backend, I can even ping the eu.airvantage.net but for some reason the server returns the “16” value for data connectivity

if you don’t want to use cm data, you can try modemdemo sample to establish data connection.