Get ppp username from DSL modem

hello,
can some one help to get the ppp username from the DSL router using genieacs parameter .
i used this in the admin config, index and device page but nothing appeared in the devices username column InternetGatewayDevice.WANDevice..WANConnectionDevice..WANPPPConnection.*.Username

Please be more specific about what you have tried.

as you see in the picture attached . i want the pppoe username to appear
and i want to add the SNR margin with attenuation for each DSL CPE

Putting the header there doesn’t make the values magically appear.

You have to refresh that value from the CPE.

Create a vparam called “pppUsername” with this script:

let result = '';

if (declare("Tags.Bridged", {value: 1}).value !== undefined) {
    log('CPE is bridged, setting PPPoE username to null');
} else if ("value" in args[1]) {
    result = args[1].value[0];
} else {
    let keys = [
        'InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username',
        'Device.PPP.Interface.*.Username'
    ];

    result = getParameterValue(keys);
}

return {writable: true, value: [result, "xsd:string"]};

function getParameterValue(keys) {
    for (let key of keys) {
        let d = declare(key, {path: Date.now() - (120 * 1000), value: Date.now()});

        for (let item of d) {
            if (item.value && item.value[0]) {
                return item.value[0];
            }
        }
    }

    return '';
}

Then in your default provision put this:

//Refresh the PPPoE username
declare("VirtualParameters.pppUsername", {value: Date.now()});
2 Likes

thanks a lot, it worked
please do you have the script if i want to add the below values