Can I send setParametrValue with VirtualParameter?

As far as I tested, line below is sending to CPE setParametrValue from provision, but sending getParametrValue from VirtualParameter.

declare(“Device.WiFi.AccessPoint.1.Security.KeyPassphrase”, {value: Date.now()}, {value: ‘testpassword’});

Is it meant to be like this?

No sure I fully understand your question but you mean something like this:

declare("VirtualParameters.*", {value: Date.now()});
let  myNewVP = declare("VirtualParameters.myNewVP", {value: 1}).value[0];
declare("Device.WiFi.AccessPoint.1.Security.KeyPassphrase", {value: Date.now()}, {value: myNewVP});

No, I’m trying to replicate example from documentation, where you can Create an editable virtual parameter for WPA passphrase, but with args[] instead of VALUES.
And I’m stuck on sending values to CPE. Started simplifying script and came up with script below sending getParameterValue instead setParameterValue:

declare("Device.WiFi.AccessPoint.1.Security.KeyPassphrase", {value: Date.now()}, {value: 'testpass'});
return {writable: true, value: 'testpass'};

But the same declare() statement in a provision script is sending setParameterValue to CPE.

I’m trying to make unified parameters for wifi ssid and passphrase in tr-098 and tr-181 data models.

AFAIK a declare statement does both!

declare("Device.WiFi.AccessPoint.1.Security.KeyPassphrase", {value: Date.now()});
will do a getParameterValue to fetch the value from the CPE

declare("Device.WiFi.AccessPoint.1.Security.KeyPassphrase", {value: Date.now()}, {value: 'testpass'});
will also do a getParameterValue followed by a setParameterValue if the new value (‘testpass’) is different from the existing one

I think you perceived it’s behaving differently because in the provision script you have a extra declare at the begining of the script just for refreshing the value and in this case the declare with value to set does just a setParameterValue RPC.

You should use null for the second parameter to do just a SPV eventually:
declare(“Device.WiFi.AccessPoint.1.Security.KeyPassphrase”, null, {value: ‘testpass’});

I’m so confused rn.
I’ve tried null for a second parameter and it didn’t work.
That’s what I get in CPE log with null in second parameter.

easycwmpd: ACS initiated connection
easycwmpd: add event ‘6 CONNECTION REQUEST’
easycwmpd: start session
easycwmpd: configured acs url http://my-ip:7547/
easycwmpd: external script init
easycwmpd: external: execute inform parameter
easycwmpd: send Inform
easycwmpd: receive InformResponse from the ACS
easycwmpd: send empty message to the ACS
easycwmpd: receive empty message from the ACS
easycwmpd: external: execute apply service
easycwmpd: external script exit
easycwmpd: end session success

That’s what I get in CPE log with {value: Date.now()} in second parameter.

easycwmpd: ACS initiated connection
easycwmpd: add event ‘6 CONNECTION REQUEST’
easycwmpd: start session
easycwmpd: configured acs url http://my-ip:7547/
easycwmpd: external script init
easycwmpd: external: execute inform parameter
easycwmpd: send Inform
easycwmpd: receive InformResponse from the ACS
easycwmpd: send empty message to the ACS
easycwmpd: received GetParameterValues method from the ACS
easycwmpd: external: execute get value Device.WiFi.AccessPoint.1.Security.KeyPassphrase
easycwmpd: send GetParameterValuesResponse to the ACS
easycwmpd: receive empty message from the ACS
easycwmpd: external: execute apply service
easycwmpd: external script exit
easycwmpd: end session success

That’s what i get in CPE log when changing Device.WiFi.AccessPoint.1.Security.KeyPassphrase normal way from giu.

easycwmpd: ACS initiated connection
easycwmpd: add event ‘6 CONNECTION REQUEST’
easycwmpd: start session
easycwmpd: configured acs url http://my-ip:7547/
easycwmpd: external script init
easycwmpd: external: execute inform parameter
easycwmpd: send Inform
easycwmpd: receive InformResponse from the ACS
easycwmpd: send empty message to the ACS
easycwmpd: received SetParameterValues method from the ACS
easycwmpd: external: execute set value Device.WiFi.AccessPoint.1.Security.KeyPassphrase testpass
easycwmpd: external: execute apply value
easycwmpd: send SetParameterValuesResponse to the ACS
easycwmpd: receive empty message from the ACS
easycwmpd: external: execute apply service
easycwmpd: external script exit
easycwmpd: end session success

Are you using v1.2 or v1.1?

I’m using latest github release v1.2

So that was a bug and I have just fixed it. Try the latest master branch.

Thank you very much!)

It’s working well, thanl you. When will it be available in npm?