Obsługa wielu rolet w arduino mega

Qwer
Posts: 3
Joined: Tue Dec 13, 2022 6:30 pm

Post

Cześć,
Wziąłem gotowy przykład roller shutter z biblioteki supli na arduino. Mogę uruchomić jedynie 11 szt rolet. Przy próbie dodania 12 rolety tracę komunikację z cloudem.
Poniżej wklejam kod. Może ktoś ma pomysł w czym może być problem?

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.
*/

#include <SuplaDevice.h>
#include <supla/control/roller_shutter.h>
#include <supla/control/button.h>
#include <supla/control/pin_status_led.h>

// Choose where Supla should store roller shutter data in persistant memory
// We recommend to use external FRAM memory 
#define STORAGE_OFFSET 100
#include <supla/storage/eeprom.h>
Supla::Eeprom eeprom(STORAGE_OFFSET);
// #include <supla/storage/fram_spi.h>
// Supla::FramSpi fram(STORAGE_OFFSET);

// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
  // Arduino Mega with EthernetShield W5100:
  #include <supla/network/ethernet_shield.h>
  // Ethernet MAC address
  uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
  Supla::EthernetShield ethernet(mac);

  // Arduino Mega with ENC28J60:
  // #include <supla/network/ENC28J60.h>
  // Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
  // ESP8266 and ESP32 based board:
  #include <supla/network/esp_wifi.h>
  Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif

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] = {0xBC,0x08,0x26,0xF7,0x86,0x53,0x59,0xDB,0xCE,0x3A,0x5};

  // Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
  char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0xEA,0xF6,0x11,0x46,0x07,0x62,0xC7,0x47,0xAC,};
 
  /*
   * Having your device already registered at cloud.supla.org,
   * you want to change CHANNEL sequence or remove any of them,
   * then you must also remove the device itself from cloud.supla.org.
   * Otherwise you will get "Channel conflict!" error.
   */
    
  Supla::Control::RollerShutter *rs = new Supla::Control::RollerShutter(14, 15, true);
  Supla::Control::RollerShutter *rs2 = new Supla::Control::RollerShutter(16, 17, true);
  Supla::Control::RollerShutter *rs3 = new Supla::Control::RollerShutter(18, 19, true);
  Supla::Control::RollerShutter *rs4 = new Supla::Control::RollerShutter(20, 21, true);
  Supla::Control::RollerShutter *rs5 = new Supla::Control::RollerShutter(22, 23, true);
  Supla::Control::RollerShutter *rs6 = new Supla::Control::RollerShutter(24, 25, true);
  Supla::Control::RollerShutter *rs7 = new Supla::Control::RollerShutter(26, 27, true);
  Supla::Control::RollerShutter *rs8 = new Supla::Control::RollerShutter(28, 29, true);
  Supla::Control::RollerShutter *rs9 = new Supla::Control::RollerShutter(30, 31, true);
  Supla::Control::RollerShutter *rs10 = new Supla::Control::RollerShutter(32, 33, true);
  Supla::Control::RollerShutter *rs11 = new Supla::Control::RollerShutter(34, 35, true);
  //Supla::Control::RollerShutter *rs12 = new Supla::Control::RollerShutter(46, 47, true);
  //Supla::Control::Button *buttonOpen = new Supla::Control::Button(28, true, true);
  //Supla::Control::Button *buttonClose = new Supla::Control::Button(29, true, true);

  // Add two LEDs to inform about roller shutter relay status
  // If inverted value is required, please add third parameter with true value
  new Supla::Control::PinStatusLed(14, 13); // pin 30 status to be informed on pin 24
 // new Supla::Control::PinStatusLed(39, 13); // pin 31 status to be informed on pin 25
  

  //buttonOpen->addAction(Supla::OPEN_OR_STOP, *rs, Supla::ON_PRESS);
  //buttonClose->addAction(Supla::CLOSE_OR_STOP, *rs, Supla::ON_PRESS);
 
  /*
   * SuplaDevice Initialization.
   * Server address is available at https://cloud.supla.org 
   * If you do not have an account, you can create it at https://cloud.supla.org/account/create
   * SUPLA and SUPLA CLOUD are free of charge
   * 
   */
 
  SuplaDevice.begin(GUID,              // Global Unique Identifier 
                    "s.supla.org",  // SUPLA server address
                    "[email protected]",   // Email address used to login to Supla Cloud
                    AUTHKEY);          // Authorization key
    
}

void loop() {
  SuplaDevice.iterate();
}
Last edited by Qwer on Thu Dec 15, 2022 3:49 pm, edited 1 time in total.
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

Pewnie pamięci RAM brakuje
Najlepsze suple dla Twojego domu :mrgreen:
Qwer
Posts: 3
Joined: Tue Dec 13, 2022 6:30 pm

Post

Widziałem tutaj na forum wypowiedzi ludzi którzy obsługiwali więcej rolet. program mogę normalnie wgrać, tylko traci komunikacje z Supla cloud.
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

Spróbuj zainstalować jakąś dużo starszą wersję biblioteki.
Rozmiar binarki ma niewiele wspólnego z ilością RAMu
Najlepsze suple dla Twojego domu :mrgreen:
Qwer
Posts: 3
Joined: Tue Dec 13, 2022 6:30 pm

Post

Wygląda na to, że podziałało. Dzięki za podpowiedź ;)

Return to “Pomoc”