czy jest możliwość skonfigurowania sieci nie globalnie ale w setup? Potrzebuje ze swoich zmiennych podać parametry sieci.
Code: Select all
#include <SuplaDevice.h>
#include <supla/network/esp_wifi.h>
#include <supla/control/relay.h>
#include <supla/network/esp_web_server.h>
#include <supla/network/esp_wifi.h>
#define RELAY_GPIO 12
char GUID[SUPLA_GUID_SIZE] = { 0x6E,0xAD,0xC6,0x7F,0x16,0xF2,0xE7,0x33,0xFC,0x2A,0xC6,0x019,0xFD,0xE6,0xE59,0x03 };
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x4C,0xEB,0xDA,0x82,0x55,0xE3,0x15,0xCD,0x10,0x8C,0xFB,0xDE,0x15,0x87,0xB4,0xAE};
//tu dziala
//Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
void setup() {
//tu nie dziala :(
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
Serial.begin(115200);
auto r1 = new Supla::Control::Relay(RELAY_GPIO);
char Supla_server[30], Supla_mail[30];
strcpy(Supla_server, "svr16.supla.org");
strcpy(Supla_mail, "mail@poczta.onet.pl");
SuplaDevice.begin(GUID,
Supla_server,
Supla_mail,
AUTHKEY);
}
void loop() {
SuplaDevice.iterate();
}
Taki błąd jest nawet jak ręcznie połącze WIFI w setup() przez:
WiFi.mode(WIFI_STA);
WiFi.begin("ssid","pass");
Code: Select all
Main storage not configured
Config storage not configured
Relay[0] turn OFF (duration 0 ms)
**** Digital write[0], gpio: 12; value 0
Relay[0] turn OFF (duration 0 ms)
**** Digital write[0], gpio: 12; value 0
GUID: 6EADC67F16F2E733FC2AC619FDE65903
Device name: SUPLA-ESP8266
Device software version: SDK 23.10.01-dev
Initializing network layer
Network AP/hostname: SUPLA-ESP8266-BCDDC23121FF
Using Supla protocol version 20
Current status: [5] SuplaDevice initialized
Enter normal mode
Warning: network is not ready (10 s)
Current status: [8] No connection to network
Warning: network is not ready (20 s)
Warning: network is not ready (30 s)