Relè Arduino Mega Esp8266 Alexa

angela26
Posts: 3
Joined: Thu Mar 11, 2021 10:23 pm

Post

Ciao a tutti,
sto cercando di comandare da Alexa l'impianto di domotica di casa mia di 13 luci collegate ad una scheda relè, Arduino Mega ed Esp8266.
Ho caricato su Esp8266 il codice Supla, ho scaricato le skill per Alexa. Sul mio account Supla, i canali risultano creati, su Alexa i pulsanti funzionano correttamente, ma i relè non si attivano. Non sono molto esperta e non capisco se manchi qualche istruzione sulla scheda Esp8266 o sulla scheda Arduino. Potete aiutarmi? Avevo inizialmente provato la vecchia versione dell'esempio Arduino Mega + Nodemcu e funzionava parzialmente. Grazie mille.

Questo è il codice di Esp8266:
#include <SuplaDevice.h>
#include <supla/control/relay.h>
#if defined(ARDUINO_ARCH_ESP8266)
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("xxxxxxx", "xxxxxx");
#endif

void setup() {
Serial.begin(115200);

// Replace the falowing GUID
char GUID[SUPLA_GUID_SIZE] = {0x3F,0xF7,0x34,0xC2,0x87,0xBC,0xD0,0x9B,0x7F,0x3B,0x6C,0x65,0x91,0xD9,0x93,0x5B};
// with GUID that you can retrieve from https://www.supla.org/arduino/get-guid

// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x4A,0x56,0x33,0xAE,0xE9,0x2A,0xB3,0xB0,0xA5,0x10,0x7F,0xFE,0x8D,0x69,0x59,0xF0};

new Supla::Control::Relay(22, false);
new Supla::Control::Relay(23, false);
new Supla::Control::Relay(24, false);
new Supla::Control::Relay(25, false);
new Supla::Control::Relay(26, false);
new Supla::Control::Relay(27, false);
new Supla::Control::Relay(28, false);
new Supla::Control::Relay(29, false);
new Supla::Control::Relay(30, false);
new Supla::Control::Relay(31, false);
new Supla::Control::Relay(32, false);
new Supla::Control::Relay(33, false);
new Supla::Control::Relay(34, false);

SuplaDevice.begin(GUID, // Global Unique Identifier
"svrxx.supla.org", // SUPLA server address
"[email protected]", // Emai address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}


Questo è quello che ricevo sul Monitor Seriale per la scheda Esp8266 quando accendo e spendo da Alexa:

**** Digital write[0], pin: 22; value: 0
Channel(0) value changed to 1
Sending: [53 55 50 4C 41 C 5 0 0 0 78 0 0 0 6 0 0 0 0 0 0 0 0 1 ]
Sending: [53 55 50 4C 41 ]
Sending: [53 55 50 4C 41 C 6 0 0 0 64 0 0 0 9 0 0 0 0 1 0 0 0 0 0 0 0 ]
Sending: [53 55 50 4C 41 ]
Received: [53 55 50 4C 41 C 6 0 0 0 6E 0 0 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 53 55 50 4C 41 ]
**** Digital write[0], pin: 22; value: 1
Channel(0) value changed to 0
Sending: [53 55 50 4C 41 C 7 0 0 0 78 0 0 0 6 0 0 0 0 0 0 0 0 1 ]
Sending: [53 55 50 4C 41 ]
Sending: [53 55 50 4C 41 C 8 0 0 0 64 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 ]
Sending: [53 55 50 4C 41 ]

Su Arduino, ho usato una Software Serial
User avatar
klew
Posts: 13910
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 135 times
Been thanked: 137 times

Post

Hi

I guess that you want to use ESP8266 based device to control (via serial interface) relays connected to arduino board.
There are seven some Arduino mega boards with ESP included and connect via serial.
So far there is no SW available for such setup. Currently you can either use ESP with relays controlled directly by gpio, or Arduino mega with ethernet shield.

I plan to add SW for this setup but I can't promise any date.
Najlepsze suple dla Twojego domu :mrgreen:
angela26
Posts: 3
Joined: Thu Mar 11, 2021 10:23 pm

Post

Ciao,
grazie mille per la tua risposta.
Ho un arduino mega per il numero dei pin digitali.
Attualmente, accendo le luci con un app che ho sviluppato, via ble con Esp32 collegato all'arduino mega.
Se riesci a sviluppare il SW in tempi rapidi, ne sarei proprio contenta.
Supla mi piace tantissimo.
Devo collegare anche due tende elettriche.
Grazie mille.
Puoi avvisarmi quando sarà pronto?
Grazie ancora.
Un saluto.
Angela
User avatar
klew
Posts: 13910
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 135 times
Been thanked: 137 times

Post

I don't know when it will be ready. It can be matter of months.

For sure it will be quicker if you'll just add there ethernet shield to your Arduino Mega ;)
Najlepsze suple dla Twojego domu :mrgreen:
angela26
Posts: 3
Joined: Thu Mar 11, 2021 10:23 pm

Post

Ti aspetto! Se sei veloce a programmare quanto a rispondere, sono sicura che aspetterò poco.
Grazie ancora. A prestissimo!!!!
:D

Return to “Pomoc”