# Get ppp username from DSL modem

**URL:** <https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823>\
**Category:** Uncategorized\
**Created:** [July 2, 2021, 10:32am UTC](https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823 "2021-07-02T10:32:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://forum.genieacs.com/u/pierrot)\
**Post date:** [July 2, 2021, 10:32am UTC](https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823/1 "2021-07-02T10:32:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [July 2, 2021, 4:16pm UTC](https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823/2 "2021-07-02T16:16:38Z")

</div>

Please be more specific about what you have tried.

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://forum.genieacs.com/u/pierrot)\
**Post date:** [July 2, 2021, 8:32pm UTC](https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823/3 "2021-07-02T20:32:47Z")

</div>

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

 ![genieacs.PNG](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/6d31bd6c6da3c67b5e32b90c2d324660ee7cb5a8.png)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [July 2, 2021, 9:42pm UTC](https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823/4 "2021-07-02T21:42:44Z")

</div>

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:

```auto
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:

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

```

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://forum.genieacs.com/u/pierrot)\
**Post date:** [July 2, 2021, 11:22pm UTC](https://forum.genieacs.com/t/get-ppp-username-from-dsl-modem/1823/5 "2021-07-02T23:22:17Z")

</div>

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