I have a Ont Huawei HS8145V on Genieacs and currently can configure parameters as ssid for example whit a preset. Someone can help me whit a script to provission pppoe.
I just need configure a pppoe when the Ont was a factory reseted.
This preset here runs when a CPE informs without the 0 BOOTSTRAP event, and is not Disabled, Provisioned and the desired state is Managed. Those tags are added to the CPE by a different preset .
This provision script queries our subscriber management server to get the desired configuration of a CPE. The ext() func calls an external script (that reside in the genieacs/config/ext dir). External scripts are how you can get data from external services.
log("Set_Config_Mode");
let serialNumber = declare("DeviceID.SerialNumber", {value: 1}).value[0];
let productClass = declare("DeviceID.ProductClass", {value: 1}).value[0];
let oui = declare("DeviceID.OUI", {value: 1}).value[0];
let deviceId = declare("DeviceID.ID", {value: 1}).value[0];
let params = {serial: serialNumber, productClass: productClass, oui: oui, deviceId: deviceId};
//Get the cpe config mode
let cpeConfig = ext('cpe-config', 'getConfig', JSON.stringify(params));
if (cpeConfig && cpeConfig.config) {
log('Set_Config_Mode - Config? ' + cpeConfig.config);
declare("Tags." + cpeConfig.config, null, {value: true});
if (cpeConfig.tags && cpeConfig.tags.toLength > 0) {
for (let [tag] of cpeConfig.tags) {
declare("Tags." + tag.replace(' ', '_'), null, {value: true});
}
}
}
Now, I have the external script in home/urbina/genieacs-gui/config/ext# and also added the provision script. Whats the next step? Because in the provision script or external I dont see where modify the tags.
I only need to provide one wan interface pppoe, ssid and presharedkey.
Do you think that exists another easy way to provide this parameters?
The location of the ext dir is entirely dependent on where you put genieacs. If you put genieacs in the /opt dir, then the correct location would be /opt/genieacs/config/ext.