I received your provision script in email, not sure why it didn’t make it to this forum post. There are a few different issues going on, some minor, others that represent a fundamental misunderstanding of how provisions work. I’ll start at the top:
// GET BASIC PARM
declare("InternetGatewayDevice.DeviceInfo.HardwareVersion", {path: hourly, value: hourly});
declare("InternetGatewayDevice.DeviceInfo.SoftwareVersion", {path: hourly, value: hourly});
declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {path: hourly, value: hourly});
These aren’t necessary. Part of the spec is the CPE itself reports those values in a periodic inform. So they will never change without GenieACS knowing about them.
To the bigger issue though,
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.", null, {path: 2})
. This tells GenieACS that you want two instances under the WANConnectionDevice. Based upon the next lines of code, that is almost certainly not what you are intending to do. This is what I believe you want:
const values = {
Enable: true,
X_HW_ServiceType: 4,
X_HW_VLAN: 30,
X_HW_VlanMux8021p: 0,
X_HW_VlanEnable: true,
ConnectionType: 'IP_Routed',
AddressingType: 'PPPoE',
MaxMTUSize: 1500,
"X_HW_LANBIND.SSID1Enable": 1,
"X_HW_LANBIND.Lan1Enable": 1,
"X_HW_LANBIND.Lan2Enable": 1,
"X_HW_LANBIND.Lan3Enable": 1,
"X_HW_LANBIND.Lan4Enable": 1,
DNSEnabled: true,
NATEnabled: true,
};
const basePath = "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection";
const path = basePath + '.[' + Object.keys(values).map(key => key + ':' + values[key]).join(',') + ']';
declare(path, {path: 1}, {path: 1});
This will generate the required declare for GenieACS and will ensure that only one instance exists under InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection
. The only thing I’m unsure of the sub-params (X_HW_LANBIND
). If the code above gives you issues, try removing those 5 params from the code and try again. One other thing that jumped out to me is the max mtu size. For pppoe it should be 1492 to account for the 8 bytes used by PPPoE encapsulation.
Now, if you know your CPE always has the instances pre-configured from the factory a specific way, then you can shortcut a lot of this. All of my CPEs come from the factory with our config on it. PPP is always on InternetGatewayDevice.WANDevice.*.WANConnectionDevice.1.WANPPPConnection.1
, management is always InternetGatewayDevice.WANDevice.*.WANConnectionDevice.1.WANIPConnection