Odczyt danych z czujnika działa poprawnie zgodnie z dziennikiem, dziennik pokazuje również, że brakuje nazwy sieci WiFi i hasła....
Code: Select all
#define STATUS_LED_GPIO 2
#define SI7021_DATA_GPIO 14
#include <SuplaDevice.h>
#include <supla/device/status_led.h>
#include <supla/device/supla_ca_cert.h>
#include <supla/storage/littlefs_config.h>
#include <supla/network/esp_wifi.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 <SensorSi7021.h>
// This class provides Wi-Fi network connectivity for your device
Supla::ESPWifi wifi;
// This class provides configuration storage (like SSID, password, all
// user defined parameters, etc.). We use LittleFS.
Supla::LittleFsConfig configSupla;
Supla::Device::StatusLed statusLed(STATUS_LED_GPIO, true);
// This class provides web server to handle config mode
Supla::EspWebServer suplaServer;
// Komponenty HTML www (zobrazují se v sekcích podle pořadí vytvoření)
Supla::Html::DeviceInfo htmlDeviceInfo(&SuplaDevice);
Supla::Html::WifiParameters htmlWifi();
Supla::Html::ProtocolParameters htmlProto;
Supla::Html::StatusLedParameters htmlStatusLed();
void setup() {
statusLed.setMode(Supla::LED_OFF_WHEN_CONNECTED);
Serial.begin(115200);
new Supla::Sensor::SensorSi7021(SI7021_DATA_GPIO, PIN_A0);
SuplaDevice.setName("TempStation");
// Configure default Supla CA certificate
SuplaDevice.setSuplaCACert(suplaCACert);
SuplaDevice.setSupla3rdPartyCACert(supla3rdCACert);
SuplaDevice.begin();
}
void loop() {
SuplaDevice.iterate();
}
Storage initialization
readStorage: 8; Read: [53 55 50 4C 41 1 0 1 ]
Storage: Number of sections 1
Reading section: 0
readStorage: 7; Read: [3 0 0 FF FF FF FF ]
Section type: 3; size: 0
storedCRC 65535, CRC calc 65535
LittleFsConfig: config file size 378
LittleFsConfig: initializing storage from file...
LittleFsConfig: init result 1
Config incomplete: missing Wi-Fi SSID
LAST STATE ADDED: Missing Wi-Fi SSID
Config incomplete: missing Wi-Fi password
LAST STATE ADDED: Missing Wi-Fi password
Security level: Supla CA
RemoteDeviceConfig: Registering field 0x00000001
Channel[0] temperature correction 0.00
Channel[0] humidity correction 0.00
Validating storage state section with current device configuration
Storage state section validation successful
Channel(0) value changed to temp(-275.00), humi(-1.00)
Config incomplete: deviceMode = CONFIG
GUID: 0C3FBE037E80AAC040E830CDD3B0FE38
Device name: TempStation
Device software version: SDK 24.11.04-dev
Initializing network layer
[Wi-Fi] Network AP/hostname: TEMPSTATION-C8C9A36AD9E0
Using Supla protocol version 23
Current status: [5] SuplaDevice initialized
Wi-Fi SSID missing
WiFi: enter config mode with SSID: "TEMPSTATION-C8C9A36AD9E0"
Starting local web server
LAST STATE ADDED: Config mode
Current status: [40] Config mode
Channel(0) value changed to temp(25.60), humi(41.40)
Channel(0) value changed to temp(25.60), humi(41.40)
...
