Fail on provisioning with date value

Ramon Blanco ramon at epic.es
Thu Jan 10 10:53:36 EST 2019


Hi,  I'm working with genieacs and when I go to provision devices to download the config file with the provision script in the github's wiki, the date set with Date.now() nmot working, the date always be 1970-01-01T00:00:00.000Z and return a fault message like this

FAULTCODE:
9010

FAULTSTRING:
Could not start download


My provision script is the next one:

const now = Date.now();
let model = declare("Device.DeviceInfo.SerialNumber",
  {value: 1}).value[0];
//Map the CPE model to the config file
let cfgs = {'device_sn': 'config-file.xml'};

let lastConfigFile =
  declare("Downloads.3.FileName",
  {value: Date.now()})

let configFile = cfgs[model];

if (!configFile) {
  //log('No config for CPE', {model: model, cfgs: cfgs});
  return;
}

if (lastConfigFile !== undefined && lastConfigFile.value !== undefined) {
  lastConfigFile = lastConfigFile.value[0];
} else {
  lastConfigFile = null;
}

if (lastConfigFile !== configFile) {
  log('Upgrading config', {model: model, configFile: configFile});
  declare("Downloads.3",
    {path: 1}, {path: 1});
  declare("Downloads.3.FileName",
    {value: 1}, {value: configFile});
  declare("Downloads.3.Download",
    {value: 1}, {value: now});
}

Anyona can help me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20190110/ba50b5a8/attachment.html>


More information about the Users mailing list