dwa kanały jeden przekaźnik

Gitman
Posts: 711
Joined: Sat Nov 05, 2022 7:52 am
Location: Bielawa

Post

Witam,
Czy jest taka możliwość aby sterować tym samym przekaźnikiem z dwóch różnych kanałów. Mam potrzebę aby wysterować przekaźnik czasowo (przykład 1s) z jednego kanału, a 3s z drugiego kanału (takie impulsy). Utworzyłem sobie wirtualny przekaźnik przez co pokazał mi się dodatkowy kanał w cloud ale nie mogę go powiązać z tym fizycznym przekaźnikiem.
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

Gitman wrote: Thu Jan 12, 2023 3:49 pm Witam,
Czy jest taka możliwość aby sterować tym samym przekaźnikiem z dwóch różnych kanałów. Mam potrzebę aby wysterować przekaźnik czasowo (przykład 1s) z jednego kanału, a 3s z drugiego kanału (takie impulsy). Utworzyłem sobie wirtualny przekaźnik przez co pokazał mi się dodatkowy kanał w cloud ale nie mogę go powiązać z tym fizycznym przekaźnikiem.
Teoretycznie powinno działać jeśli ustawisz dwa kanały Relay na to samo gpio.
Wirtualnym przekaźnikiem też są radę, tylko trzeba by je w kodzie powiązać akcjami.
Używasz gotowego softu, czy sam piszesz?
Najlepsze suple dla Twojego domu :mrgreen:
Gitman
Posts: 711
Joined: Sat Nov 05, 2022 7:52 am
Location: Bielawa

Post

Używam gotowego generowanego przez gg przepatrzyłem wydaje mi się wszystkie opcje w ustawieniach konfiguracji ale nie mogę wybrać gpio gdy jest już używane gdzie indziej chyba że źle szukam :oops:
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

Gitman wrote: Thu Jan 12, 2023 4:36 pm Używam gotowego generowanego przez gg przepatrzyłem wydaje mi się wszystkie opcje w ustawieniach konfiguracji ale nie mogę wybrać gpio gdy jest już używane gdzie indziej chyba że źle szukam :oops:
W GG nie ma takiej opcji.

Musiałbyś własny soft przygotować
Najlepsze suple dla Twojego domu :mrgreen:
Gitman
Posts: 711
Joined: Sat Nov 05, 2022 7:52 am
Location: Bielawa

Post

Gdzie mogę poczytać jak zacząć taki własny Soft robić ?
radzik_r
Posts: 468
Joined: Sun Aug 11, 2019 5:32 pm
Has thanked: 1 time
Been thanked: 2 times

Post

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 RELAY_GPIO 12
#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/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;

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

  // Channels configuration
  // CH 0 - Relay
  auto r1 = new Supla::Control::Relay(RELAY_GPIO);
  auto r2 = new Supla::Control::Relay(RELAY_GPIO);

  // Buttons configuration
  auto buttonCfgRelay =  new Supla::Control::Button(BUTTON_CFG_RELAY_GPIO, true, true);

  buttonCfgRelay->configureAsConfigButton(&SuplaDevice);
  buttonCfgRelay->addAction(Supla::TOGGLE, r1, Supla::ON_CLICK_1);
  buttonCfgRelay->addAction(Supla::TOGGLE, r2, Supla::ON_CLICK_2);

    // configure defualt Supla CA certificate
  SuplaDevice.setSuplaCACert(suplaCACert);
  SuplaDevice.setSupla3rdPartyCACert(supla3rdCACert);

  SuplaDevice.begin();
}

void loop() {
  SuplaDevice.iterate();
}
Gitman
Posts: 711
Joined: Sat Nov 05, 2022 7:52 am
Location: Bielawa

Post

Mam taką prośbę jak byś mi wytłumaczył co ja mam z tym dalej zrobić.
jaku2k
Posts: 920
Joined: Sun May 24, 2020 8:40 pm
Has thanked: 1 time

Post

Gitman wrote: Thu Jan 12, 2023 10:04 pm Mam taką prośbę jak byś mi wytłumaczył co ja mam z tym dalej zrobić.
Najpewniej trzeba to wgrać, inaczej nie zadziała.
viewtopic.php?t=3559 ;)

W powyższym projekcie autorstwa @radzik_r jest już Webinterface, więc nie musisz wpisywać danych w kodzie - urządzenie zarejestrujesz przez interfejs graficzny, podobnie jak w przypadku GUI Generica.

W razie problemów: LINK
Pozdrawiam
Jakub
Albert
Posts: 650
Joined: Fri Jan 04, 2019 8:32 pm
Location: Chełm

Post

A proteza w stylu dwa różne gpio podłączone do tego samego wejścia sygnałowego w przekaźniku? Nigdy nie testowałem, ale w teorii powinno zadziałać :mrgreen:
Gitman
Posts: 711
Joined: Sat Nov 05, 2022 7:52 am
Location: Bielawa

Post

To by było najprostsze rozwiązanie jednak nie można przydzielić różnych gipo do jednego przekaźnika.

Return to “Pomoc”