New 2.1.4 beta

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
User avatar
PoltoS
Posts: 4334
Joined: 26 Jan 2011 19:36

Re: New 2.1.4 beta

Post by PoltoS » 28 Jun 2018 00:58

When you define zunoCallback, your Cfg handler will not apply anymore. This is because this function is the single entry point for all callbacks and if not defined, it will be generated on the fly to account for your callbacks defined with macro. With explicit definition all macro are not used anymore.

We will document it better

Riri
Posts: 25
Joined: 22 Jun 2018 10:08

Re: New 2.1.4 beta

Post by Riri » 28 Jun 2018 01:26

I understand perfectly why it does not work.

In the meantime, I will put everything in static.
I had a doubt that we can put 32 channels and 32 groups in the macros.
I just tried with 15 and it works.
Really thank you for this precious help
Eric.

Riri
Posts: 25
Joined: 22 Jun 2018 10:08

Re: New 2.1.4 beta

Post by Riri » 28 Jun 2018 17:04

Hi,
3) Me
On the pin 3,4,5,6,7,8 (analog and TX RX), used in PULLUP, digitalRead works quickly when it goes low but they take about a second to give value by going to the up state.
to counteract this, i write digitalWrite(pin,HIGH), just after the read for these pines, and it's work fine. Is there an other solution ?
Note it was the same case in 2.1.3. It's not specially for the version 2.1.4

3) You
Looks like it's a problem of inner capacity of your sensor. For me it works immediately. I try it with jumper cable connected to gnd. When you do digitalWrite(pin,HIGH) you make it INPUT without a PULLUP.
I wrote a simple program that test two pins at the same time. Connect the pins 0 and 8 together to be sure that touch at the same time and run ; you remark when the two pins touch the ground together, they display information at the same time. When you release the ground the pin 0 is instantaneous while the pin 8 is mush long.
Visually it's obvious.
If you connect the pin 0 and 1 and run this same program, the touch and release ground is instantaneous.
I test this program with two z-uno and it's the same result.

Code: Select all

const int pinOk = 0;
const int pinPb = 8;

byte          sauvValOk = HIGH;
byte          sauvValPb = HIGH;
byte          valOk     = HIGH;
byte          valPb     = HIGH;
void setup() 
{
  Serial.begin();
  pinMode(pinOk, INPUT_PULLUP);
  pinMode(pinPb, INPUT_PULLUP);
}

void loop() 
{
  valOk = digitalRead(pinOk);
  valPb = digitalRead(pinPb);
  if (valOk != sauvValOk) {
    sauvValOk = valOk;
    if (valOk == HIGH)
      Serial.println("Ok : HIGH ");
    else
      Serial.println("Ok : LOW ");
  }
  if (valPb != sauvValPb) {
    sauvValPb = valPb;
    if (valPb == HIGH)
      Serial.println("Pb : HIGH ");
    else
      Serial.println("Pb : LOW ");
  }
}
Have you the same effect ?

Other question, can I use the z-uno power with 12V (pin 7-18V) with the USB cable connected (for debug for exemple).
I have see the Z-Uno power supply diagram and i think yes but I would prefer to be sure :) .

thanks again.
Eric.

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

Re: New 2.1.4 beta

Post by p0lyg0n1 » 30 Jun 2018 02:33

Eric, I am sorry. Thank you for your sample. I'll try your code in 2 days. I had lots of tasks last 3 days. I'll report results here.
About 12 volts.
You can do it, but be careful. Always connect the ground of the sources first. Don't plug/unplug USB connector frequently.
Alex.

Riri
Posts: 25
Joined: 22 Jun 2018 10:08

Re: New 2.1.4 beta

Post by Riri » 30 Jun 2018 09:48

Thanks again.
It's not pressed, everything else works perfectly.
Thanks for the info about the 12V.
Good courage.
Eric.

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

Re: New 2.1.4 beta

Post by p0lyg0n1 » 30 Jun 2018 14:36

Hi,
I tried your code, slightly reworked it to add timing.
so, try this, for me it works without significant delay. I connected 8 & 0 together and wired them to gnd or pulled it up.

Code: Select all

const int pinOk = 0;
const int pinPb = 8;

#define MY_SERIAL Serial

byte          sauvValOk = HIGH;
byte          sauvValPb = HIGH;
byte          valOk     = HIGH;
byte          valPb     = HIGH;
void setup() 
{
  MY_SERIAL.begin(115200);
  pinMode(pinOk, INPUT_PULLUP);
  pinMode(pinPb, INPUT_PULLUP);
}

void loop() 
{
  bool need_to_print_time = FALSE;
  valOk = digitalRead(pinOk);
  valPb = digitalRead(pinPb);
 
  if ((valOk != sauvValOk) || (valPb != sauvValPb)) {
    sauvValOk = valOk;
    sauvValPb = valPb;
    MY_SERIAL.print("MAP ");
    MY_SERIAL.print(valOk);
    MY_SERIAL.print(valPb);
    MY_SERIAL.print(" @");
    MY_SERIAL.println(millis());
  }
  
}
output:
@MY_SERIAL == Serial0

Code: Select all

0000:00 03
MAP 00 @5843
MAP 01 @5994
MAP 00 @5998
MAP 11 @6368
MAP 00 @18566
MAP 01 @27560
MAP 11 @27565
MAP 00 @71980
MAP 11 @72753
MAP 00 @75022
MAP 11 @75905
MAP 00 @79721
MAP 11 @80405
MAP 00 @83974
MAP 11 @84483
MAP 00 @85920
MAP 11 @86370
MAP 00 @88388
MAP 11 @88753
MAP 00 @93617
MAP 10 @93993
MAP 11 @93999
MAP 00 @101294
MAP 11 @101729
MAP 00 @107930
MAP 11 @108337
MAP 00 @111020
MAP 11 @111443
MAP 00 @133035
MAP 11 @137200
MAP 00 @142788
MAP 11 @145024
@MY_SERIAL == Serial

Code: Select all

MAP 00 @19434
MAP 10 @20420
MAP 11 @20426
MAP 00 @29666
MAP 11 @30299
MAP 00 @32785
MAP 10 @33305
MAP 11 @33310
MAP 00 @39974
MAP 11 @40885
MAP 00 @40890
MAP 11 @40896
MAP 00 @43164
MAP 11 @43876
MAP 00 @45795
MAP 11 @46437
MAP 00 @48821
MAP 11 @49829
MAP 00 @52258
MAP 11 @52783
MAP 00 @53851
MAP 11 @54438
MAP 00 @56336
MAP 11 @56873
You could see a little differences about 5-7ms. It's due to debounce noise.
Please try this test your own.
Alex.

Riri
Posts: 25
Joined: 22 Jun 2018 10:08

Re: New 2.1.4 beta

Post by Riri » 01 Jul 2018 19:51

Hi,
Thank you for your reply. I tested your code and that work.
I will try to understand the difference there is with mine.


On the other hand, I have another problem bizarre when i plug an optocoupler like TLP521-4 on the pin 9 or 15 or 16 (other pin like 25 works).
It works perfectly until i make a digitalWrite Low on pin 10 for exemple. The pin 9 remains connected to the ground despite the pullup.
When I redo the same digitalWrite that works. And so on !

Here the schematic.
tlp.png
tlp.png (92.27 KiB) Viewed 800 times
And the prog (sending "c" to cause the digitalWrite Low) :

Code: Select all

bool  V;
int   serialByte = 0;

void setup() 
{
   
  pinMode(9,  INPUT_PULLUP);
  pinMode(10, OUTPUT); // Ou 14 13 12 11 10
  
  Serial.begin();
}

void loop() 
{
  V = digitalRead(9);

  Serial.print(V);
  Serial.println();

  if (Serial.available() > 0) {
    serialByte = Serial.read();
    if ((serialByte=='C') || (serialByte=='c'))
      digitalWrite(10,LOW);
    if ((serialByte=='H') || (serialByte=='h'))
      digitalWrite(10,HIGH);
  } 
}

I tested with version 2.1.3 and it's the same effect. And with a another z-uno. And with another TLP521-4.
Without optocoupler, it works fine.
It is as if the internal resistor was no longer connected when pin 10 is activated/deactivate.
I tested with addin a resistor pullup of 10k and it works.

I might have had to do another topic because it's not 2.1.4

Thank's.
Eric.

Riri
Posts: 25
Joined: 22 Jun 2018 10:08

Re: New 2.1.4 beta

Post by Riri » 02 Jul 2018 10:11

Hi,
I have just realized that they are all those in a "s_pin".
Is there a relation ?
Eric.

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

Re: New 2.1.4 beta

Post by p0lyg0n1 » 02 Jul 2018 12:13

Hi,
Thank you for testing. Looks like you have found a very old issue with pullups. I have made only some tests and need a time.
Yes, they are on the same "port". P0 in terms of i8051.
I will report my results soon.
Thank you very much! You are making a great work for community!

Riri
Posts: 25
Joined: 22 Jun 2018 10:08

Re: New 2.1.4 beta

Post by Riri » 02 Jul 2018 17:38

Hi,
Very happy to help :) . I hope that I do not bother you too much ;)
I have remarq that a pin 7,8 and 17 have the same problem with the resistor pullup.
It's not only the "s_pin" block.

Do you know if it is a problem hardware or software.
Need I to place a physical resistor pullup for each entry with optocoupler or you can resolv by program (please, please :P ).

Thanks again for your reply with sush reactivity.
Eric.

Post Reply