Już powoli ogarniam ogólne zasady działania supli. Faktycznie to zupełnie inne podejście jak w Blynku. Czy lepsze czy gorsze to pewnie zależy od opiniującego
Teraz muszę podłączyć arduino mega, a na koniec zostawię najtrudniejsze.
klew wrote: Fri Aug 19, 2022 7:14 am Wyszukiwarka forum jest słaba, ale Google dobrze sobie radzi z szukaniem [...]
W Google'u możesz też skorzystać z operatora site:, dzięki któremu wyszukiwarka wyświetli wyniki z danej witryny (np. forum.supla.org).
Code: Select all
#include <SuplaDevice.h>
#include <supla/sensor/DS18B20.h>
#include <supla/control/relay.h>
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);
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] = {};
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {};
/*
* 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.
*/
// CHANNEL0-3 - Thermometer DS18B20
// 4 DS18B20 thermometers at pin 23. DS address can be omitted when there is only one device at a pin
DeviceAddress term_grunt = {0x28, 0xC4, 0x85, 0x40, 0x5, 0x0, 0x0, 0x91};
auto lampa_plac = new Supla::Control::Relay(27, false);
auto lampa_ogrod = new Supla::Control::Relay(29, false);
auto brama_garaz = new Supla::Control::Relay(23, false);
//auto brama = new Supla::Control::Relay(25, false);
//auto kompresor = new Supla::Control::Relay(37, false);
//auto r2 = new Supla::Control::Relay(25, false);
//auto r2 = new Supla::Control::Relay(pin2, false);
//auto r2 = new Supla::Control::Relay(pin2, false);
new Supla::Sensor::DS18B20(A5, term_grunt);
/*
* SuplaDevice Initialization.
* Server address, LocationID and LocationPassword are 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
"svr73.supla.org", // SUPLA server address
"[email protected]", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}