Massive CPEs upgrade

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:

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:

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

Presets:

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.

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

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.


For the item Software version in the 1.2:

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

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

1 Like

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