Questions on presets / Firmware upgrade

George Chelidze george.chelidze at magticom.ge
Fri Apr 27 09:20:00 EDT 2018


Hi,

I am currently working on firmware upgrade which doesn't work (in some
cases) so I though I don't fully understand how presets work.
Below are some question on presets which will help me to narrow down the
problem.

Suppose I have 4 presets:

refresh-device-info: Events = <empty>
refresh-device-info-once: Events = <empty>
firmware-upgrade: Events = 1 BOOT
firmware-upgrade-complete: Events = 7 TRANSFER COMPLETE

Channel = <empty>, Weight = <empty>, Schedule = <empty> for all of them.

and 3 provisions:

refresh-device-info-once
firmware-upgrade
firmware-upgrade-complete

Here are corresponding configuration:

Presets
----------

refresh-device-info:
--
Refresh InternetGatewayDevice.ManagementServer every |28800| seconds
Refresh InternetGatewayDevice.DeviceInfo.SoftwareVersion every |28000|
seconds
Refresh InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID
|28800| seconds
Refresh InternetGatewayDevice.DeviceInfo.UpTime every |<empty>| seconds
--

refresh-device-info-once:
--
Provision name: refresh-device-info-once Arguments: |<empty>|
--

firmware-upgrade:
--
Events: 1 BOOT

Precondition: Tag = upgrade

Configurations

Provision name: firmware-upgrade Arguments: |<empty>|
--

firmware-upgrade-complete:
--
Events: 7 TRANSFER COMPLETE

Precondition: Tag = upgrade

Configurations

Provision name: firmware-upgrade-complete Arguments: |<empty>|
--

Provisions
-------------

refresh-device-info-once:
--
declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1});
declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value: 1});
--

firmware-upgrade:
--
const tag = "Tags.upgrade";
const filename = "V3.2.0-B20180412.1617.web";

let serial = declare("DeviceID.SerialNumber", {value: 1}).value[0];
let tagged = declare(tag, {value: 1});

if (tagged !== undefined && tagged.value !== undefined) {
  log("CPE upgrade requested. serialNumber = " + serial);
  declare("Downloads.[FileType:1 Firmware Upgrade Image]", {path: 1},
{path: 1});
  declare("Downloads.[FileType:1 Firmware Upgrade Image].FileName",
{value: 1}, {value: filename});
  declare("Downloads.[FileType:1 Firmware Upgrade Image].Download",
{value: 1}, {value: Date.now()});
} else {
  log("CPE upgrade requested, but it's not tagged, ignored. serialNumber
= " + serial);
}
--

firmware-upgrade-complete:
--
const tag = "Tags.upgrade";
declare(tag, null, {value: false});
declare("Reboot", null, {value: Date.now()});
--

Here are my questions:

1. In case of 1 BOOT event will refresh-device-info and
refresh-device-info-once presets execute? Will they execute one after
another, or only the first preset which matches for event and
precondition is executed?

2. What is Channel used for?

3. How exactly weights work? I've found the following explanation by
Zaid: Preset weight only matters when you have two or more presets with
overlapping configurations. In case of 1 BOOT event refresh-device-info,
refresh-device-info-once and firmware-upgrade will be executed (depends
on answer for question #1) and all of them contain different
configurations - are they overlapping?

4. Empty events field contains the following hint: e.g. "1 BOOT, -0
BOOTSTRAP". What does "-0 BOOTSTRAP" means? Does it means "any event
except 0 BOOTSTRAP"?\

5. If we put two events separated by comma (1 BOOT, 2 PERIODIC), will a
preset be executed in case of any of these events of both events should
be present as in the following example:

<Event SOAP-ENC:arrayType="cwmp:EventStruct[2]">
    <EventStruct>
        <EventCode>1 BOOT</EventCode>
        <CommandKey></CommandKey>
    </EventStruct>
    <EventStruct>
        <EventCode>M Reboot</EventCode>
        <CommandKey></CommandKey>
    </EventStruct>
</Event>

6. For refresh-device-info preset, what happens if
InternetGatewayDevice.LANDevice.1.WLANConfiguration.1 instance doesn't
exist? Will it fail? and will InternetGatewayDevice.DeviceInfo.UpTime
update after that?

7. How Arguments fields can be used for Provision in presets? Should it
contain static arguments or any kind of substitution like
${InternetGatewayDevice.DeviceInfo.ModelName} as well. If this kind of
substitution is supported, what is correct syntax?

8. How can Arguments passed from presets (see question #6) be accessed
in provision? Any examples?


Thanks in advance,

George Chelidze


More information about the Users mailing list