<div dir="ltr"><div dir="ltr">You pulled the code from the wiki, but edited out the parts that make it work :). You cannot count on instance ids being the same, which is why the [FileType:3 Vendor Configuration File] filter is in the script. I didn't write out all the code in the wiki entry to make extra work for myself :).</div><div dir="ltr"><br></div><div>-dan</div><div dir="ltr"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 10, 2019 at 6:54 AM Ramon Blanco <<a href="mailto:ramon@epic.es">ramon@epic.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="ES">
<div class="gmail-m_-267615891364162228WordSection1">
<p class="MsoNormal"><span lang="EN-US">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
<span class="gmail-m_-267615891364162228long-text">1970-01-01T00:00:00.000Z and return a fault message like this<u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="EN-US">FAULTCODE:<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="EN-US">9010<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="EN-US"><u></u> <u></u></span></b></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="EN-US">FAULTSTRING:<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="EN-US">Could not start download</span></b><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">My provision script is the next one:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">const now = Date.now();<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">let model = declare("Device.DeviceInfo.SerialNumber",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> {value: 1}).value[0];<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">//Map the CPE model to the config file<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">let cfgs = {'device_sn': 'config-file.xml'};<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">let lastConfigFile =<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> declare("Downloads.3.FileName",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> {value: Date.now()})<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">let configFile = cfgs[model];<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">if (!configFile) {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> //log('No config for CPE', {model: model, cfgs: cfgs});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> return;<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">if (lastConfigFile !== undefined && lastConfigFile.value !== undefined) {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> lastConfigFile = lastConfigFile.value[0];<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">} else {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> lastConfigFile = null;<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">if (lastConfigFile !== configFile) {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> log('Upgrading config', {model: model, configFile: configFile});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> declare("Downloads.3",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> {path: 1}, {path: 1});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> declare("Downloads.3.FileName",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> {value: 1}, {value: configFile});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> declare("Downloads.3.Download",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> {value: 1}, {value: now});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">Anyona can help me?<u></u><u></u></span></p>
</div>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/mailman/listinfo/users</a><br>
</blockquote></div>