Mam taki problem.
Chce na wemosa d1Mini esp8266 wgrac soft. Mam dwa wemosy starsza wersja bez problemu przyjmuje soft z trybem webinterface, a nowszy w wersji v 3.0 wywala
Code: Select all
Scheduling soft restart in 2500 ms
LAST STATE ADDED: Software reset (45)
Current status: [41] Software reset
LittleFsConfig: formatting partition
LittleFsConfig: failed to mount and to format partition
SERVER: get request
LittleFsConfig: formatting partition
LittleFsConfig: failed to mount and to format partition
Reset requested. Reset device
LittleFsConfig: formatting partition
LittleFsConfig: failed to mount and to format partition
Stopping local web server
Resetting in 0.5s...
See you soon!
Code: Select all
#define STATUS_LED_GPIO 2
#define ROLLER_SHUTTER_UP_RELAY_GPIO 4
#define ROLLER_SHUTTER_DOWN_RELAY_GPIO 5
#define RELAY_GPIO 12
#define BUTTON_UP_GPIO 13
#define BUTTON_DOWN_GPIO 14
#define BUTTON_CFG 0
#include <SuplaDevice.h>
#include <supla/network/esp_wifi.h>
#include <supla/control/roller_shutter.h>
#include <supla/control/relay.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/device/supla_ca_cert.h>
#include <supla/events.h>
// Choose where Supla should store roller shutter data in persistent memory
// We recommend to use external FRAM memory
#include <supla/storage/eeprom.h>
Supla::Eeprom eeprom;
// #include <supla/storage/fram_spi.h>
// Supla::FramSpi fram(STORAGE_OFFSET);
Supla::ESPWifi wifi;
Supla::LittleFsConfig configSupla;
Supla::Device::StatusLed statusLed(STATUS_LED_GPIO, true); // inverted state
Supla::EspWebServer suplaServer;
void setup() {
Serial.begin(115200);
// HTML www component
new Supla::Html::DeviceInfo(&SuplaDevice);
new Supla::Html::WifiParameters;
new Supla::Html::ProtocolParameters;
new Supla::Html::StatusLedParameters;
// Channels configuration
// CH 0 - Roller shutter
auto rs = new Supla::Control::RollerShutter(
ROLLER_SHUTTER_UP_RELAY_GPIO, ROLLER_SHUTTER_DOWN_RELAY_GPIO, true);
// CH 1 - Relay
auto r1 = new Supla::Control::Relay(RELAY_GPIO);
// CH 2 - Action trigger
auto at1 = new Supla::Control::ActionTrigger();
// CH 3 - Action trigger
auto at2 = new Supla::Control::ActionTrigger();
// CH 4 - Action trigger
auto at3 = new Supla::Control::ActionTrigger();
// Buttons configuration
auto buttonOpen = new Supla::Control::Button(BUTTON_UP_GPIO, true, true);
auto buttonClose = new Supla::Control::Button(BUTTON_DOWN_GPIO, true, true);
auto buttonCfgRelay = new Supla::Control::Button(BUTTON_CFG, true, true);
buttonCfgRelay->setHoldTime(1000);
buttonCfgRelay->setMulticlickTime(800);
buttonCfgRelay->configureAsConfigButton(&SuplaDevice);
buttonCfgRelay->addAction(Supla::TOGGLE_CONFIG_MODE, SuplaDevice, Supla::ON_CLICK_5);
buttonOpen->addAction(Supla::OPEN_OR_STOP, *rs, Supla::ON_PRESS);
buttonOpen->setHoldTime(1000);
buttonOpen->setMulticlickTime(300);
buttonClose->addAction(Supla::CLOSE_OR_STOP, *rs, Supla::ON_PRESS);
buttonClose->setHoldTime(1000);
buttonClose->setMulticlickTime(300);
buttonCfgRelay->configureAsConfigButton(&SuplaDevice);
buttonCfgRelay->addAction(Supla::TOGGLE, r1, Supla::ON_CLICK_1);
// Action trigger configuration
at1->setRelatedChannel(rs);
at1->attach(buttonOpen);
at2->setRelatedChannel(rs);
at2->attach(buttonClose);
at3->setRelatedChannel(r1);
at3->attach(buttonCfgRelay);
// configure defualt Supla CA certificate
SuplaDevice.setSuplaCACert(suplaCACert);
SuplaDevice.setSupla3rdPartyCACert(supla3rdCACert);
SuplaDevice.begin();
}
void loop() {
SuplaDevice.iterate();
}