Install app with UPDATE API


#1

Hello I am trying to install helloworld app on my wp76 module with Legato update API but with no luck. This is my sample code :

COMPONENT_INIT
{
    const char* filename = "/mnt/flash/updateFiles/HelloWorld.wp76xx.update";
    int fd = open(filename, O_RDONLY);

    if (fd == -1)
    {
    	LE_INFO("Can't open file");

    }

    le_result_t result = le_update_Start(fd);

    if (result != LE_OK)
    {
    	LE_INFO("FAIL");
        exit(EXIT_FAILURE);
    }
}

When I run this code I get this output:

Dec 24 17:21:55 | avcControl[2068]/framework T=main | LE_FILENAME unixSocket_SendMsg() 441 | Sending fd 9.
Dec 24 17:21:55 | updateDaemon[803]/updateDaemon T=main | updateDaemon.c le_update_Start() 2026 | Update request accepted.
Dec 24 17:21:55 | updateDaemon[2069]/framework T=main | LE_FILENAME user_Create() 1370 | Created user 'SecurityUnpack' with uid 1002 and gid 1002.
Dec 24 17:21:55 | updateDaemon[803]/updateDaemon T=main | updateUnpack.c JsonErrorHandler() 321 | Error reading update pack (Read error flags set: POLLHUP (at line 1))
Dec 24 17:21:55 | updateDaemon[803]/updateDaemon T=main | updateDaemon.c UpdateFailed() 419 | Update failed!!

Can somebody help me resolve this issue?


#2

Did you try "update /mnt/flash/updateFiles/HelloWorld.wp76xx.update"on uart console?
If it works, you can refer to the code in legato framework.


#3

Thank you for reply @jyijyi
When I SSH to board and execute command you mentioned I get the same error, but I am able to install app when I am not SSH-ed to board with console with sourced toolchain and exported DEST_IP.
Do you know how can I install app with uart console?
Thank you


#4

You just need to enter "update /mnt/flash/updateFiles/HelloWorld.wp76xx.update"on uart console.


#5

@jyijyi I get this:


#6

Update file was not good. Solution was to build update file with mkapp in console and not in Developer Studio