U mnie nie działa.
Mam komunikat powitalny i tyle.
Code: Select all
#include <SuplaDevice.h>
#include <supla/sensor/DS18B20.h>
#include <supla/network/esp_wifi.h>
#include "ESPTelnet.h" // https://github.com/LennartHennigs/ESPTelnet
Supla::ESPWifi wifi("xx", "xx");
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Timers.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
/* ------------------------------------------------- */
#define SERIAL_SPEED 115200
#define WIFI_SSID "xx"
#define WIFI_PASSWORD "xx"
/* ------------------------------------------------- */
ESPTelnet telnet;
IPAddress ip;
uint16_t port = 23;
int alarmPieca = 0;
int temp_CWU;
int temp_PIEC;
int temp_POWROT;
int temp_INSTALACJA;
OneWire oneWire0(5);//D1
DallasTemperature czujnikCWU_POWROT(&oneWire0);
DeviceAddress termometr_cwu = {0x28, 0xFF, 0xEF, 0x07, 0xB6, 0x01, 0x3C, 0xCF};
DeviceAddress termometr_powrot = {0x28, 0x5F, 0x17, 0x07, 0xB6, 0x01, 0x3C, 0x0B};
OneWire oneWire1(4);//D2
DallasTemperature czujnikPIEC_INSTALACJA(&oneWire1);
DeviceAddress termometr_piec = {0x28, 0x15, 0x50, 0x07, 0xB6, 0x01, 0x3C, 0x09};
DeviceAddress termometr_instalacja = {0x28, 0xE8, 0x5C, 0x07, 0xB6, 0x01, 0x3C, 0x10};
int supla;
char ssid[] = "xx";
char pass[] = "xx";
Timer sekunda;
Timer minut5;
Timer minut10;
Timer sekund3;
Timer minut3;
Timer sekund4;
Timer sekund50;
#define pir D7
void onTelnetConnect(String ip)
{
telnet.println("Welcome " + telnet.getIP());
telnet.println("(Use ^] + q to disconnect.)");
}
void ds(){
czujnikPIEC_INSTALACJA.requestTemperatures();
temp_PIEC = (czujnikPIEC_INSTALACJA.getTempC(termometr_piec)+8);
temp_INSTALACJA = czujnikPIEC_INSTALACJA.getTempC(termometr_instalacja);
czujnikCWU_POWROT.requestTemperatures();
temp_CWU = (czujnikCWU_POWROT.getTempC(termometr_cwu)+7);
temp_POWROT = (czujnikCWU_POWROT.getTempC(termometr_powrot)+8);
}
void setup() {
Serial.begin(SERIAL_SPEED); //SERIAL_SPEED
Serial.println();
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.forceSleepWake();
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
while(WiFi.status() != WL_CONNECTED)
{
delay(500);
}
WiFi.setAutoReconnect(true);
WiFi.persistent(true);
telnet.onConnect(onTelnetConnect);
telnet.onInputReceived([](String str)
{
Serial.println(str);
});
telnet.begin(port);
// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {xx};
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {xx};
new Supla::Sensor::DS18B20(5, termometr_cwu);
new Supla::Sensor::DS18B20(5, termometr_powrot);
new Supla::Sensor::DS18B20(4, termometr_piec);
new Supla::Sensor::DS18B20(4, termometr_instalacja);
SuplaDevice.begin(GUID, // Global Unique Identifier
"svrxx.supla.org", // SUPLA server address
"xx", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
WiFi.begin(ssid, pass);
czujnikPIEC_INSTALACJA.begin();
czujnikCWU_POWROT.begin();
minut5.begin(59993);
ds();
}
void loop() {
SuplaDevice.iterate();
telnet.loop();
if(Serial.available())
{
telnet.write(Serial.read());
}
if(minut5.available()){
ds();
minut5.restart();
}
}
You do not have the required permissions to view the files attached to this post.