@klew Podczas próby kompilacji kodu:
Kod: Zaznacz cały
#include <SuplaDevice.h>
#include <supla/network/esp_wifi.h>
#include <supla/control/button.h>
#include <supla/sensor/virtual_binary.h>
const char* ssid = "wifissid";
const char* password = "wifipassword";
Supla::ESPWifi wifiInterface;
void setup() {
Serial.begin(460800);
wifiInterface.setSsid(ssid);
wifiInterface.setPassword(password);
char GUID[SUPLA_GUID_SIZE] = {0x08,0x6E,0xE7,0xEC,0xBD,0xBB,0x2C,0x04,0x6B,0xAD,0x19,0x2D,0x9F,0x39,0xAF,0x19};
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0xA8,0x5E,0xA3,0x5E,0x8B,0x01,0xF5,0x1D,0x6D,0x28,0x41,0x04,0xEA,0xFD,0x86,0xB0};
Supla::Sensor::VirtualBinary *sensor = new Supla::Sensor::VirtualBinary;
Supla::Control::Button *buttonSet = new Supla::Control::Button(5, true, true);
Supla::Control::Button *buttonClear = new Supla::Control::Button(6, true, true);
buttonSet->willTrigger(*sensor, Supla::Control::Button::ON_PRESS, Supla::Sensor::VirtualBinary::SET);
buttonClear->willTrigger(*sensor, Supla::Control::Button::ON_PRESS, Supla::Sensor::VirtualBinary::CLEAR);
SuplaDevice.begin(GUID, // Global Unique Identifier
"svrXX.supla.org",// //"svr23.supla.org", // SUPLA server address
"email@mail.com",
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}
dostaje błąd:
Kod: Zaznacz cały
Arduino:1.8.12 (Windows 10), Płytka:"Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
C:\Users\piwnica\Desktop\sketch_sep03a\sketch_sep03a.ino: In function 'void setup()':
sketch_sep03a:25:35: error: 'ON_PRESS' is not a member of 'Supla::Control::Button'
buttonSet->willTrigger(*sensor, Supla::Control::Button::ON_PRESS, Supla::Sensor::VirtualBinary::SET);
^
sketch_sep03a:25:69: error: 'SET' is not a member of 'Supla::Sensor::VirtualBinary'
buttonSet->willTrigger(*sensor, Supla::Control::Button::ON_PRESS, Supla::Sensor::VirtualBinary::SET);
^
sketch_sep03a:26:37: error: 'ON_PRESS' is not a member of 'Supla::Control::Button'
buttonClear->willTrigger(*sensor, Supla::Control::Button::ON_PRESS, Supla::Sensor::VirtualBinary::CLEAR);
^
sketch_sep03a:26:71: error: 'CLEAR' is not a member of 'Supla::Sensor::VirtualBinary'
buttonClear->willTrigger(*sensor, Supla::Control::Button::ON_PRESS, Supla::Sensor::VirtualBinary::CLEAR);
^
exit status 1
'ON_PRESS' is not a member of 'Supla::Control::Button'
, czy pojawiła się nowa wersja biblioteki SuplaDevice, wcześniej co nieco kompilowałem w jej nowszej wersji i błędy nie występowały. Pozdrawiam