Poniżej opisuję instalację i podstawową konfigurację klienta MQTT dla Supli. Przykłady wykorzystania można znaleźć tu: viewtopic.php?f=24&t=3809 oraz tu: viewtopic.php?f=9&t=5462. Oczywiście to tylko nieliczne przykłady zastosowania MQTT, mniej lub bardziej zaawansowani użytkownicy na pewno znajdą inne zastosowanie dla tego klienta.
Klient wymaga zainstalowanego wcześniej brokera MQTT oraz instancji Supli, nie ma znaczenia czy będzie to instancja własna czy ta w chmurze. Sam klient jednak musi być uruchomiony we własnej infrastrukturze np. na RPi (RPi 4 tested & approved ).
Instalacja
Opis instalacji:
https://github.com/SUPLA/supla-core/t ... t-client
Jeśli po zalogowaniu do MQTT Explorer'a nie widać stanów kanałów Supli --> pisz w tym wątku!
Jeśli widać -> instalacja została zakończona.
Supla<->MQTT - Instalacja
Może jakaś wersja dokerowa ?
Wolisz dockera czy wersję skompilowaną?. W przypadku tej drugiej mam RPi 2 to chyba jest na armv7. Ale czy zatrybi ...
Możesz samodzielnie sobie skompilować.
Kod: Zaznacz cały
git clone https://github.com/SUPLA/supla-core
cd supla-core
git checkout mqtt-experimental
cd supla-mqtt-client/Release
make all
Jakimi ?
Na QNAPie:
Na malinie to już w ogóle wszystko się sypie (ale tutaj raczej problem z systemem, który trochę "kuleje"):
Kod: Zaznacz cały
../src/supla-client-lib/supla-socket.c:42:10: fatal error: openssl/err.h: No such file or directory
#include <openssl/err.h>
^~~~~~~~~~~~~~~
compilation terminated.
make: *** [src/supla-client-lib/subdir.mk:60: src/supla-client-lib/supla-socket.o] Error 1
Kod: Zaznacz cały
../src/yaml/yaml.cpp:1864:36: error: expected ‘;’ before ‘it’
for (auto it = node.Begin(); it != node.End(); it++) {
^
../src/yaml/yaml.cpp:1864:36: error: ‘it’ was not declared in this scope
../src/yaml/yaml.cpp:1952:12: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = lines.begin(); it != lines.end(); it++) {
^
../src/yaml/yaml.cpp:1952:17: error: ‘it’ does not name a type
for (auto it = lines.begin(); it != lines.end(); it++) {
^
../src/yaml/yaml.cpp:1952:37: error: expected ‘;’ before ‘it’
for (auto it = lines.begin(); it != lines.end(); it++) {
^
../src/yaml/yaml.cpp:1952:37: error: ‘it’ was not declared in this scope
../src/yaml/yaml.cpp: In function ‘std::string Yaml::ExceptionMessage(const string&, Yaml::ReaderLine&)’:
../src/yaml/yaml.cpp:1980:44: error: ‘to_string’ is not a member of ‘std’
return message + std::string(" Line ") + std::to_string(line.No) +
^
../src/yaml/yaml.cpp: In function ‘std::string Yaml::ExceptionMessage(const string&, Yaml::ReaderLine&, size_t)’:
../src/yaml/yaml.cpp:1986:44: error: ‘to_string’ is not a member of ‘std’
return message + std::string(" Line ") + std::to_string(line.No) +
^
../src/yaml/yaml.cpp:1987:36: error: ‘to_string’ is not a member of ‘std’
std::string(" column ") + std::to_string(errorPos + 1) +
^
../src/yaml/yaml.cpp: In function ‘std::string Yaml::ExceptionMessage(const string&, size_t, size_t)’:
../src/yaml/yaml.cpp:1993:44: error: ‘to_string’ is not a member of ‘std’
return message + std::string(" Line ") + std::to_string(errorLine) +
^
../src/yaml/yaml.cpp:1994:36: error: ‘to_string’ is not a member of ‘std’
std::string(" column ") + std::to_string(errorPos);
^
../src/yaml/yaml.cpp: In function ‘std::string Yaml::ExceptionMessage(const string&, size_t, const string&)’:
../src/yaml/yaml.cpp:1999:44: error: ‘to_string’ is not a member of ‘std’
return message + std::string(" Line ") + std::to_string(errorLine) +
^
../src/yaml/yaml.cpp: In function ‘size_t Yaml::FindNotCited(const string&, char, size_t&)’:
../src/yaml/yaml.cpp:2049:39: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::vector<std::pair<size_t, size_t>> quotes;
^
../src/yaml/yaml.cpp:2054:22: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
quotes.push_back({quoteStart, quoteEnd});
^
../src/yaml/yaml.cpp:2054:44: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
quotes.push_back({quoteStart, quoteEnd});
^
../src/yaml/yaml.cpp:2067:49: error: in C++98 ‘currentQuote’ must be initialized by constructor, not by ‘{...}’
std::pair<size_t, size_t> currentQuote = {0, 0};
^
../src/yaml/yaml.cpp: In function ‘void Yaml::CopyNode(const Yaml::Node&, Yaml::Node&)’:
../src/yaml/yaml.cpp:2157:12: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = from.Begin(); it != from.End(); it++) {
^
../src/yaml/yaml.cpp:2157:17: error: ‘it’ does not name a type
for (auto it = from.Begin(); it != from.End(); it++) {
^
../src/yaml/yaml.cpp:2157:36: error: expected ‘;’ before ‘it’
for (auto it = from.Begin(); it != from.End(); it++) {
^
../src/yaml/yaml.cpp:2157:36: error: ‘it’ was not declared in this scope
../src/yaml/yaml.cpp:2164:12: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = from.Begin(); it != from.End(); it++) {
^
../src/yaml/yaml.cpp:2164:17: error: ‘it’ does not name a type
for (auto it = from.Begin(); it != from.End(); it++) {
^
../src/yaml/yaml.cpp:2164:36: error: expected ‘;’ before ‘it’
for (auto it = from.Begin(); it != from.End(); it++) {
^
../src/yaml/yaml.cpp:2164:36: error: ‘it’ was not declared in this scope
../src/yaml/yaml.cpp: In function ‘void Yaml::AddEscapeTokens(std::string&, const string&)’:
../src/yaml/yaml.cpp:2183:8: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = tokens.begin(); it != tokens.end(); it++) {
^
../src/yaml/yaml.cpp:2183:13: error: ‘it’ does not name a type
for (auto it = tokens.begin(); it != tokens.end(); it++) {
^
../src/yaml/yaml.cpp:2183:34: error: expected ‘;’ before ‘it’
for (auto it = tokens.begin(); it != tokens.end(); it++) {
^
../src/yaml/yaml.cpp:2183:34: error: ‘it’ was not declared in this scope
../src/yaml/yaml.cpp: In member function ‘const char* Yaml::Exception::Message() const’:
../src/yaml/yaml.cpp:96:57: warning: control reaches end of non-void function [-Wreturn-type]
const char *Exception::Message() const { return what(); }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::ScalarImp::Insert(size_t)’:
../src/yaml/yaml.cpp:276:62: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *Insert(const size_t index) { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::MapImp::Insert(size_t)’:
../src/yaml/yaml.cpp:239:62: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *Insert(const size_t index) { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::ScalarImp::PushFront()’:
../src/yaml/yaml.cpp:278:47: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *PushFront() { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::MapImp::PushFront()’:
../src/yaml/yaml.cpp:241:47: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *PushFront() { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::ScalarImp::PushBack()’:
../src/yaml/yaml.cpp:280:46: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *PushBack() { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::MapImp::PushBack()’:
../src/yaml/yaml.cpp:243:46: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *PushBack() { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::ScalarImp::GetNode(size_t)’:
../src/yaml/yaml.cpp:272:63: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *GetNode(const size_t index) { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::MapImp::GetNode(size_t)’:
../src/yaml/yaml.cpp:227:63: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *GetNode(const size_t index) { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::SequenceImp::GetNode(size_t)’:
../src/yaml/yaml.cpp:143:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::ScalarImp::GetNode(const string&)’:
../src/yaml/yaml.cpp:274:67: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *GetNode(const std::string &key) { return nullptr; }
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::MapImp::GetNode(const string&)’:
../src/yaml/yaml.cpp:237:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
../src/yaml/yaml.cpp: In member function ‘virtual Yaml::Node* Yaml::SequenceImp::GetNode(const string&)’:
../src/yaml/yaml.cpp:145:67: warning: control reaches end of non-void function [-Wreturn-type]
virtual Node *GetNode(const std::string &key) { return nullptr; }
^
../src/yaml/yaml.cpp: In function ‘std::string Yaml::ExceptionMessage(const string&, size_t, size_t)’:
../src/yaml/yaml.cpp:1995:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
../src/yaml/yaml.cpp: In function ‘std::string Yaml::ExceptionMessage(const string&, Yaml::ReaderLine&)’:
../src/yaml/yaml.cpp:1982:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
src/yaml/subdir.mk:18: polecenia dla obiektu 'src/yaml/yaml.o' nie powiodły się
make: *** [src/yaml/yaml.o] Błąd 1
Na pewno apt-get install libssl-dev
ale jeszcze jest jakiś problem
ale jeszcze jest jakiś problem