od wczoraj (bo akurat zacząłem robić jakieś nowe zabawki) obserwuję problem z rejestracją nowego urządzenia na svr43 przy korzystaniu z Wifimanagera.
Kod jak poniżej:
Code: Select all
#include <FS.h>
#include <SuplaDevice.h>
#include <supla/network/esp_wifi.h>
#include <supla/control/button.h>
#include <supla/control/action_trigger.h>
#include <supla/device/status_led.h>
#include <supla/storage/littlefs_config.h>
#include <supla/network/esp_web_server.h>
#include <supla/network/html/device_info.h>
#include <supla/network/html/protocol_parameters.h>
#include <supla/network/html/status_led_parameters.h>
#include <supla/network/html/wifi_parameters.h>
#include <supla/events.h>
#include <supla/control/light_relay.h>
#include <supla/storage/storage.h>
#include <supla/storage/eeprom.h>
#define SUPLA_STATUS_LED_GPIO 14
#define RELAY_GPIO 4
#define BUTTON_GPIO 2
#define SUPLA_DEV_NAME "Supla - test z wifimanager"
#define SUPLA_HOSTNAME "SuplaRelaysAP"
Supla::Eeprom eeprom;
Supla::ESPWifi wifi;
Supla::LittleFsConfig configSupla;
Supla::Device::StatusLed statusLed(SUPLA_STATUS_LED_GPIO, false);
Supla::EspWebServer suplaServer;
Supla::Html::DeviceInfo htmlDeviceInfo(&SuplaDevice);
Supla::Html::WifiParameters htmlWifi;
Supla::Html::ProtocolParameters htmlProto;
Supla::Html::StatusLedParameters htmlStatusLed;
void setup() {
Serial.begin(9600);
Serial.println("");
Serial.println(String("Starting module ")+String(SUPLA_DEV_NAME)+String(" for Supla"));
auto relay = new Supla::Control::LightRelay(RELAY_GPIO);
auto relay_button = new Supla::Control::Button(BUTTON_GPIO, true, true);
relay_button->setHoldTime(3000);
relay_button->setMulticlickTime(300);
relay_button->addAction(Supla::TOGGLE, relay, Supla::ON_CLICK_1);
relay_button->addAction(Supla::TOGGLE_CONFIG_MODE, SuplaDevice, Supla::ON_HOLD);
SuplaDevice.setName(SUPLA_DEV_NAME);
SuplaDevice.setHostName(SUPLA_HOSTNAME);
SuplaDevice.begin();
}
void loop() {
SuplaDevice.iterate();
}
Natomiast kod "po staremu" (tak - wiem, za dużo nagłówków, ale mi się nie chciało usuwać):13:57:39.671 -> Enter normal mode
13:57:39.671 -> WiFi: establishing connection with SSID: "********"
13:57:39.718 -> Using Supla protocol version 16
13:57:39.765 -> LAST STATE ADDED: SuplaDevice initialized
13:57:39.812 -> Current status: [5] SuplaDevice initialized
13:57:43.398 -> local IP: 10.0.0.84
13:57:43.398 -> subnetMask: 255.255.255.0
13:57:43.446 -> gatewayIP: 10.0.0.1
13:57:43.494 -> Signal strength (RSSI): -57 dBm
13:57:43.494 -> Establishing Secured connection without certificate matching with: svr43.supla.org (port: 2016)
13:57:43.591 -> LAST STATE ADDED: Not connected to Supla server
13:57:43.638 -> Current status: [6] Not connected to Supla server
13:57:43.733 -> Connection fail (0). Server: svr43.supla.org
13:57:53.465 -> Establishing with: svr43.supla.org (port: 2016)
13:57:53.465 -> Connection fail (0). Server: svr43.supla.org
13:58:03.462 -> Establishing with: svr43.supla.org (port: 2016)
13:58:03.509 -> Connection fail (0). Server: svr43.supla.org
13:58:13.457 -> Establishing with: svr43.supla.org (port: 2016)
13:58:13.505 -> Connection fail (0). Server: svr43.supla.org
13:58:23.435 -> Establishing with: svr43.supla.org (port: 2016)
13:58:23.483 -> Connection fail (0). Server: svr43.supla.org
Code: Select all
#include <FS.h>
#include <SuplaDevice.h>
#include <supla/network/esp_wifi.h>
#include <supla/control/button.h>
#include <supla/control/action_trigger.h>
#include <supla/device/status_led.h>
#include <supla/storage/littlefs_config.h>
#include <supla/network/esp_web_server.h>
#include <supla/network/html/device_info.h>
#include <supla/network/html/protocol_parameters.h>
#include <supla/network/html/status_led_parameters.h>
#include <supla/network/html/wifi_parameters.h>
#include <supla/events.h>
#include <supla/control/light_relay.h>
#include <supla/storage/storage.h>
#include <supla/storage/eeprom.h>
#define SUPLA_STATUS_LED_GPIO 14
#define RELAY_GPIO 4
#define BUTTON_GPIO 2
#define SUPLA_DEV_NAME "Supla - test z wifimanager"
#define SUPLA_HOSTNAME "SuplaRelaysAP"
Supla::ESPWifi wifi("***", "**");
Supla::Device::StatusLed statusLed(SUPLA_STATUS_LED_GPIO, false);
void setup() {
Serial.begin(9600);
Serial.println("");
Serial.println(String("Starting module ")+String(SUPLA_DEV_NAME)+String(" for Supla"));
auto relay = new Supla::Control::LightRelay(RELAY_GPIO);
auto relay_button = new Supla::Control::Button(BUTTON_GPIO, true, true);
relay_button->setHoldTime(3000);
relay_button->setMulticlickTime(300);
relay_button->addAction(Supla::TOGGLE, relay, Supla::ON_CLICK_1);
relay_button->addAction(Supla::TOGGLE_CONFIG_MODE, SuplaDevice, Supla::ON_HOLD);
SuplaDevice.setName(SUPLA_DEV_NAME);
SuplaDevice.setHostName(SUPLA_HOSTNAME);
// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {***} ;
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {***};
SuplaDevice.begin(GUID, // Global Unique Identifier
"svr43.supla.org", // SUPLA server address
"[email protected]", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}
Testy robiłem zarówno na nieco starszej jak i aktualnie ściągniętej wersji SuplaDevice.13:59:00.284 -> WiFi: establishing connection with SSID: "****"
13:59:00.332 -> Using Supla protocol version 16
13:59:00.427 -> Current status: [5] SuplaDevice initialized
13:59:04.057 -> local IP: 10.0.0.84
13:59:04.057 -> subnetMask: 255.255.255.0
13:59:04.057 -> gatewayIP: 10.0.0.1
13:59:04.104 -> Signal strength (RSSI): -56 dBm
13:59:04.152 -> Establishing Secured connection without certificate matching with: svr43.supla.org (port: 2016)
13:59:05.005 -> Connected to Supla Server
13:59:05.005 -> Current status: [10] Register in progress
13:59:05.052 -> Send: [..... ]
13:59:06.134 -> Recv: [..... ]
13:59:06.228 -> Device registered (activity timeout 120 s, server version: 19, server min version: 1)
Co ciekawe - metoda pierwsza działa bez zarzutu dla wcześniej zarejestrowanych urządzeń.
Używam Wemos D1 mini
Czy ktoś spotkał się czymś takim? Jaki może być powód? Ja osobiście podejrzewam generator kluczy przy opcji pierwszej.
Pozdrawiam
