SuplaDevice wersja 25.08.01

zzrr
Posts: 1864
Joined: Wed Oct 26, 2022 7:35 pm
Has thanked: 76 times
Been thanked: 119 times

Post

klew wrote: Sat Oct 04, 2025 4:29 pm
Znajdź na dysku, gdzie PIO instaluje boardy i tam będzie gdzieś ten esp-idf. W środku wejdź do components/mbedtls/mbedtls/include/mbedtls
i tam będzie plik pkcs5.h - sprawdź czy w tym pliku jest ta metoda z _ext na końcu.
jest...

Code: Select all

int mbedtls_pkcs5_pbkdf2_hmac_ext(mbedtls_md_type_t md_type,
                                  const unsigned char *password,
                                  size_t plen, const unsigned char *salt, size_t slen,
                                  unsigned int iteration_count,
                                  uint32_t key_length, unsigned char *output);

#if defined(MBEDTLS_MD_C)
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
/**
 * \brief          PKCS#5 PBKDF2 using HMAC
 *
 * \deprecated     Superseded by mbedtls_pkcs5_pbkdf2_hmac_ext().
 *
 * \param ctx      Generic HMAC context
 * \param password Password to use when generating key
 * \param plen     Length of password
 * \param salt     Salt to use when generating key
 * \param slen     Length of salt
 * \param iteration_count       Iteration count
 * \param key_length            Length of generated key in bytes
 * \param output   Generated key. Must be at least as big as key_length
 *
 * \returns        0 on success, or a MBEDTLS_ERR_XXX code if verification fails.
 */
int MBEDTLS_DEPRECATED mbedtls_pkcs5_pbkdf2_hmac(mbedtls_md_context_t *ctx,
                                                 const unsigned char *password,
                                                 size_t plen,
                                                 const unsigned char *salt,
                                                 size_t slen,
                                                 unsigned int iteration_count,
                                                 uint32_t key_length,
                                                 unsigned char *output);
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
#endif /* MBEDTLS_MD_C */
#if defined(MBEDTLS_SELF_TEST)
klew wrote: Sat Oct 04, 2025 4:29 pm Ogólnie możesz też z pliku crypto.cpp w SD wyrzucić od linii 36 do 54 oraz 63. Wtedy zostanie pusta niezaimplenentowana metoda i tyle.
Ta metoda jest obecnie używana tylko do zapisywania "hasha" hasła do web interface (używane tylko na kompilacjach z esp-idf i w zasadzie tylko na komercyjnych urządzeniach).
chyba się skończy tym rozwiązaniem. Hmm.

Ale nie ukrywam że wolałbym rozwiązanie bez edytowania biblioteki.
User avatar
klew
Posts: 13906
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

A spróbuj z tego pliku crypto.cpp przejść przez include do pkcs5.h - może on ma jakiś inny plik o takiej nazwie i w nim nie ma tego symbolu
Najlepsze suple dla Twojego domu :mrgreen:
zzrr
Posts: 1864
Joined: Wed Oct 26, 2022 7:35 pm
Has thanked: 76 times
Been thanked: 119 times

Post

klew wrote: Sat Oct 04, 2025 4:57 pm A spróbuj z tego pliku crypto.cpp przejść przez include do pkcs5.h - może on ma jakiś inny plik o takiej nazwie i w nim nie ma tego symbolu
ok
już próbuję

coś mi nie wychodzi...
dobrze ja to zrozumiałem?
chodzi o to żeby poprzez include dać ścieżkę bezwzględną do tego pliku a nie tak jak jest #include <mbedtls/pkcs5.h> tak?
edit:
w miedzyczasie zauważyłem jeszcze taką ścieżkę. W tej "framework-arduinoespressif32\tools\sdk\esp32c3" w pliku pkcs5.h nie ma funkcji wykorzystującej mbedtls_pkcs5_pbkdf2_hmac_ext. Być może jest tak jak mówisz że czyta nie z tego pliku co trzeba. Ale idzie to ogarnąć?
.platformio\packages\framework-espidf\components\mbedtls\mbedtls\include\mbedtls\mbedtls\include\mbedtls\pkcs5.h
.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32c3\include\mbedtls\mbedtls\include\mbedtls\pkcs5.h
framework arduino chyba tą kwestię traktuje inaczej niż idf. hmm
To co może być ważne to że ja używam framework-arduinoespressif32 a co bym nie robił w PIO nie chce się zaktualizować do wersji nowszej niż 06.06.2024. framework-espidf się zaktualizował i w tym pliku pkcs5.h obsługa mbedtls_pkcs5_pbkdf2_hmac_ext jest. W framework-arduinoespressif32 w pkcs5.h nie ma tego mbedtls_pkcs5_pbkdf2_hmac_ext. Jest tylko mbedtls_pkcs5_pbkdf2_hmac
Wymuszenie poprzez include ścieżki bezpośrednio do katalogu z plikem pkcs5.h z frameworka idf generuje jeszcze więcej błędów.
https://registry.platformio.org/tools/p ... spressif32
niestety na tym frameworku nie idzie ten mbedtls_pkcs5_pbkdf2_hmac_ext :?
No i sprawdziłem w miedzyczasie, faktycznie usunięcie tej części kodu w crypto.cpp skutkuje możliwością zrobienia kompilacji kodu. Czyli ostatecznie było by to tez jakieś rozwiązanie. Mało eleganckie ale działa.
petione
Posts: 121
Joined: Sat Jul 21, 2018 4:26 pm

Post

Witam. Dawno nic nie dzialalem z SD a dzisiaj przyszła pora na odświeżwnie swej pamieci. Próbowałem zaladowac przyklady z githuba z najnowsza wersja biblioteki. Wszystko się ładnie kompiluje i wgrywa ale esp8266 nie wstaje. W logach widac ze caly czas esp sie resetuje . Oczywiste pamiec czyściłem. Na starszych wersjach biblioteki wszystko dzialalo i dziala.

Czy cos sie od wersji 25.01 znaczaco zmienilo ze esp sie caly czas resetuje? Podmiana biblioteki na nową wersję w działających projektach wywoluje ten sam problem. Siedzialem cale popołudnie i nie udalo mi się nic wymyślić. Uzywam VSC i PlatformIO
User avatar
Zibi_007
Posts: 3985
Joined: Tue Oct 31, 2023 10:06 pm
Has thanked: 10 times
Been thanked: 31 times

Post

petione wrote: Tue Nov 04, 2025 10:16 pm Witam. Dawno nic nie dzialalem z SD a dzisiaj przyszła pora na odświeżwnie swej pamieci. Próbowałem zaladowac przyklady z githuba z najnowsza wersja biblioteki. Wszystko się ładnie kompiluje i wgrywa ale esp8266 nie wstaje. W logach widac ze caly czas esp sie resetuje . Oczywiste pamiec czyściłem. Na starszych wersjach biblioteki wszystko dzialalo i dziala.

Czy cos sie od wersji 25.01 znaczaco zmienilo ze esp sie caly czas resetuje? Podmiana biblioteki na nową wersję w działających projektach wywoluje ten sam problem. Siedzialem cale popołudnie i nie udalo mi się nic wymyślić. Uzywam VSC i PlatformIO
Jakby nie chciał tylko rozgłaszać sieci, to bym wiedział (od teraz trzeba mieć przycisk konfig, albo odpowiednio wyłączyć to w programie). Domyślnie moduł po wgraniu softu nie rozgłasza sieci. Ale jeśli jesteś pewien, że się resetuje, to nie wiem.
Image Wiesz, że Supla obsługuje Zigbee? Wstąp do Klubu Promila: https://forum.supla.org/viewtopic.php?t=18018
Image Szukasz nowego GG? Jest tutaj: https://forum.supla.org/viewtopic.php?t=18036
petione
Posts: 121
Joined: Sat Jul 21, 2018 4:26 pm

Post

Tak resetuje sie bo widac jak wstaje od nowa, probuje się logować (co sie oczywiście nie udaje bo brak wprowadzonych ustawien) po czym krzaki w terminalu i tak w koło. Przetestowane rozne plytki esp8266 i efekt ten sam.
User avatar
Zibi_007
Posts: 3985
Joined: Tue Oct 31, 2023 10:06 pm
Has thanked: 10 times
Been thanked: 31 times

Post

petione wrote: Tue Nov 04, 2025 10:37 pm Tak resetuje sie bo widac jak wstaje od nowa, probuje się logować (co sie oczywiście nie udaje bo brak wprowadzonych ustawien) po czym krzaki w terminalu i tak w koło. Przetestowane rozne plytki esp8266 i efekt ten sam.
Nie pomogę, bo na ESP8266 nic nie kompilowałem już od ponad pół roku. Nie masz pod ręką jakiegoś ESP32 żeby sprawdzić, czy u Ciebie na nim działa?
Image Wiesz, że Supla obsługuje Zigbee? Wstąp do Klubu Promila: https://forum.supla.org/viewtopic.php?t=18018
Image Szukasz nowego GG? Jest tutaj: https://forum.supla.org/viewtopic.php?t=18036
Maciek663
Posts: 217
Joined: Thu Jan 11, 2024 6:33 am
Has thanked: 1 time
Been thanked: 1 time

Post

U mnie na ESP8266 śmiga normalnie. Wrzuć może kod i logi.
petione
Posts: 121
Joined: Sat Jul 21, 2018 4:26 pm

Post

Więc, oficjalny przykład WebInterface

Code: Select all

/*
  Copyright (C) AC SOFTWARE SP. Z O.O.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

/* This example shows ESP82xx/ESP32 based device with simple WebInterface
 * used to configure Wi-Fi parameters and Supla server connection.
 * There is one RollerShutter, one Relay and 3 buttons configured.
 * Two buttons are for roller shutter with Action Trigger.
 * Third button is for controlling the relay and for switching module to
 * config mode.
 * After fresh installation, device will be in config mode. It will have its
 * own Wi-Fi AP configured. You should connect to it with your mobile phone
 * and open http://192.168.4.1 where you can configure the device.
 * Status LED is also configured. Please adjust GPIOs to your HW.
 */

#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_RELAY_GPIO 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/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_RELAY_GPIO, true, true);

  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);

  SuplaDevice.setInitialMode(Supla::InitialMode::StartInCfgMode);
  SuplaDevice.begin();
}

void loop() {
  SuplaDevice.iterate();
}
platformio.ini

Code: Select all

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps = 
	https://github.com/SUPLA/supla-device.git
logi:

Code: Select all

Button[0] setHoldTime: 5000
Button[0] setMulticlickTime: 300
GPM[3]: DefaultUnitAfterValue "B"
GPM[4]: DefaultUnitAfterValue "B"
GPM[4]: DefaultUnitAfterValue "KB"
GPM[4]: DefaultValueDivider 1024
 *** Supla - starting initialization (platform 0)
Clock not configured, using default clock
SD: add flag DEVICE_CONFIG_SUPPORTED
SD: add flag CALCFG_RESTART_DEVICE
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 0 0 0 0 ]
Section type: 3; size: 0
storedCRC 0, CRC calc 65535
LittleFsConfig: file "/supla-dev.cfg" size 450
LittleFsConfig: initializing storage from file...
LittleFsConfig: init result success
 *** Supla - Config initalization
SD: add flag CALCFG_ENTER_CFG_MODE
SD: add flag CALCFG_FACTORY_RESET_SUPPORTED
Automatic firmware update is disabled
Device mode: 0
Security level: Supla CA
 *** Supla - Config load for elements
SD: add flag CALCFG_IDENTIFY_DEVICE
RemoteDeviceConfig: Registering field 0x000000001
Channel[0] function missing. Using SW defaults
Channel[1] function missing. Using SW defaults
Button[0] don't load config
GPM[3]: config loaded successfully
GPM[3]: RefreshIntervalMs 5000 ms
GPM[4]: config loaded successfully
GPM[4]: RefreshIntervalMs 5000 ms
RemoteDeviceConfig: Registering field 0x000000010
Clock: automaticTimeSync: 1
 *** Supla - Config load for elements done
 *** Supla - Load state storage
Validating storage state section with current device configuration
Element state section size doesn't match current device configuration
 *** Supla - Load state storage done
 *** Supla - Init elements
Relay[0] turn OFF (duration 0 ms)
Relay[1] turn OFF (duration 0 ms)
 **** Digital write[1], gpio: 255; value 0
Relay[1] turn OFF (duration 0 ms)
 **** Digital write[1], gpio: 255; value 0
Relay[1] init done, storedTurnOnDurationMs 0
Button[0]: Initialized: pin 0, pullUp 1, invertLogic 1, state 1
Channel(3) value changed to 27608.00
Channel(4) value changed to 27608.00
 *** Supla - Init elements done
GUID: 7215BD6CF1424B65A913935CF6CF727E
Device name: IRCloner
Device software version: SDK 25.10.02-dev
 *** Supla - Initializing network layer
[Wi-Fi] Network AP/hostname: IRCLONER-F4CFA2D7CCF5
Using Supla protocol version 23
Current status: [5] SuplaDevice initialized
Enter normal mode
[Wi-Fi] setNormalMode
 *** Supla - Initialization done
 *** Self-test ***
TEST: ManufacturerID is 0
TEST failed: ProductID is empty
TEST failed: missing public RSA key

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (3):
epc1=0x4021123a epc2=0x00000000 epc3=0x00000000 excvaddr=0x40280172 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffdb0 end: 3fffffd0 offset: 0150
3fffff00:  3fff3b90 00000000 3fff51dc 3fff51dc
3fffff10:  00000000 00000001 3fff2e04 4020c42f
3fffff20:  35313237 43364442 32343146 35364234
3fffff30:  33313941 43353339 46433646 45373237
3fffff40:  43524900 454e4f4c 00000052 00000000  
3fffff50:  00000000 00000000 00000000 00000000
3fffff60:  3fff4800 40208642 00000012 3ffe8c24
3fffff70:  3fff4920 00000000 00000012 3fff42ac
3fffff80:  3fff433c 3fff4884 3fff2e04 4020867c  
3fffff90:  00000000 00657461 00000000 feefeffe
3fffffa0:  feefeffe feefeffe feefeffe 3fff33d0
3fffffb0:  3fffdad0 00000000 3fff33a4 40227188  
3fffffc0:  feefeffe feefeffe 3fffdab0 40100ed1
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3424, room 16 
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8 
tail 0
chksum 0x2b
csum 0x2b
v0009a5a0
~ld
��␃�␛�g�r��g|�␄l␄�␌d`␃␜c�␒␃␄�|␂{�␃d�g�␌�g�␀␌l`␃��{�l�$␓�␄␌␄�
I dalej resety.

Próbowałem też na esp32 jak zasugerował kolega Zibi i tam działa. Nadmienić muszę że też nie obyło się bez problemów bo cytując pare postów wyżej kolegę zzrr:
Przy próbie kompilacji programu zgłasza mi błąd
identyfikator "mbedtls_pkcs5_pbkdf2_hmac_ext" jest niezdefiniowany

i kieruje mnie do funkcji
bool Supla::Crypto::pbkdf2Sha256(const char *password,... w pliku crypto.cpp.
klew pisze: 04 paź 2025, 18:29
Ogólnie możesz też z pliku crypto.cpp w SD wyrzucić od linii 36 do 54 oraz 63. Wtedy zostanie pusta niezaimplenentowana metoda i tyle.
Ta metoda jest obecnie używana tylko do zapisywania "hasha" hasła do web interface (używane tylko na kompilacjach z esp-idf i w zasadzie tylko na komercyjnych urządzeniach).
No ale co esp8266 nie bedzie już działać?
zzrr
Posts: 1864
Joined: Wed Oct 26, 2022 7:35 pm
Has thanked: 76 times
Been thanked: 119 times

Post

W platformio.ini pobierasz najnowszą SD v25.8.1
Wpisz:

Code: Select all

lib_deps = 
	https://github.com/SUPLA/supla-device#v25.6
Spróbuj na v25.6 czy zadziała.

Return to “supla-dev”