Page 2 of 3

Re: New 2.1.5 release

Posted: 18 Jul 2019 10:12
by Miklux
Hi samsonbox,
thank you for your reply.

In general I don't know how the dynamic approach works.
I haven't tried this approach yet, but now, thanks to you, I will be able to test it and publish the results.

Thank you so much.

In some minutes I hope to publish the results :D

Re: New 2.1.5 release

Posted: 18 Jul 2019 11:33
by Miklux
Hi again!

I'm trying the dynamic approach but still something is not right...

This is my code:

Code: Select all

#define MAP_TO_ZEROCHANNEL 0x80

ZUNO_ENABLE(WITH_CC_SENSOR_MULTILEVEL);
ZUNO_DYNAMIC_CHANNELS(3);

unsigned int counterIngressi = 0;
unsigned int counterUscite = 0;
unsigned int counterPresenze = 0;

void setup() {
  // DEFINIZIONE DELLA GESTIONE DINAMICA DEI CANALI
  ZUNO_START_CONFIG();
  ZUNO_SET_ZWCHANNEL(1| MAP_TO_ZEROCHANNEL); // <- this channel will be provided via 1 & 0 channels
  ZUNO_ADD_CHANNEL(ZUNO_SENSOR_MULTILEVEL_CHANNEL_NUMBER, ZUNO_SENSOR_MULTILEVEL_TYPE_GENERAL_PURPOSE_VALUE, SENSOR_MULTILEVEL_PROPERTIES_COMBINER( SENSOR_MULTILEVEL_SCALE_LOCAL, SENSOR_MULTILEVEL_SIZE_FOUR_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS));
  ZUNO_SET_ZWCHANNEL(2);
  ZUNO_ADD_CHANNEL(ZUNO_SENSOR_MULTILEVEL_CHANNEL_NUMBER, ZUNO_SENSOR_MULTILEVEL_TYPE_GENERAL_PURPOSE_VALUE, SENSOR_MULTILEVEL_PROPERTIES_COMBINER( SENSOR_MULTILEVEL_SCALE_LOCAL, SENSOR_MULTILEVEL_SIZE_FOUR_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS));
  ZUNO_SET_ZWCHANNEL(3);
  ZUNO_ADD_CHANNEL(ZUNO_SENSOR_MULTILEVEL_CHANNEL_NUMBER, ZUNO_SENSOR_MULTILEVEL_TYPE_GENERAL_PURPOSE_VALUE, SENSOR_MULTILEVEL_PROPERTIES_COMBINER( SENSOR_MULTILEVEL_SCALE_LOCAL, SENSOR_MULTILEVEL_SIZE_FOUR_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS));
  ZUNO_COMMIT_CONFIG();
  //....
  Serial.begin(115200);
  counterIngressi = 0;
  counterUscite = 0;
  counterPresenze = 0;

  pinMode(20, OUTPUT);      // sets the digital pin as output
  
}

void loop() {
  g_channels_data[0].dwParam = counterIngressi;
  g_channels_data[1].dwParam = counterUscite;
  g_channels_data[2].dwParam = counterPresenze;

  bool inNetwork = zunoInNetwork();
  if(inNetwork==1) Serial.println("Device in network");
  else Serial.println("Device not in network");

  
  if (Serial.available() > 0) {
    // read the incoming byte:
    counterIngressi = Serial.parseInt();
    counterUscite = Serial.parseInt();
    counterPresenze = Serial.parseInt();
    if(Serial.read()=='\n') {
      digitalWrite(20,HIGH);
      delay(500);
      digitalWrite(20,LOW);  
      Serial.println(counterIngressi);
      Serial.println(counterUscite);
      Serial.println(counterPresenze);
      }
    }

    delay(1000);
  
}


word getterIngressi() {
  return counterIngressi;
}

word getterUscite() {
  return counterUscite;
}

word getterPresenze() {
  return counterPresenze;
}
When I associate the device to my Widom gateway I can't see the 3 channels on the gateway interface...
I really don't understand how this approach could works.

Maybe I need to add something like zunoSendReport() ?
Thank you in advance for your help

Re: New 2.1.5 release

Posted: 18 Jul 2019 17:03
by rkv
samsonbox wrote:
16 Jul 2019 22:55
I have a problem with the

Code: Select all

ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE); 
with the loop I call

Code: Select all

  zunoSetBeamCountWU(10);
  zunoSendDeviceToSleep();
but the device does not wake up any more. The Battery and wake_up command class is also missing on the contoller side. But in react on any commands.
This is works fine in 2.1.5 update. Try to exclude your zuno and then include. If it won't work try other zuno.
Also wake_up command class can be only in always sleeping device.

Here are the interview results for your code.

Re: New 2.1.5 release

Posted: 19 Jul 2019 13:53
by rishamee
I had the same problem. Including the Z-Uno in normal (operation) mode instead of including in rescue mode solved it.

Re: New 2.1.5 release

Posted: 20 Jul 2019 00:37
by PoltoS
Sure, in rescue mode the Z-Uno is not running your sketch

Re: New 2.1.5 release

Posted: 24 Jul 2019 07:01
by samsonbox
This is works fine in 2.1.5 update. Try to exclude your zuno and then include. If it won't work try other zuno.
Also wake_up command class can be only in always sleeping device.
Nowit works fine. But first i had to perform a "Erase NVM: All" once during one upload. It seems like the Device holds some data in the NVM, thant causes this stange behaviour. So what is essentially stored in the "User Space"- and "System Space" NVM?

Re: New 2.1.5 release

Posted: 24 Jul 2019 09:50
by PoltoS
A lot of specific Z-Wave data including your network info and internal SDK configurations. After upgrade from old versions sometimes you need to erase it

Re: New 2.1.5 release

Posted: 27 Jul 2019 03:28
by Cyberax
Well, now I'm able to upload sketches at least in 50% of cases.

However, ZUNO_DISABLE(SERVICE_LEDS) doesn't work anymore. Still have this damned blinking green LED

Re: New 2.1.5 release

Posted: 27 Jul 2019 12:39
by PoltoS
Please try to re-install the package (delete Z-Uno folders/files in stageing and package)

Re: New 2.1.5 release

Posted: 27 Jul 2019 22:44
by Cyberax
Still blinking, even with an empty sketch:

Code: Select all

ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE);
ZUNO_SETUP_DEBUG_MODE(DEBUG_ON);
ZUNO_DYNAMIC_CHANNELS(32);

ZUNO_ENABLE(WITH_CC_SWITCH_MULTILEVEL);
ZUNO_DISABLE(SERVICE_LEDS);

void setup() {
}

void loop() {
}
I'm using the USA frequency and no security.