Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By b8dm0j0
#36003
Barnabybear wrote:Hi - I used this code https://github.com/openhomeautomation/esp8266-relay
I made some slight mods to 'aREST.h' to make the out put a short pulse rather than an 'on (stay on)' or 'off (stay off)'.
See what you think and shout if you need help.

thanks again, would it be possible for you to include your modified arest.h
User avatar
By b8dm0j0
#36468
Barnabybear wrote:Hi - I used this code https://github.com/openhomeautomation/esp8266-relay
I made some slight mods to 'aREST.h' to make the out put a short pulse rather than an 'on (stay on)' or 'off (stay off)'.
See what you think and shout if you need help.

possible to upload your modified arest.h?
User avatar
By Barnabybear
#36470 https://github.com/marcoschwartz/aREST/ ... er/aREST.h
Lines 750 & 751.
Code: Select all       // Apply on the pin
       digitalWrite(pin,value);

Change to.
Code: Select all       // Apply on the pin
       digitalWrite(pin,High); // sets output pin high to simulate button press.
       delay(1000); // delay for length of button press.
       digitalWrite(pin,LOW); // sets output pin bak to low to end button press.

I have this setup on GPIO2 so to opperate I can go to ESP IP (192.168.1.xx) and press the button or
go to ESP IP and attach the command (192.168.1.xx/digital/2/1)
format < ESP IP address > / < type of operation (digital write) > / < GPIO to affect (2) > / < effect ( set as 1) >

Mine has just started to hang sometimes (reset fixes it) I'll look into it later.
User avatar
By b8dm0j0
#36992
Barnabybear wrote:https://github.com/marcoschwartz/aREST/blob/master/aREST.h
Lines 750 & 751.
Code: Select all       // Apply on the pin
       digitalWrite(pin,value);

Change to.
Code: Select all       // Apply on the pin
       digitalWrite(pin,High); // sets output pin high to simulate button press.
       delay(1000); // delay for length of button press.
       digitalWrite(pin,LOW); // sets output pin bak to low to end button press.

I have this setup on GPIO2 so to opperate I can go to ESP IP (192.168.1.xx) and press the button or
go to ESP IP and attach the command (192.168.1.xx/digital/2/1)
format < ESP IP address > / < type of operation (digital write) > / < GPIO to affect (2) > / < effect ( set as 1) >

Mine has just started to hang sometimes (reset fixes it) I'll look into it later.

thanks