Welcome, Guest
Username: Password: Remember me

TOPIC: ESP EasyRelay little mod

ESP EasyRelay little mod 2 years 1 week ago #2368

  • javier
  • javier's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
hahaha thanks for all i will write the sketch and try.

I don't have to tell to arduino how are the light, because arduino its the only one that control the lighs I only have one relay.
Attachments:
The administrator has disabled public write access.

ESP EasyRelay little mod 2 years 1 week ago #2369

  • javier
  • javier's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Sorry for the picture it seems that it´s draw by a 5 years old, trackpad its a sheet
The administrator has disabled public write access.

ESP EasyRelay little mod 2 years 1 week ago #2393

  • javier
  • javier's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
THANKS FOR ALL :cheer: IT WORKS PERFECTLY! IT CHANGE THE STATE AT SERVER!

Here is my code for everyone who needs! it include 1 relay and one switch at pin 2, with arduino pull up resistor! only have to put gnd with pin 2 and the relay will change. Relay its at pin 6.

void loop()
{

esp.process();

estadoActual = digitalRead(pin);

if (estadoAnterior != estadoActual) // ha habido un cambio de estado

{
contador++; // cuenta los cambios de estado
int validarPar = contador % 2; // solo queremos los cambios pares
if (validarPar != 1) // si el cambio es par

{

digitalWrite(RELAY_1,!digitalRead(RELAY_1));
Esp8266EasyIoTMsg msgRelay1(1, V_DIGITAL_VALUE);
esp.send(msgRelay1.set(!digitalRead(RELAY_1)));

}

estadoAnterior = estadoActual;
}

}

void incomingMessage(const Esp8266EasyIoTMsg &message) {
// We only expect one type of message from controller. But we better check anyway.

Serial.println("New message");
if (message.type==V_DIGITAL_VALUE) {
// Change relay state

digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);

}
}
The administrator has disabled public write access.

ESP EasyRelay little mod 2 years 1 week ago #2394

  • javier
  • javier's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Thats the pcb
Last Edit: 2 years 1 week ago by javier.
The administrator has disabled public write access.

ESP EasyRelay little mod 1 month 1 week ago #3868

hi,

How do you setup in the EasyIOT Server that connects to one ESP with one arduino but multiple relays? Is it possible?
If yes, please help me through this.
I was able to add the one ESP8266 driver to my server but I'm not sure how do I add other relays(pins) that is connected to that one ESP.

Thanks.. hope you can help
The administrator has disabled public write access.
Time to create page: 0.187 seconds
Powered by Kunena Forum