Czy program bedzie chodzic pod Arduino IDE 2.0 ( czy jakas biblioteka nie jest kompatybilna?)
Na Arduino IDE 2.0 bez problemu sciagnalem bowe plytki.
Odezwe sie czy jest progres jak znajde wiecej czasu..
Dziekuje za pomoc
Cloud tylko pokazuje kanały, które ustawiłeś. Ich obecność nie świadczy o tym, że cokolwiek udało się z urządzeń odczytać.DropsNH wrote: Wed Feb 01, 2023 7:45 am Witam po krótkiej nieobecności.
Zainstalowałem IDE2.0 i program skompilował się od tzw " szczała".
W CloudIze wykrywa wszystkie DSy i przekaźnik jak również oba SHt ...ale nie wyświetla ani temperatury ani wilgotności z nich jest
Hum=?
Temp= -1
Piny standartowe dla Esp32
Code: Select all
#include <SuplaDevice.h> // v2.4.0
// Add include to DS sensor
#include <supla/sensor/DS18B20.h>
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("xxxx", "xxxx");
#include <supla/control/relay.h>
#include <supla/sensor/SHT3x.h>
void setup() {
Serial.begin(115200);
// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {xxxxxxxxxx};
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {xxxxxxxxxx};
DeviceAddress sensor1 = {0x28, 0xEB, 0x3B, 0x96, 0xF0, 0x01, 0x3C, 0x77};
new Supla::Sensor::DS18B20(32, sensor1);
new Supla::Sensor::SHT3x(0x44);
new Supla::Sensor::SHT3x(0x45);
Supla::Control::Relay *relayCh8 = new Supla::Control::Relay(5, false);
Supla::Control::Relay *relayCh9 = new Supla::Control::Relay(17, false);
Supla::Control::Relay *relayCh10 = new Supla::Control::Relay(19, false);
SuplaDevice.begin(GUID, // Global Unique Identifier
"svr1.supla.org", // SUPLA server address
"@@@@@@gmail.com", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}Cześć, jeśli używasz jednego czujnika DS to nie musisz używać w kodzie jego adresacji, używasz adresacji jedynie jak więcej czujników masz podłączonych do jednego pinu. Przy jednym czujniku wystarczy, że wskażesz pin do którego jest podlączony np:DropsNH wrote: Thu Feb 02, 2023 1:37 pm Witam,
Połaczenia sprawdzone, czujniki działają poprawnie na innym programie.
Czy napewno ten program wygląda poprawnie? Nie trzeba nazwać tych czujnikow np, SHT1, SHT2 jak w przypadku DSów?
Albo ustawić im kanał ( choć cloud przypisuje sam kanału z kolei)
Code: Select all
new Supla::Sensor::DS18B20(32);Code: Select all
auto r1 = new Supla::Control::Relay(5, true);
auto r2 = new Supla::Control::Relay(17, true);
auto r3 = new Supla::Control::Relay(19, true);
r1->getChannel()->setDefault(SUPLA_CHANNELFNC_POWERSWITCH);
r2->getChannel()->setDefault(SUPLA_CHANNELFNC_LIGHTSWITCH);
r3->getChannel()->setDefault(SUPLA_CHANNELFNC_CONTROLLINGTHEDOORLOCK);
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 BUTTON_CFG_RELAY_GPIO 0
#include <SuplaDevice.h>
#include <supla/network/esp_wifi.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>
#include <supla/sensor/SHT3x.h>
#include <supla/sensor/DS18B20.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;
// HTML www component (they appear in sections according to creation
// sequence)
Supla::Html::DeviceInfo htmlDeviceInfo(&SuplaDevice);
Supla::Html::WifiParameters htmlWifi;
Supla::Html::ProtocolParameters htmlProto;
Supla::Html::StatusLedParameters htmlStatusLed;
void setup() {
Serial.begin(115200);
new Supla::Sensor::DS18B20(32);
new Supla::Sensor::SHT3x(0x44);
new Supla::Sensor::SHT3x(0x45);
auto r1 = new Supla::Control::Relay(5, true);
auto r2 = new Supla::Control::Relay(17, true);
auto r3 = new Supla::Control::Relay(19, true);
r1->getChannel()->setDefault(SUPLA_CHANNELFNC_POWERSWITCH);
r2->getChannel()->setDefault(SUPLA_CHANNELFNC_LIGHTSWITCH);
r3->getChannel()->setDefault(SUPLA_CHANNELFNC_CONTROLLINGTHEDOORLOCK);
auto buttonCfgRelay = new Supla::Control::Button(BUTTON_CFG_RELAY_GPIO, true, true);
buttonCfgRelay->configureAsConfigButton(&SuplaDevice);
// configure defualt Supla CA certificate
SuplaDevice.setSuplaCACert(suplaCACert);
SuplaDevice.setSupla3rdPartyCACert(supla3rdCACert);
SuplaDevice.setName("Supla-Test");
SuplaDevice.begin();
}
void loop() {
SuplaDevice.iterate();
}Mam rozumieć, że problem który zgłaszałem na arduino mega, z podłączeniem większej ilości ds, klew prosiłeś wtedy o przejście na wcześniejszą wersję, zdaje się 1.8.klew wrote: Fri Dec 16, 2022 9:01 pm Arduino ide 2.0 raczej działa z bibliotekami.
Jedyny problem jaki się pojawił to brak możliwości ustawienia niektórych prędkości seriala na monitorze