Page 1 of 1

[SOLVED] Automatic GPIO High, after few seconds

Posted: 26 Jul 2016, 08:57
by garvarma
Hello,

Continue with my test of ESPEasy and mqtt, i want to publish by openhab to mqtt to switch on GPIO2 on device with ESPEasy.

After configuring and touch many configurations in ESP Easy, i decided to reset device, to begin from 0 (i did it by rule like this):

Code: Select all

On System#Boot do    
  publish /nodemcu/cmd reset
  reset  
endon
and worked because i tourned to R108.

After rebooting device, i update to R113, and then I configure, IP device, mqtt server, and devices (rules are all 0):
devices2.JPG
devices2.JPG (48.85 KiB) Viewed 6034 times
devices1.JPG
devices1.JPG (43.12 KiB) Viewed 6034 times
In hardware menu, i have PIN 2 like default.

Well, when i switch on device, led in GPIO Switch on. and then by http i turn it off, becaue i want begin with my test.

I dunno why, after a few seconds, after turning off led by http, himself turn it on automatic, there are logs:

Code: Select all

EVENT: Clock#Time=Tue,08:36
SW   : GPIO 2 Set to 0                ====> set by http://IP_device/control?cmd=GPIO,2,0
SW   : State 0
EVENT: subir#Switch=0.00
SW   : State 0
EVENT: bajar#Switch2=0.00
HTTP : Delay 999 ms
MQTT : Topic: /nodemcu/subir/Switch
MQTT : Payload: 0
MQTT : Topic: /nodemcu/bajar/Switch2
MQTT : Payload: 0
WD   : Uptime 10 ConnectFailures 11 FreeMem 29416
WD   : Uptime 10 ConnectFailures 10 FreeMem 29648
MQTT : Connection lost
MQTT : Connected to broker
Subscribed to: /nodemcu/#
MQTT : Topic: /nodemcu/subir
MQTT : Payload: 1
MQTT : Topic: /nodemcu/bajar
MQTT : Payload: 1
MQTT : Topic: /nodemcu/gpio/2
MQTT : Payload: 1
SW   : GPIO 2 Set to 1
SW   : State 1
EVENT: subir#Switch=1.00
SW   : State 1
EVENT: bajar#Switch2=1.00
HTTP : Delay 999 ms
MQTT : Topic: /nodemcu/subir/Switch
MQTT : Payload: 1
MQTT : Topic: /nodemcu/bajar/Switch2
MQTT : Payload: 1
EVENT: Clock#Time=Tue,08:37
WD   : Uptime 11 ConnectFailures 12 FreeMem 29400
WD   : Uptime 11 ConnectFailures 11 FreeMem 29632
MQTT : Connection lost
MQTT : Connected to broker
Subscribed to: /nodemcu/#
I dunno why, each time when device lost connection to broker and connect again, always switch to 1 GPIO 2.

maybe is a bug on R113? Why this occurs?

thanks

Re: Automatic GPIO High, after few seconds

Posted: 26 Jul 2016, 09:05
by tozett
i have no direct answer to your question,
but i noticed in your rules, you do a reset twice.
1 x with publish to cmd and
1x with reset as a rules-cmd..

may only 1 reset is enough?

maybe the gpio goes 1, because there is something wired to the pin?
or a long wire on this pin?
maybe you have an unstable board?

for all software/firmware issues or explanations, there must be comments be a coder. (not me :shock: )

Re: Automatic GPIO High, after few seconds

Posted: 27 Jul 2016, 08:47
by garvarma
Hi tozett,

Yes i know that in rules the reset command was twice. The reason is because in wiki says that by mqtt and by http is posible to send comands, so first of all I tried by http, but doesn't work..., then i tried by mqtt directly, but also doesn't work...

So at the end i deciced to do it by rules, and twice because if by publish to cmd mqtt-rule doesn't work, then do it by directly command rule.
may only 1 reset is enough?

Well with this option worked, beucase i think that by publish to cmd mqtt didn't worked.
maybe the gpio goes 1, because there is something wired to the pin?
or a long wire on this pin?
maybe you have an unstable board?
The only thing that was wired is a led. to show if GPIO is 1 or 0. But well, at the end i found which was the problem, but i don't understand why. The problem was other esp that i have plug, but with other name_device, and other devices name, that each time (publish something) and led on esp1 switched on, every time that i switched off.

Re: Automatic GPIO High, after few seconds

Posted: 28 Jul 2016, 11:21
by tozett
may check to different device-numbers on main-page of espeasy.
also may not use "global-sync" ?

if case is solved, may change topic on first post to " SOLVED ..."? ;)