WIFI switch with the ESP8266

3 years 4 months ago - 3 years 4 months ago #3751 by jonarotz

swisscore wrote: Yes you can, with all esp8266 module you have normally more than 1 GPIO, just the ESP-01 who is the moste difficult to use because of special function of GPIO (prog,boot) you need to have nothing in input and fixed level as output.


How would I configure these other GPIO's for use in the easyiot cloud?

Please Log in or Create an account to join the conversation.

3 years 4 months ago #3752 by swisscore
You need to add code in your esp8266 to manage a new topic, per example topic1 = relay1, topic 2 = relay2
And in easyiot you declare 2 différents button one with topic1 and the other with topic2

Send topic1 = "ON" per example from easyiot and in your code when you see "topic1", read the "ON" and like this you know you need to turn ON the relay1 who is linked to topic1 (in your esp8266) and the same for the topic2

Please Log in or Create an account to join the conversation.

3 years 4 months ago #3753 by jonarotz

swisscore wrote: You need to add code in your esp8266 to manage a new topic, per example topic1 = relay1, topic 2 = relay2
And in easyiot you declare 2 différents button one with topic1 and the other with topic2

Send topic1 = "ON" per example from easyiot and in your code when you see "topic1", read the "ON" and like this you know you need to turn ON the relay1 who is linked to topic1 (in your esp8266) and the same for the topic2


Ok, thanks!
Please bear with me...I am still trying to figure this stuff out.
How does it assign a GPIO? What I am asking is, how does it trigger GPIO2, 3, 4, etc...how do I assign a particular GPIO to a switch. Basically "switch 2" would trigger GPIO2 and so on.

Please Log in or Create an account to join the conversation.

3 years 4 months ago #3754 by jonarotz
Looking back at the code and trying to figure out where to add this new topic is very confusing for me and I think it is over my head.

Please Log in or Create an account to join the conversation.

3 years 4 months ago #3755 by swisscore
you have only one input to read datas from MQTT sender and after in your code you can read it and put something like "
if receivedTopic = topic1 then Relay1 = ON/OFF
else if receivedTopic = topic2 then Relay2 = ON/OFF

I use with C++ and arduino IDE code, I don't know in lua

Please Log in or Create an account to join the conversation.

3 years 4 months ago #3756 by jonarotz

swisscore wrote: you have only one input to read datas from MQTT sender and after in your code you can read it and put something like "
if receivedTopic = topic1 then Relay1 = ON/OFF
else if receivedTopic = topic2 then Relay2 = ON/OFF

I use with C++ and arduino IDE code, I don't know in lua


Thanks for your help.
I am using the exact code posted in the example, but I have no idea where to add that section of code.

Please Log in or Create an account to join the conversation.

Time to create page: 0.180 seconds

Forum latest

  • No posts to display.