Post about your Basic project here

Moderator: Mmiscool

User avatar
By luc VdV
#41657 For the ESP-01 module, I suggest you use GPIO3 as output for your relais.
GPIO3 is the RX-input but if you don't use serial-input, this pin can be used without problems.
something like this:
relais.png
You do not have the required permissions to view the files attached to this post.
User avatar
By forlotto
#41979 Using tx or rx for relays is not suggested for relays if you ask me it may cause conflict in my case it does as gpio 3 does not work when using a relay board with an opticoupler ic basically an led inside a chip that turns on and in turn the light is detected and turns the relay on. The problem that occurs is because they are data lines the device does not connect to wifi or function correctly.

Keep in mind this may be different on an esp01 I use a nodemcu it is different hardware indeed but I speculate and could be wrong but I'd hate to see this suggestion cause other users issues.
User avatar
By grzesiu
#44959 For DHT support You need compile project by yourself and add some code for this. I made it by adding

Code: Select all#include <DHT.h>   // adafruit library
DHT dht(5, DHT21);   // 5 is GPIO5, DHT21 you may want change at DHT11 or DHT22
dht.begin();             //   in setup()


in ESP8266Basic.ino
and

Code: Select all  if ( Param0 == F("dtemp"))
  {
    SetMeThatVar(Param1, String(dht.readTemperature()));               // if you want temperature in celcius scale
//    SetMeThatVar(Param1, String(dht.readTemperature(true)));    // if you want temperature in fahrenheit scale
    return;
  }
  if ( Param0 == F("dhum"))
  {
    SetMeThatVar(Param1, String(dht.readHumidity()));
    return;
  }
  if ( Param0 == F("dheatindex"))
  {
    SetMeThatVar(Param1, String(dht.computeHeatIndex(t, h, false)));         // if you want heat index in celcius scale
//    SetMeThatVar(Param1, String(dht.computeHeatIndex(t, h)));         // if you want heat index in fahrenheit scale
    return;
  }

in Commands.ino before
Code: Select allif ( Param0 == "temp" | Param0 == "ti")


and then you can use this command in your basic program:
dtemp variable
dhum variable
dheatindex variable