Page 1 of 1

Problems with R2.0-dev12

Posted: 30 Nov 2017, 18:38
by leel1967l
Hi all,
Here is my setup: ESP8266 (Wemos mini 4MB) + 2 relay board.
With version R147 everything was working fine.

Then I wanted to add the SHT30 temp module so I switched to R2.0 dev. 12.

But using the same exact configuration (without the SHT30) the board reacts strangely in R2-dev12.
It reboots randomly, or simply activates the relay but does not deactivate them, etc.
In other words it's not workable.

Attached the screenshots of the working configuration in R147 that does not perform correctly in R2-dev12.

Can someone help me finding out what is wrong?

thanks

Re: Problems with R2.0-dev12

Posted: 30 Nov 2017, 19:32
by grovkillen
Did you redo all the settings and saved it? As of now the config file of old RXXX is not compatible/converted to the new 2.0.0+ standard.

Re: Problems with R2.0-dev12

Posted: 30 Nov 2017, 21:29
by leel1967l
Yes of course. I forgot to mention but I erased the flash and manually reconfigured the unit with exactly as the R147 unit. Did it three times. Same result.

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 09:34
by leel1967l
Another info: I tested also with ESPurnia compiling myself the firmware and everything works fine.
Only R2-dev12 has problems for me.

Do you see anything wrong in my config?

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 10:20
by vader
Delete the entries for the relays in the device table. They don't need one, because they are controled directly by GPIO commands in your rules. A relay is no input switch. :mrgreen: And your rules are wrong. Change it to:

on push1#state do
if [push1#state]=1
gpio 12,1
.....

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 10:47
by leel1967l
Hi vader,
the logic I want to achieve is to toggle the relay when I click a button.
I might be wrong, but the way I understood is:
a) the rule should check the relay status and change it for every button click.
b) in order to refer to a relay in a rule I have to define in the device tab with a name

I am wrong?

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 10:53
by vader
In your case there should only the 2 switches in the device list. Done. Make the rules for each switch like I wrote in my last post and all is good. ;)

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 10:57
by leel1967l
ok. Will try and return.
thanks for your help.

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 15:10
by vader
You use on system#boot, as I can see, so don't forget to set the switch state also to 1 like the both relays.

E.g.
inputswitchstate 0,1
inputswitchstate 1,1

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 16:30
by leel1967l
Hi,
You mean adding:

Code: Select all

gpio,13,1
gpio,14,1
or do I have to write textually:

Code: Select all

inputswitchstate 0,1
inputswitchstate 1,1

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 16:32
by vader
Yep.

.....
gpio,16,1
inputswitchstate 0,1 (For push1 on task 1)
inputswitchstate 1,1 (For push2 on task 2)
endon
.....

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 16:41
by leel1967l
I wasn't aware of this rule sintax.

So in my configuration it would be:
.....
GPIO,16,1
inputswitchstate 1,1 (For push1 on task 1)
inputswitchstate 3,1 (For push2 on task 3)
endon
.....

Correct?

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 16:46
by vader
No. Exactly like I wrote:

.....
gpio,16,1
inputswitchstate 0,1
inputswitchstate 1,1
endon
.....

Copy and paste it ;) And don't forget to delete the 2 relay entries! So you have only the 2 buttons in the table. Push1 on task 1, Push2 on task 2.

explanation:
inputswitchstate 0,1 => 0=task number -1, 1=value/state

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 22:57
by leel1967l
Hi vader, I just finished testing it and ... it WORKS PERFECTY as you said.

thanks a lot for your help!

Re: Problems with R2.0-dev12

Posted: 01 Dec 2017, 23:22
by vader
No problemo. You are welcome. ;)

Re: Problems with R2.0-dev12

Posted: 03 Dec 2017, 21:39
by kimot
vader,
can you explain why we need this inputswitchstate command please?
I see, there are pull up resistors on inputs, so they hold 1( high) state all the time.
Except, when switch is pushed.
So why set it to 1 by sw command.
Thank you very much.

PS
By the way. Where we can find list and description of all actual commands for ESPeasy v2.0
Like this "inputswitchstate", "notify" etc.

Re: Problems with R2.0-dev12

Posted: 03 Dec 2017, 21:51
by vader
That's easy explained. You set with GPIO,16,1 only the output to 1, but the state of GPIO 12 (push1) remain on 0! So you have to manually set it also to 1 with a command. Make a // before the inputswitchstate commands and see what's happening after boot-up. You have to press the button twice for turning on/off the relay. But this is only 1 time after boot-up. Button and relay are "in sync" for now...

https://www.letscontrolit.com/wiki/inde ... _Reference

Re: Problems with R2.0-dev12

Posted: 03 Dec 2017, 23:03
by kimot
GPIO12 rele1 output - task2
GPIO16 rele2 output - task4
GPIO13 push1 input - task1 button to ground with pull up ( to change state of rele1 )
GPIO14 push2 input - task3 button to ground with pull up ( to change state of rele2 )
Pull up means, that there are internal resistor to +3.3V .
So logical 1 every time. How it can remain 0, like you wrote?

And your suggestion:

gpio,16,1
inputswitchstate 0,1 (For push1 on task 1)
inputswitchstate 1,1 (For push2 on task 2) // ?? this switch on task2 which is rele1 not push2. Why, when there is command gpio,12,1 in system boot event a few lines above?

And on your command reference, are you able find something about "inputswitchstate" or "notify" ?
I am not, unfortunately.
Therefore my question about this "secret" commands.
I am able find some infos there and there, but noting complex and on one place.

Re: Problems with R2.0-dev12

Posted: 04 Dec 2017, 09:20
by vader
@kimot: You seem not to be up-to-date. Have you read post #14? It's already done. So he shouldn't have task 3 and 4. Instead of "inputswitchstate" you can also use "taskvalueset".

E.g.
inputswitchstate 0,1 = taskvalueset 1,1,1

Both do the same. No secrets.... :)

Re: Problems with R2.0-dev12

Posted: 04 Dec 2017, 16:54
by danmero
Can you try using %eventvalue%

Code: Select all

On System#Boot do
 inputswitchstate 0,1
 gpio,12,1
 inputswitchstate 2,1
 gpio,16,1
endon

on push1#state do
 gpio,12,%eventvalue%
endon

on push2#state do
 gpio,16,%eventvalue%
endon
Regards,

Re: Problems with R2.0-dev12

Posted: 04 Dec 2017, 17:33
by vader
That is wrong! inputswitchstate is task number -1.

On System#Boot do
inputswitchstate 0,1
gpio,12,1
inputswitchstate 2,1
gpio,16,1
endon

Re: Problems with R2.0-dev12

Posted: 05 Dec 2017, 14:07
by danmero
Right, I correct my post , task value for inputswitchstate start at 0.

Regards,

Re: Problems with R2.0-dev12

Posted: 06 Dec 2017, 11:07
by leel1967l
Hi vader,
after several tests, I had to return to R147 as V2-dev12 is not stable with my boards (WEMOS MINI) and the push buttons rules controlling relays.
With my rules, V2-dev12 keeps rebooting and hanging.
Instead version R147 is absolutley stable and works perfectly.

I am using V2-dev12 with SHT30 and door contacts with the same board and this works perfectly.
So there must be some incompatibility somewhere.

thanks for your help.