Question about zunoSendReport

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
sdtlee
Posts: 9
Joined: 31 May 2022 11:38

Question about zunoSendReport

Post by sdtlee »

Hi everyone,

I have a question about zunoSendReport.

My goal is the measure the RSSI of the signal send out from Z-Uno.
What I try to do is, when the user press the service button, I will try to send out a signal, so that the usb sniffer can capture the signal and show the RSSI.

Here is the code I modified from sample code:

Code: Select all

#include "Arduino.h"
#include "ZUNO_Buttons.h"

#define MY_SERIAL Serial0

#define BUTTON		23

uint8_t dimmerValue = 0;

// the setup function runs once, when you press reset or power the board
void setup() {
  MY_SERIAL.begin();
  MY_SERIAL.println("Setup");
  pinMode(LED_BUILTIN, OUTPUT);
  Btn.addButton(BUTTON);
}

// the loop function runs over and over again forever
void loop() {
  process_buttons();
  MY_SERIAL.println("Loop");
}

void process_buttons() {
  if (Btn.isSingleClick(BUTTON)) {
    MY_SERIAL.println("isSingleClick");
    zunoSendReport(1);
    if (dimmerValue == 0)
    {
      digitalWrite(LED_BUILTIN, HIGH);
      dimmerValue = 1;
    }
    else
    {
      digitalWrite(LED_BUILTIN, LOW);
      dimmerValue = 0;
    }
  }
}
I use Z-Wave Zniffer to see the signal like this.
無題5.png
無題5.png (78.82 KiB) Viewed 1605 times
I expect it will show a new data when I press the button but it does not.
However I can see the Explorer Autoinclusion appears.

Anyone can give me some hints?

Thank you in advance.

Regards,
Lee

Regards,
Lee
User avatar
PoltoS
Posts: 7588
Joined: 26 Jan 2011 19:36

Re: Question about zunoSendReport

Post by PoltoS »

Hello!

1) No channels in your sketch, so no reports. Also, note that some report types are never sent more often than 30 seconds.

2) Better use zunoSendNIF() - it will use 40 kbps

3) A good news for you is that the new version of Z-Uno 2 (and RaZberry 7) will allow sending any packet and will work as Zniffer. We will launch this extension in two weeks. So your task will be easily solved (more info here https://z-wave.me/products/zniffer/)
sdtlee
Posts: 9
Joined: 31 May 2022 11:38

Re: Question about zunoSendReport

Post by sdtlee »

Hi PoltoS,

Thank you very much for your reply.
I tried zunoSendNIF() and I can see the signal through the Zniffer USB.
無題6.png
無題6.png (147.01 KiB) Viewed 1564 times
Here is the sample code for anyone who need in the future.

Code: Select all

#include "Arduino.h"
#include "ZUNO_Buttons.h"
#include "ZUNO_Definitions.h"

#define MY_SERIAL Serial0

#define BUTTON		23

uint8_t dimmerValue = 0;

// the setup function runs once, when you press reset or power the board
void setup() {
  MY_SERIAL.begin();
  MY_SERIAL.println("Setup");
  pinMode(LED_BUILTIN, OUTPUT);
  Btn.addButton(BUTTON);
}

// the loop function runs over and over again forever
void loop() {
  process_buttons();
  MY_SERIAL.println("Loop");
}

void process_buttons() {
  if (Btn.isSingleClick(BUTTON)) {
    MY_SERIAL.println("isSingleClick");
    zunoSendNIF();
    if (dimmerValue == 0)
    {
      digitalWrite(LED_BUILTIN, HIGH);
      dimmerValue = 1;
    }
    else
    {
      digitalWrite(LED_BUILTIN, LOW);
      dimmerValue = 0;
    }
  }
}
Regards,
Lee
Post Reply