# Inconsistent Nextlevel Behaviour

**URL:** <https://forum.genieacs.com/t/inconsistent-nextlevel-behaviour/5166>\
**Category:** Uncategorized\
**Created:** [March 7, 2024, 6:09am UTC](https://forum.genieacs.com/t/inconsistent-nextlevel-behaviour/5166 "2024-03-07T06:09:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmeiring](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jmeiring](https://forum.genieacs.com/u/jmeiring)\
**Post date:** [March 7, 2024, 6:09am UTC](https://forum.genieacs.com/t/inconsistent-nextlevel-behaviour/5166/1 "2024-03-07T06:09:35Z")

</div>

I am trying to get the following Parameters from my CPE.

I am using a test provision, called using a summon the therefore causes a “6 CONNECTION REQUEST”.

Script is the following:

```auto
// Constants
const now = Date.now();

clear("InternetGatewayDevice", now);
declare("InternetGatewayDevice.WANDevice.*", {path: now});
declare("InternetGatewayDevice.LANDevice.*", {path: now});

```

When genieacs queries the value of:  
InternetGatewayDevice.LANDevice.1.WLANConfiguration.1. with a NextLevel of **0** , the CPE returns this:  
InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.

When genieacs queries the value of:  
InternetGatewayDevice.LANDevice.1.WLANConfiguration.1. with a NextLevel of **1** the CPE does **not** return this:  
InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.

Genieacs alternates between sending NextLevel of 0 and 1 between subsequent calls.

Can anyone please help with why Genieacs is sending 0 and 1 when running the same script over and over again using a Summon?

Kind Regards,

Johan

---

<div class="post-metadata">

**Author:** ![jmeiring](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jmeiring](https://forum.genieacs.com/u/jmeiring)\
**Post date:** [March 7, 2024, 4:37pm UTC](https://forum.genieacs.com/t/inconsistent-nextlevel-behaviour/5166/2 "2024-03-07T16:37:25Z")

</div>

Hi All,

I can confirm that “hacking” session.ts and inserting

```auto
     // JM hack to fix NextLevel for InternetGatewayDevice.LANDevice.1.WLANConfiguration.1
      if (path.toString() != "InternetGatewayDevice.LANDevice.1.WLANConfiguration.1") {
        logger.accessWarn({
          sessionContext: sessionContext,
          message: "Setting nextLevel to false",
        });
        nextLevel = false;
      }

```

just before

```auto
      return {
        name: "GetParameterNames",
        parameterPath: path.length ? path.toString() + "." : "",
        nextLevel: nextLevel,
      };

```

Works around my problem…

Kind Regards,

Johan

---

<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:** [March 7, 2024, 11:15pm UTC](https://forum.genieacs.com/t/inconsistent-nextlevel-behaviour/5166/3 "2024-03-07T23:15:16Z")

</div>

This is by design. If you’d like to refresh multiple levels then you need to do this:

```auto
declare("InternetGatewayDevice.LANDevice.*.*", {path: now});

```

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [March 18, 2024, 7:11pm UTC](https://forum.genieacs.com/t/inconsistent-nextlevel-behaviour/5166/4 "2024-03-18T19:11:51Z")

</div>

Genie uses a crude heuristic to decide when to use nextLevel and when not to. Definitely don’t mess with that part of the code 🙂
