# Over the air updates failing

**URL:** <https://forum.legato.io/t/over-the-air-updates-failing/3383>\
**Category:** Legato Application Framework\
**Created:** [June 27, 2018, 6:02pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383 "2018-06-27T18:02:59Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [June 27, 2018, 6:02pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/1 "2018-06-27T18:02:59Z")

</div>

Hey all,

I’ve been trying to update my target using AirVantage. I’ve managed to get my bundle uploaded, released, and published. Unfortunately every time I try to install it on a device, we receive ` Read operation failure [legato.1.0.3: BAD_REQUEST,legato.1.0.5: BAD_REQUEST]` in return (shown below).

 ![41%20AM](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/a20a6a1d8e1c93c5d7960d7b24ee0577c08387ca.png)

Has anyone seen this before or have any ideas?

Cheers!

---

<div class="post-metadata">

**Author:** ![FrancisDuhaut](https://avatars.discourse-cdn.com/v4/letter/f/f0a364/32.png) [@FrancisDuhaut](https://forum.legato.io/u/FrancisDuhaut)\
**Post date:** [June 27, 2018, 6:48pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/2 "2018-06-27T18:48:14Z")

</div>

@nvd

No I can update easily my target. For the moment only the apps (not try with a bundle).

Do you have a avcController in charge of the update ? If you use the WP85 with légato 17 or higher you must modify the app attached per default to the wp85. I will share you the file tomorrow.

Francis

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [June 27, 2018, 8:59pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/3 "2018-06-27T20:59:42Z")

</div>

Hey Francis,

I have completed this step as per our previous discussion on a forum post. My guess would be this is failing when it reaches the target. I tried this with individual apps instead of a bundle and I got this error: `Upgrade failure [Invalid Update State value: 0]`.

---

<div class="post-metadata">

**Author:** ![FrancisDuhaut](https://avatars.discourse-cdn.com/v4/letter/f/f0a364/32.png) [@FrancisDuhaut](https://forum.legato.io/u/FrancisDuhaut)\
**Post date:** [June 27, 2018, 9:32pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/4 "2018-06-27T21:32:59Z")

</div>

AVCController is needed for firmware update.  
You can use my source code.

Look on this topic

> **[Install application from airvantage](https://forum.mangoh.io/t/install-application-from-airvantage/1002)**
>
> Hello Have several mangoh Red with WP8548 (SWI9X15Y\_07.12.09.00) and have to get the “install application” or “install bundle” to work from airvantage. Have followed the Getting started and installed redSensorToCloud. Have registered the module on...

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [June 27, 2018, 9:37pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/5 "2018-06-27T21:37:28Z")

</div>

Hey Francis,

Thanks again for the help. I have an avcControl app running to receive the update. I’ll post some logs to show what it’s doing.

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [June 27, 2018, 9:52pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/6 "2018-06-27T21:52:54Z")

</div>

Hey all,

I captured some logs of the system trying to apply the update ([avcupdate.log · GitHub](https://gist.github.com/nvandoorn/78c68484aa95a49782b62b03e98079e8)). Not sure how much of this is expected/normal.

---

<div class="post-metadata">

**Author:** ![esun](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@esun](https://forum.legato.io/u/esun)\
**Post date:** [June 27, 2018, 11:05pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/7 "2018-06-27T23:05:02Z")

</div>

Hi,

What version of legato are you using? If you are using legato \> 16.10 which is AVC2 ([AirVantage 1.0 to 2.0 Migration - Legato Docs](https://docs.legato.io/latest/avMigration.html)), the LWM2M\_LEGATO\_SYSTEM\_UDPATE feature is no longer supported (OTA update using the \*.update).

However you can still update your system through FOTA (Bundling mechanism). Instead of using the \*.update file, you’ll be using the legatoz.cwe file in your build directory.

Here is an example of a FOTA package used to update a legato system (assuming the version is 18.04.0\_612aee16f4e1ar736d…).

```auto
<?xml version="1.0" encoding="UTF-8"?>
<app:application xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0" name="nick_bundle" revision="LE=18.04.0_612aee16f4e1ar736d2" type="WP7603-1">

    <binaries>
        <binary file="legatoz.cwe" type="FULL"/>
    </binaries>

    <application-manager use="LWM2M_AIRPRIME_BUNDLE"/>
  

</app:application>

```

Note: The type field must match your “Firmware” linked to your device. You can check what is it by going to Inventory-\>Systems-\>(Your device) and under “Firmware” click on the highighted package.

To perform a bundle update on the server, go to Monitor-\>Systems-\>(Your device) and under More-\>Install Bundle.

Enoch

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [June 28, 2018, 4:59pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/8 "2018-06-28T16:59:34Z")

</div>

Thanks for the details @esun. I’ll try and give this a go by the end of the day.

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 2, 2018, 8:41pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/9 "2018-07-02T20:41:00Z")

</div>

Hey @esun,

Updating using the `.cwe` bundle failed with the same error code I described here: [Over the air updates failing - #3 by nvd](https://forum.legato.io/t/over-the-air-updates-failing/3383/3). It seems our targets are missing some file/configuration required for updates (see here [avcupdate.log · GitHub](https://gist.github.com/nvandoorn/78c68484aa95a49782b62b03e98079e8))

---

<div class="post-metadata">

**Author:** ![esun](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@esun](https://forum.legato.io/u/esun)\
**Post date:** [July 16, 2018, 5:53pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/10 "2018-07-16T17:53:09Z")

</div>

Can you check that the firmware model linked to your device is for AVC2 (Inventory-\>Systems-\>(Your device) and under “Firmware” click on the highlighted package.

The firmware model xml should contain the following lines under the communication tags

```auto
        <communication>
            <protocol comm-id="IMEI" type="LWM2M">
                <parameter name="dtls" value="psk"/>
                <parameter name="version" value="core=1_0-20151214,sw=1_0-20151201"/>
            </protocol>
        </communication>

```

If it does not then the device is currently using an AVC1.0 firmware model.

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 17, 2018, 4:14am UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/11 "2018-07-17T04:14:48Z")

</div>

Hey @esun,

My apologies for letting this sit. @prushp made the same suggestion and it’s been working great. Thanks so much for the help!

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 22, 2018, 9:59pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/12 "2018-07-22T21:59:51Z")

</div>

Hey @esun,

I’m still looking for a way to push system updates in some way. I tried your suggestion but it’s been a bit of a versioning nightmare. The target always reports the the Legato version as the 3 digit version (`18.04.0` in my case), so this is the version that must be specified in `manifest.app` for this to work. I tried simply specifying `18.0.4` in my manifest file, but in this case the target assumes it’s already up to date and does not install the update. I then tried tagging my own versions of Legato (confirmed this worked by running `legato version` on the target after applying over micro USB), but this seemed to confuse the `avcService` and caused it to lock up.

Generally speaking, app updates work well, but this does not really cover cases where some major changes have been made (e.g when renaming or deleting a service). Also note that the service I need to delete was not installed through AirVantage so it does not list show it in the web interface (see below).

 ![28%20PM](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/1924ab56f09b6a5ca324846f5bad232220b1096c.png)

---

<div class="post-metadata">

**Author:** ![prushp](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/prushp/32/408_2.png) [@prushp](https://forum.legato.io/u/prushp)\
**Post date:** [July 23, 2018, 5:17pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/13 "2018-07-23T17:17:17Z")

</div>

Hi @nvd, you have to sync the server and device to reflect apps installed on the devices etc., (system applications). Click sync button on server to know what apps are installed. I guess you need to change the legato version in /mnt

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 23, 2018, 5:21pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/14 "2018-07-23T17:21:15Z")

</div>

Thanks @prushp. I’m assuming I need to upload these apps to AirVantage (at the correct version) in order for this to work and for these messages to disappear?

 ![07%20AM](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/eacae523336b96cb4c7f971c744558d441e94336.png)

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [January 17, 2019, 1:39pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/15 "2019-01-17T13:39:18Z")

</div>

Hi @nvd  
yes you’re right,  
best regards,

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [January 17, 2019, 8:02pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/16 "2019-01-17T20:02:57Z")

</div>

Hey all,

I’ve since upgraded to Legato 18.10.02 on release 16.1 of the WP85 firmware.

I’ve created a custom firmware bundle (`.spk`) using the modem firmware, MCU firmware, and Linux Distro bundled with release 16.1 for the WP85. The Legato system is custom and was concatenated using `systocwe` and `swicwe`.

I seem to be getting a new error:

 ![44%20AM](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/52bd2257a79bf2f1f345569d3c0b232344ed7991.png)

Furthermore this process seems to have taken my unit offline as well.

---

<div class="post-metadata">

**Author:** ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)\
**Post date:** [August 16, 2019, 7:29am UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/17 "2019-08-16T07:29:07Z")

</div>

Hi @nvd did you ever get SOTA and FOTA working?

I’m getting the legato.1.0.3 BAD\_REQUEST attempting SOTA as well.  
app install and FOTA works apart from the Legato version showing only 3 digits…

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [August 16, 2019, 5:58pm UTC](https://forum.legato.io/t/over-the-air-updates-failing/3383/18 "2019-08-16T17:58:30Z")

</div>

Hey @nilsa,

I don’t really work on Legato anymore or use AirVantage so I’m not super helpful here.

Almost all of my issues related to updates stemmed from version mismatches. It was such a pain that I did some questionable bash scripting to generate bundles for AirVantage.

@dbeckwith inherited this code from me so he may be able to help.
