Welcome, Guest
Username: Password: Remember me

TOPIC: WIFI switch with the ESP8266

WIFI switch with the ESP8266 2 months 3 weeks ago #3751

  • jonarotz
  • jonarotz's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
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?
Last Edit: 2 months 3 weeks ago by jonarotz.
The administrator has disabled public write access.

WIFI switch with the ESP8266 2 months 3 weeks ago #3752

  • swisscore
  • swisscore's Avatar
  • Offline
  • New Member
  • Posts: 16
  • Karma: 0
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
The administrator has disabled public write access.

WIFI switch with the ESP8266 2 months 3 weeks ago #3753

  • jonarotz
  • jonarotz's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
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.
The administrator has disabled public write access.

WIFI switch with the ESP8266 2 months 3 weeks ago #3754

  • jonarotz
  • jonarotz's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
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.
The administrator has disabled public write access.

WIFI switch with the ESP8266 2 months 3 weeks ago #3755

  • swisscore
  • swisscore's Avatar
  • Offline
  • New Member
  • Posts: 16
  • Karma: 0
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
The administrator has disabled public write access.

WIFI switch with the ESP8266 2 months 3 weeks ago #3756

  • jonarotz
  • jonarotz's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
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.
The administrator has disabled public write access.
Time to create page: 0.121 seconds
Powered by Kunena Forum