Declaring FW upgrade URL

Hello,

I am trying to send a firmware upgrade URL to the CPE via these lines:

// Refresh values daily
const daily = Date.now(86400000);
declare(“InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL”, {value: daily}, {value: “connectivity-firmware.s3.amazonaws.com/rg1xx-lora-gateway/firmware/newest/fw.txt”});

I have confirmed that this is a valid field as per the CPE user manual and is currently blank, as returned by the CPE (a Laird gateway) via inform and visible on the Device’s -> All Parameters page.

However I see no effect of the above lines on the CPE logs. What could be wrong?

Thanks,
Arun

Hi,

I checked the cwmp log file and by means of log messages I confirmed that the previous declare statements are taking effect (relating to setting username/password etc) and reaching the CPE.
Also confirmed that log statements before & after the declare statement mentioned above are printed.
However there is no Get/SetParameterValue in the cwmp log for this statement, whereas they are logged for previous declare statements in the same provision script.

So clearly there is something wrong about this specific statement but I cannot guess why.

Could it be because of the “Laird” in the statement? I did confirm it is listed as part of Device Parameters on GenieACS v1.2 GUI.

Thanks,
Arun

Hi,

After further reading Section 3.3 of TR106 (Data Model Template for TR-069-Enabled Devices), perhaps having “Laird” in vendor specific parameter is not as per the standard and it should have been “X_6digitOUI”, so GenieACS does not take action?

Thanks,
Arun

These two lines of your script aren’t going to do what you think they are.

const daily = Date.now(86400000);
declare(“InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL”, {value: daily}, {value: “connectivity-firmware.s3.amazonaws.com/rg1xx-lora-gateway/firmware/newest/fw.txt”});

What you really want is:

let oneDayAgo = Date.now() - 86400000;
declare(“InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL”, {value: oneDayAgo}, {value: “connectivity-firmware.s3.amazonaws.com/rg1xx-lora-gateway/firmware/newest/fw.txt”});

Hi,

Thanks a lot for your reply. It’ll be great if you explain the difference between the two. I am new to GenieACS scripts.

I did try the change but it didn’t seem to affect the result: the command still did not get sent to the device.

Thanks,
Arun

This line right here tells genieacs to set the value of the given parameter if it hasn’t been changed in the previous 24 hours.

let oneDayAgo = Date.now() - 86400000;

The version you have would always return the current time because Date.now() always returns the time the current session started because its a pure function.

Regardless of the value you enter for the date though, GenieACS will not do a set parameter value on the CPE unless the value you are trying to set is different from the one in the currently cached model of the data.

Try refreshing the value first and then setting it.

Hi,

Thanks for the explanation. I think Date.now() is not the issue because other statements take effect and I can see them on the CPE logs as well:
InternetGatewayDevice.ManagementServer.PeriodicInformInterval
InternetGatewayDevice.ManagementServer.ConnectionRequestPassword

Try refreshing the value first and then setting it.

I do see that the field I am trying to update i.e.
InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL

is blank when I see it under Devices->All Parameters on GenieACS GUI.

  1. Can you tell me how to refresh it?
  2. Any comments on my guess that this may be because the Parameters under “Laird” may not be sent by GenieACS because they are not preceded by “X_”?

Thanks a lot!

Arun

  1. you can refresh it like this:

declare(“InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL”, {value: Date.now()})

This code also refreshes the parameter before setting it but only if the stored value is older than 24 hours:

let oneDayAgo = Date.now() - 86400000;
declare(“InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL”, {value: oneDayAgo}, {value: “connectivity-firmware.s3.amazonaws.com/rg1xx-lora-gateway/firmware/newest/fw.txt”});

  1. Yes, the standard says that any vendor-specific parameters should be defined as X_VENDOR_MethodName, but there is no constraint in genieacs. If you see the parameter as “InternetGatewayDevice.Laird.GatewayManagement.Versions.FirmwareUpdateURL” in the GUI, then this is how you have to reference it in the presets/provisioning scripts.

Be aware that genieacs won’t set a value if it’s already set (the parameter in the database has the same value as the one you are trying to set). If the parameter is set but It doesn’t initiate the firmware download, prepend the protocol ‘http://’ and make sure the CPE is properly configured (can resolve the host via a configured DNS server and has access to the internet). If this doesn’t help, you must sniff the packets to/from your CPE to figure out what is happening.

Thanks a lot!

The extra line you mentioned about refreshing seems to have done the trick. I now see the URL sent to the CPE and printed on its logs. Upgrade did not happen but that is hopefully now for me to figure out on the CPE side.

On a side note, is there some GenieACS documentation I can read to understand the usage of Date.now() and refreshing parameters?

Thanks again!

Arun

have a look at docs.genieacs.com