script provision behaviour

Miguel Ángel Sánchez Moragues sanchez.moragues at gmail.com
Fri May 5 07:22:26 EDT 2017


Sorry, I don't understand the behavior.

Another example with the following script which is execute every "2
PERIODIC" event:


let now = Date.now();
let serialNumber = declare("DeviceID.SerialNumber", {value: 1});

log('start refresh3 script SN=' + serialNumber.value[0]);

/*
let credentials = ext('gateway', 'getPPPoE', serialNumber.value[0]);

if (credentials) {
log('username = ' + credentials.username + ' , password = ' +
credentials.password);
}
*/

declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval",
{value: now}, {value: 60});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnable",
{value: now}, {value: true});
declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUsername",
{value: now}, {value: "cpe"});

log('end refresh3 script SN=' + serialNumber.value[0]);



In this case, I see the following log:

May  5 13:14:51 acs2 genieacs-cwmp[15839]: 2017-05-05T11:14:51.590Z [INFO]
192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1469348094"
informEvent="2 PERIODIC" informRetryCount=0
May  5 13:14:51 acs2 genieacs-cwmp[15839]: 2017-05-05T11:14:51.650Z [INFO]
192.168.1.10 D837BE-ONU-xyz: Script: start refresh3 script SN=xyz
May  5 13:14:51 acs2 genieacs-cwmp[15839]: 2017-05-05T11:14:51.652Z [INFO]
192.168.1.10 D837BE-ONU-xyz: ACS request; acsRequestId="15bd851ce46100"
acsRequestName="GetParameterValues"
May  5 13:14:51 acs2 genieacs-cwmp[15839]: 2017-05-05T11:14:51.718Z [INFO]
192.168.1.10 D837BE-ONU-xyz: Script: end refresh3 script SN=xyz
May  5 13:14:51 acs2 genieacs-cwmp[15839]: 2017-05-05T11:14:51.720Z [INFO]
192.168.1.10 D837BE-ONU-xyz: Script: start refresh3 script SN=xyz
May  5 13:14:51 acs2 genieacs-cwmp[15839]: 2017-05-05T11:14:51.721Z [INFO]
192.168.1.10 D837BE-ONU-xyz: Script: end refresh3 script SN=xyz


The acs sends a GetParameterValues but doesn't send a SetParameterValues
because the values are the same that in local bbdd. What is the change in
this case?

2017-05-05 11:19 GMT+02:00 Dan Morphis <dan at milkcarton.com>:

> Because genie is going to keep running the script (as long as the
> precondition is met) until there are no more changes.
>
> This block is unnecessary, as those values are sent in every inform by the
> device:
>
> declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ManufacturerOUI", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.Manufacturer", {value: 1});
>
>
> In your case, declare("Device.*", {value: now}); refreshes the entire
> model (the change in this case). Take that part out and only refresh the
> few specific parameters you actually care about and the script should only
> execute once.
>
> -dan
>
> On May 5, 2017, at 12:17 AM, Miguel Ángel Sánchez Moragues <
> sanchez.moragues at gmail.com> wrote:
>
> Hi,
>
> I have the following script which is execute every "2 PERIODIC" event:
>
> let now = Date.now();
> let serialNumber = declare("DeviceID.SerialNumber", {value: 1});
>
> log('start refresh2 script SN=' + serialNumber.value[0]);
>
> declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ManufacturerOUI", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.Manufacturer", {value: 1});
>
> declare("Device.*", {value: now});
>
> log('end refresh2 script SN=' + serialNumber.value[0]);
>
>
> In the log, I see the first time after the device was new registered, the
> script was executed two times:
>
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.204Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="846930886"
> informEvent="2 PERIODIC" informRetryCount=0
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.306Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.310Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: ACS request; acsRequestId="15bd79ca5b7100"
> acsRequestName="GetParameterValues"
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.378Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.383Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.385Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
>
> May  5 09:58:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:58:59.276Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1681692777"
> informEvent="2 PERIODIC" informRetryCount=0
> May  5 09:58:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:58:59.329Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 09:58:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:58:59.332Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
>
> May  5 10:00:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:00:59.374Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1714636915"
> informEvent="2 PERIODIC" informRetryCount=0
> May  5 10:00:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:00:59.425Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 10:00:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:00:59.430Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
>
> May  5 10:02:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:02:59.392Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1957747793"
> informEvent="2 PERIODIC" informRetryCount=0
> May  5 10:02:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:02:59.460Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 10:02:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:02:59.462Z [INFO]
> 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
>
>
>
> Why did acs has this behaviour?
>
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170505/3ab15da0/attachment.html>


More information about the Users mailing list