# Massive CPEs upgrade

**URL:** <https://forum.genieacs.com/t/massive-cpes-upgrade/2114>\
**Category:** Uncategorized\
**Created:** [October 20, 2021, 8:34pm UTC](https://forum.genieacs.com/t/massive-cpes-upgrade/2114 "2021-10-20T20:34:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seteBR](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@seteBR](https://forum.genieacs.com/u/seteBR)\
**Post date:** [October 20, 2021, 8:34pm UTC](https://forum.genieacs.com/t/massive-cpes-upgrade/2114/1 "2021-10-20T20:34:47Z")

</div>

I’m trying to build a routine to upgrade some CPEs but i can’t find a way to start the process.

Provision firmware-upgrade:

```auto
const TAG_UPGRADE = "Tags.upgrade";
const TAG_UPGRADING = "Tags.upgrading";

const REQ_VERSION = "S3.1.320.img";

if (declare(TAG_UPGRADE, {value: 1}).value !== undefined) {
 // remove upgrade tag
 declare(TAG_UPGRADE, null, {value: false});
 commit();
 // retrieve CPE software version
 let REP_VERSION =
declare("InternetGatewayDevice.DeviceInfo.SoftwareVersion", {value:
Date.now()}).value[0];
 // make sure versions do not match
 if (REP_VERSION !== REQ_VERSION) {
 // append upgrading tag (will be removed in firmware-upgrade-complete)
     declare(TAG_UPGRADING, null, {value: true});
     commit();
     // request upgrade
     declare("Downloads.[FileType:1 Firmware Upgrade Image]", {path:
1}, {path: 1});
     declare("Downloads.[FileType:1 Firmware Upgrade Image].FileName",
{value: 1}, {value: REQ_VERSION + ".web"});
     declare("Downloads.[FileType:1 Firmware Upgrade Image].Download",
{value: 1}, {value: Date.now()});
 }
}

```

Provision firmware-upgrade-complete:

```auto
const TAG_UPGRADING = "Tags.upgrading";
declare(TAG_UPGRADING, null, {value: false});

```

Presets:

 ![Screenshot from 2021-10-20 17-26-31](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/f77e877f937ebd8124adc5862d8bd7c05762b18e.png)

firmware-upgrade-complete  
Events = 7 TRANSFER COMPLETE  
Precondition = Tag = upgrading  
Provision = firmware-upgrade-complete

The CPEs are online but still the upgrade won’t start.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [October 21, 2021, 1:56am UTC](https://forum.genieacs.com/t/massive-cpes-upgrade/2114/2 "2021-10-21T01:56:59Z")

</div>

You’re precondition is invalid. Try this: `Tags.upgrade IS NOT NULL`

---

<div class="post-metadata">

**Author:** ![seteBR](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@seteBR](https://forum.genieacs.com/u/seteBR)\
**Post date:** [October 29, 2021, 8:09pm UTC](https://forum.genieacs.com/t/massive-cpes-upgrade/2114/3 "2021-10-29T20:09:16Z")

</div>

I did try, but the provision still won’t start.  
Looking at an old config of mine I got some insights in what to do and why the issue to start the provision.  
But I’m still in a learning mode to port the old config to the 1.2 version.

 ![preset_start](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/383faa76fde411a951a38364f5fccb5658cd2d92.png)  
For the item Software version in the 1.2:

```auto
DeviceID.ProductClass = "ZNID24xxA_GR" AND DeviceID.OUI = "000271" AND DeviceInfo.ModelName = "ZNID-GPON-2426A-EU"

```

I’m still in need of a way to check versions numbers (`DeviceInfo.SoftwareVersion != "S3.1.331" won't worked`).  
For the Configuration: I need to add that tag ‘ToUpgrade’ too and till now I didn’t find a way to do it with the 1.2.5+ GUI.  
Regards,  
F

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [October 29, 2021, 8:13pm UTC](https://forum.genieacs.com/t/massive-cpes-upgrade/2114/4 "2021-10-29T20:13:11Z")

</div>

Syntax is based on SQL. So use `<>` instead of `!=`

---

<div class="post-metadata">

**Author:** ![seteBR](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@seteBR](https://forum.genieacs.com/u/seteBR)\
**Post date:** [November 5, 2021, 9:05pm UTC](https://forum.genieacs.com/t/massive-cpes-upgrade/2114/5 "2021-11-05T21:05:07Z")

</div>

Thanks again. `<>` did work.  
I solved the Tag question creating a new preset to do the filter and Tag task.
