Problem z rejestracją (svr43)

KaDet
Posts: 52
Joined: Fri Nov 27, 2020 5:06 pm
Location: Dąbrowa Górnicza

Post

Cześć,
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();
}
nie potrafi dodać nowego urządzenia. Oczywiście, przy pierwszym razie uruchamia się tryb konfiguracji, gdzie wprowadzam poprawne dane, a następnie łączy do sieci lokalnej i...
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
Natomiast kod "po staremu" (tak - wiem, za dużo nagłówków, ale mi się nie chciało usuwać):

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();
}
działa bardzo dobrze i prawidłowo:
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)
Testy robiłem zarówno na nieco starszej jak i aktualnie ściągniętej wersji SuplaDevice.


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
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

Pokaż proszę pełny log (od początku) w tym problematycznym przypadku.
Najlepsze suple dla Twojego domu :mrgreen:
KaDet
Posts: 52
Joined: Fri Nov 27, 2020 5:06 pm
Location: Dąbrowa Górnicza

Post

Zrobiłem testy raz jeszcze. Najpierw na wersji 2.3.5, na której działają inne kości i się "kiedyś" zarejestrowały.
Pełen log poniżej. Wyzerowałem kość, wgrałem soft na "czysto".
14:44:04.122 -> Starting module Supla - test z wifimanager for Supla
14:44:04.169 -> Supla - starting initialization
14:44:04.169 -> Storage initialization
14:44:04.216 -> readStorage: 8; Read: [FF FF FF FF FF FF FF FF ]
14:44:04.264 -> Storage: missing Supla tag. Rewriting...
14:44:04.311 -> Wrote 8 bytes to storage at 0
14:44:04.357 -> Commit
14:44:04.357 -> LittleFsConfig: init successful
14:44:04.405 -> LittleFsConfig:: config file missing
14:44:04.405 -> Config incomplete: missing server
14:44:04.452 -> Config incomplete: missing email
14:44:04.499 -> Config incomplete: missing Wi-Fi SSID
14:44:04.546 -> LAST STATE ADDED: Missing Wi-Fi SSID
14:44:04.593 -> Config incomplete: missing Wi-Fi password
14:44:04.641 -> LAST STATE ADDED: Missing Wi-Fi password
14:44:04.688 -> Config incomplete: deviceMode = CONFIG
14:44:04.736 -> Validating storage state section with current device configuration
14:44:04.783 -> Element state section size doesn't match current device configuration
14:44:04.877 -> Relay[0] turn OFF (duration 0 ms)
14:44:04.877 -> **** Digital write[0], gpio: 4; value 0
14:44:04.971 -> LAST STATE ADDED: Missing server address
14:44:04.971 -> Current status: [3] Missing server address
14:44:05.019 -> LAST STATE ADDED: Missing email address
14:44:05.067 -> Current status: [32] Missing email address
14:44:05.114 -> Initializing network layer
14:44:05.162 -> Network AP/hostname: SuplaRelaysAP
14:44:05.210 -> WiFi: enter config mode with SSID: SuplaRelaysAP
14:44:05.210 -> Starting local web server
14:44:05.257 -> LAST STATE ADDED: Config mode
14:44:05.305 -> Current status: [40] Config mode
14:44:05.305 -> Using Supla protocol version 16
14:44:05.353 -> LittleFsConfig: init successful
14:44:05.401 -> Successfully generated GUID and AuthKey
14:44:05.448 -> New GUID: C0676AD0C45FCC1B30279E35AD84661D
14:44:05.494 -> New AuthKey: 19AC532E5F2BED460FC9BD0BC6DFD790
14:44:09.808 -> Initialization of elementStateOffset: 8
14:44:09.857 -> Updating Storage preamble
14:44:09.905 -> Wrote 8 bytes to storage at 0
14:44:09.905 -> Wrote 6 bytes to storage at 15
14:44:09.952 -> Wrote 4 bytes to storage at 21
14:44:09.999 -> Wrote 1 bytes to storage at 25
14:44:10.047 -> Wrote 7 bytes to storage at 8
14:44:10.047 -> Commit
14:53:34.472 -> SERVER: get request
14:53:34.613 -> SERVER: get favicon.ico
14:54:19.528 -> SERVER: post request
14:54:19.528 -> SERVER: key sid, value kadetint_2
14:54:19.575 -> SERVER: key wpw, value !Int3rn3t#
14:54:19.575 -> SERVER: key pro, value 0
14:54:19.623 -> SERVER: key svr, value svr43.supla.org
14:54:19.670 -> SERVER: key eml, value *****@gmail.com
14:54:19.718 -> SERVER: key mqttserver, value
14:54:19.767 -> SERVER: key mqttport, value 1883
14:54:19.767 -> SERVER: key mqtttls, value 0
14:54:19.813 -> SERVER: key mqttauth, value 1
14:54:19.860 -> SERVER: key mqttuser, value
14:54:19.907 -> SERVER: key mqttpasswd, value
14:54:19.907 -> SERVER: key mqttprefix, value
14:54:19.953 -> SERVER: key mqttqos, value 0
14:54:20.000 -> SERVER: key mqttretain, value 1
14:54:20.000 -> SERVER: key mqttpooldelay, value 0
14:54:20.047 -> SERVER: key led, value 0
14:54:20.094 -> SERVER: key rbt, value 2
14:54:20.142 -> rbt found 2
14:54:20.142 -> Triggering soft restart
14:54:20.142 -> SERVER: key plain, value sid=*******&wpw=********3&pro=0&svr=svr43.supla.org&eml=****%40gmail.com&mqttserver=&mqttport=1883&mqtttls=0&mqttauth=1&mqttuser=&mqttpasswd=&mqttprefix=&mqttqos=0&mqttretain=1&mqttpooldelay=0&led=0&rbt=2
14:54:20.424 -> SERVER: get request
14:54:22.546 -> Reset requested. Reset device
14:54:22.546 -> LAST STATE ADDED: Software reset
14:54:22.594 -> Current status: [41] Software reset
14:54:22.641 -> LittleFsConfig: init successful
14:54:22.688 -> Stopping local web server
14:54:22.688 -> Resetting in 0.5s...
14:54:23.111 -> See you soon!
14:54:23.204 -> ?)⸮
14:54:23.204 -> ⸮@H⸮⸮⸮⸮)⸮
14:54:23.298 -> Starting module Supla - test z wifimanager for Supla
14:54:23.345 -> Supla - starting initialization
14:54:23.392 -> Storage initialization
14:54:23.392 -> readStorage: 8; Read: [53 55 50 4C 41 1 0 1 ]
14:54:23.486 -> Storage: Number of sections 1
14:54:23.486 -> Reading section: 0
14:54:23.486 -> readStorage: 7; Read: [3 B 0 0 0 0 0 ]
14:54:23.533 -> Section type: 3; size: 11
14:54:23.580 -> LittleFsConfig: init successful
14:54:23.580 -> LittleFsConfig: initializing storage from file...
14:54:23.674 -> Validating storage state section with current device configuration
14:54:23.721 -> Storage state section validation completed. Loading elements state...
14:54:23.815 -> readStorage: 6; Read: [10 27 0 0 0 0 ]
14:54:23.815 -> LightRelay[0] settings restored from storage. Total lifespan: 10000 h; current operating time: 0 s
14:54:23.957 -> readStorage: 4; Read: [0 0 0 0 ]
14:54:24.004 -> readStorage: 1; Read: [0 ]
14:54:24.004 -> Relay[0] turn OFF (duration 0 ms)
14:54:24.051 -> **** Digital write[0], gpio: 4; value 0
14:54:24.098 -> Initializing network layer
14:54:24.145 -> Network AP/hostname: SuplaRelaysAP
14:54:24.192 -> Enter normal mode
14:54:24.192 -> WiFi: establishing connection with SSID: "******"
14:54:24.239 -> Using Supla protocol version 16
14:54:24.286 -> LAST STATE ADDED: SuplaDevice initialized
14:54:24.333 -> Current status: [5] SuplaDevice initialized
14:54:27.923 -> local IP: 10.0.0.58
14:54:27.923 -> subnetMask: 255.255.255.0
14:54:27.971 -> gatewayIP: 10.0.0.1
14:54:27.971 -> Signal strength (RSSI): -69 dBm
14:54:28.019 -> Establishing Secured connection without certificate matching with: svr43.supla.org (port: 2016)
14:54:28.115 -> LAST STATE ADDED: Not connected to Supla server
14:54:28.163 -> Current status: [6] Not connected to Supla server
14:54:28.210 -> Connection fail (0). Server: svr43.supla.org
14:54:37.947 -> Establishing with: svr43.supla.org (port: 2016)
14:54:37.996 -> Connection fail (0). Server: svr43.supla.org
14:54:47.954 -> Establishing with: svr43.supla.org (port: 2016)
14:54:48.000 -> Connection fail (0). Server: svr43.supla.org
następnie całkowicie usunąłem SuplaDevice i dodałem zupełnie czysto z githuba (nie nadpisując jak poprzednio).
Przy pierwszym przejściu wybrałem (w nowym okienku wifimanagera) połączenie z certyfikatem Supla i efekt był analogiczny, z tym, ze komunikaty mówiły o niemożności połączenia się z certyfikatem. Przy drugim podejściu wybrałem bez certyfikatu i... wszystko poszło.


Temat wobec tego można uznać zasadniczo za zamknięty, aczkolwiek niepokoi mnie to, ze nie łączy się wraz z certyfikatem. Czy cos trzeba jeszcze zrobić?
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

Tak, trzeba dodać certyfikat ;)

W aktualnej wersji przykładu WebInterface jest include dodany oraz dwa wywołania metod rejestrujących certyfikaty.
Daj znać gdyby nie udało Ci się tego znaleźć.
Najlepsze suple dla Twojego domu :mrgreen:
system2002
Posts: 53
Joined: Tue Jul 07, 2020 4:38 pm

Post

Faktycznie jest problem w nowej wersji dodania urządzenia do cloud,
wrzuciłem nowy gui w esp8266 połączył się z siecią lokalną lecz w supla cloud go nie widać,
co należy zrobić?
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

system2002 wrote: Mon Nov 07, 2022 6:59 pm Faktycznie jest problem w nowej wersji dodania urządzenia do cloud,
wrzuciłem nowy gui w esp8266 połączył się z siecią lokalną lecz w supla cloud go nie widać,
co należy zrobić?
To raczej nie jest związane. Z tego co wiem, to GG nie używa weryfikacji certyfikatów.
Najlepsze suple dla Twojego domu :mrgreen:
system2002
Posts: 53
Joined: Tue Jul 07, 2020 4:38 pm

Post

Miałem na dysku wersję
GUI-Generic.v4.21.5.m1M64.fCPU160 i normalnie modemcu jest widoczne w cloud,
przy wygenerowaniu nowego
GUI GUI-Generic.v5.1.0.NodeMCU_ESP8266.json.tmpl.m4M1M.fCPU160
łączy się z siecią, ale nie jest widoczny w supla cloud.
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

system2002 wrote: Mon Nov 07, 2022 8:43 pm Miałem na dysku wersję
GUI-Generic.v4.21.5.m1M64.fCPU160 i normalnie modemcu jest widoczne w cloud,
przy wygenerowaniu nowego
GUI GUI-Generic.v5.1.0.NodeMCU_ESP8266.json.tmpl.m4M1M.fCPU160
łączy się z siecią, ale nie jest widoczny w supla cloud.
Nadal twierdzę, że to raczej nie jest związane z problemem, który miał autor tego tematu.

Moja kryształowa kula jest w serwisie, więc bez załączenia logów nic więcej dziś nie wywróżę :P
Najlepsze suple dla Twojego domu :mrgreen:
krycha88
Posts: 5575
Joined: Fri Nov 16, 2018 7:25 am
Been thanked: 5 times

Post

system2002 wrote: Mon Nov 07, 2022 8:43 pm Miałem na dysku wersję
GUI-Generic.v4.21.5.m1M64.fCPU160 i normalnie modemcu jest widoczne w cloud,
przy wygenerowaniu nowego
GUI GUI-Generic.v5.1.0.NodeMCU_ESP8266.json.tmpl.m4M1M.fCPU160
łączy się z siecią, ale nie jest widoczny w supla cloud.
Zacznij od
https://gui-generic-builder.supla.io/guide/diagnostyka
https://gui-generic-builder.supla.io/
system2002
Posts: 53
Joined: Tue Jul 07, 2020 4:38 pm

Post

~ld
Config read
Key: 0 Value: )!▒▒▒c>
&▒Ȼ▒▒
Key: 1 Value: ▒▒ޞ▒X"e19n▒▒>▒
Key: 2 Value: COM-TEL NET T
Key: 3 Value: xxxxxxx
Key: 4 Value: admin
Key: 5 Value: xxxxxxx
Key: 6 Value: NodeMCU ESP8266
Key: 7 Value: svr29.supla.org
Key: 8 Value: [email protected]
Key: 9 Value: 0
Key: 10 Value: 0
Key: 11 Value: 0
Key: 12 Value:
Key: 13 Value:
Key: 14 Value: 1
Key: 15 Value:
Key: 16 Value: 0
Key: 17 Value: 10
Key: 18 Value: 0
Key: 19 Value:
Key: 20 Value: 1
Key: 21 Value: 0
Key: 22 Value:
Key: 23 Value:
Key: 24 Value: ,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Key: 25 Value:
Key: 26 Value: ,,0,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,
Key: 27 Value:
Key: 28 Value:
Key: 29 Value:
Key: 30 Value:
Key: 31 Value:
Key: 32 Value:
Key: 33 Value:
Key: 34 Value:
Key: 35 Value:
Key: 36 Value:
Key: 37 Value:
Key: 38 Value:
Key: 39 Value:
Key: 40 Value:
Key: 41 Value:
Key: 42 Value:
Key: 43 Value:
Key: 44 Value:
Key: 45 Value:
Key: 46 Value: 0
Key: 47 Value: 0
Key: 48 Value:
Key: 49 Value:
Key: 50 Value:
Key: 51 Value:
Key: 52 Value:
Key: 53 Value:
Key: 54 Value:
Key: 55 Value:
Key: 56 Value:
Key: 57 Value:
Key: 58 Value: 1
Key: 59 Value: 0
Key: 60 Value:
Key: 61 Value:
Key: 62 Value:
Key: 63 Value:
Key: 64 Value: 0
Key: 65 Value:
Key: 66 Value:
Key: 67 Value:
Key: 68 Value:
Key: 69 Value:
Key: 70 Value:
Key: 71 Value:
Key: 72 Value:
Key: 73 Value:
Key: 74 Value: 0.45
Key: 75 Value: 0.45
Key: 76 Value:
Key: 77 Value:
Key: 78 Value:
Key: 79 Value:
Key: 80 Value: 0
Key: 81 Value:
Key: 82 Value:
Key: 83 Value:
Key: 84 Value:
Key: 85 Value:
Supla - starting initialization
Storage initialization
readStorage: 8; Read: [3 0 0 0 0 0 0 0 ]
Storage: missing Supla tag. Rewriting...
Wrote 8 bytes to storage at 0
Commit
Config storage not configured
Validating storage state section with current device configuration
Storage state section validation completed. Loading elements state...
Initializing network layer
Network AP/hostname: NODEMCU-ESP8266-34AB95248395
Enter normal mode
Using Supla protocol version 16
Current status: [5] SuplaDevice initialized
WiFi: enter config mode with SSID: "NodeMCU_ESP8266"
Current status: [40] Config mode
WiFi: enter config mode with SSID: "NodeMCU_ESP8266"
local IP: 192.168.2.216
subnetMask: 255.255.255.0
gatewayIP: 192.168.2.1
Signal strength (RSSI): -70 dBm
IMPROV▒
IMPROVhttp://192.168.2.216

Return to “Ogólna dyskusja”