CFGParam Usage

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
jfngw
Posts: 4
Joined: 17 Oct 2017 23:55

CFGParam Usage

Post by jfngw » 02 Nov 2017 00:08

I have been trying to work with zunoLoadCGGParam & zunoSaveCFGParam.

I can only get zunoLoadCFGParam(param, &paramValue) to load value correctly if paramValue variable is a global, if I make it local within a function it does not load correct value.

I cannot get zunoSaveCFGParam(param, &paramValue) to work at all, this may be a misunderstanding by me about its use. I expected when using this function it would save the paramValue back into the eeprom. I am trying to only allow a certain range to be programmed from the automation controller, reset the value back to the original if outside the range. I also wanted an easy way to pre-load the parameters without having to do every board manually.

p0lyg0n1
Posts: 158
Joined: 04 Aug 2016 07:14

Re: CFGParam Usage

Post by p0lyg0n1 » 02 Nov 2017 08:17

Hi,
Yes, now it works only for globals. It's not a good idea to place this on the stack. Parameters use dword type, so it's 4 bytes of stack for one parameter. We try to make it clear for the next release.
zunoSaveCFGParam() have to work. The main limitation that you can't do a filtering of values by default(when you use a separate handler for configuration parameters), the parameter saves automatically every time, you get a new value from the controller. I will write a small example for you that shows how to avoid this. I need a little time. We try to solve this further in more elegant way.
You can fill a valid default values using some of these approaches: check them in setup, use another one variable-"a magic value" that shows this is a new device, use some kind of crc. If you want to fill them using software during flashing. It's theoretically possible, but we have to add some special functionality to uploading utility. In this case you can do it from a command line.

perjar
Posts: 29
Joined: 08 Apr 2018 18:02

Re: CFGParam Usage

Post by perjar » 08 Oct 2018 14:23

I am also struggling with the zunoSaveCFGParam function and can't get it to save the parameter value. Or, perhaps it is saved in EEPROM behind the scenes, but the controller is not aware.

I want to my sketch to change a config value using the zunoSaveCFGParam function, but the controller does not get this information at all. The only information the controller gets is the automatic report from the zuno that the parameter has been set to the new value.

My use case, to put things into context:
I have built an energy meter and want to calibrate its kwh-counter with the main meter from the power company. The main meter has been running for years so it has counted many thousands of kilowatt hours. So I was thinking of using a parameter to send a "seed" value to the zuno from the user interface in the controller.
Once the seed is sent to the zuno however, I want the zuno to reset that value to 0 again so it does not look strange in the controller.
Sending the seed works fine, but resetting it does not work. The controller does not get the updated value from the zuno when I call the zunoSaveCFGParam function.

I am using a Fibaro Home Center 2 controller btw.

Post Reply