GUI Generic

User avatar
shimano73
Posts: 2174
Joined: Sun Feb 28, 2016 12:27 pm
Location: Orzesze
Been thanked: 1 time

Post

klew wrote: Sun Nov 22, 2020 11:33 am
Krzyśku wrote: Sun Nov 22, 2020 11:16 am Tak, wiem, czytałem, jest w planach :)
Ale chciałbym zapytać czy wiadomo kiedy? :)
BH1750 :)
W SuplaDevice pojawi się gdy będzie dostępny odpowiedni kanał do tego typu czujników. Czyli czekamy na kanał ogólnego przeznaczenia.
Ja czekam na ten kanał bardziej niż na gwiazdkę :lol:
W elektronice jak nie wiadomo o co chodzi to zwykle chodzi o zasilanie

Wezmę udział w Supla Offline Party 2024 :)
Patryk
Posts: 2944
Joined: Mon Jan 07, 2019 7:51 pm
Location: Rybnik

Post

@YoMan
Ściągnij tą bibliotekę od @klew i TYLKO jej UŻYWAJ:
https://github.com/klew/arduino

oraz "ręcznie" skopiuj brakujące sensory (SHT3x.h, Si7021.h itd...) z:
https://github.com/krycha88/GUI-Generic ... pla/sensor

do tej biblioteki od @klew ( do tego samego folderu "sensory").

A tutaj masz na już "gotowca":
You do not have the required permissions to view the files attached to this post.
User avatar
lukfud
Posts: 2480
Joined: Thu Nov 23, 2017 11:33 pm
Location: Warszawa
Has thanked: 13 times
Been thanked: 11 times

Post

Goral64 wrote: Sun Nov 22, 2020 10:48 am Update firmware zadziałało ale jest mały dyskomfort, gdyż strona główna modułu wczytuje się w IFRAME zamiast w oknie głównym.
Zmodyfikuj plik:

Code: Select all

\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266HTTPUpdateServer\src\ESP8266HTTPUpdateServer-impl.h
Wyrzuć odświeżanie z tego miejsca:

Code: Select all

static const char successResponse[] PROGMEM = ( ... )
https://www.facebook.com/groups/supladiy
https://www.facebook.com/groups/suplazamel
https://www.facebook.com/groups/suplaauraton
https://smartnerzeczy.pl
User avatar
Espablo
Posts: 1754
Joined: Wed Jun 29, 2016 5:04 pm
Location: Oświęcim

Post

Patryk wrote: Sun Nov 22, 2020 12:05 pm @YoMan
Ściągnij tą bibliotekę od @klew i TYLKO jej UŻYWAJ:
https://github.com/klew/arduino

oraz "ręcznie" skopiuj brakujące sensory (SHT3x.h, Si7021.h itd...) z:
https://github.com/krycha88/GUI-Generic ... pla/sensor

do tej biblioteki od @klew ( do tego samego folderu "sensory").

A tutaj masz na już "gotowca":
Tylko po co tak kombinować. Cała biblioteka SuplaDevice na której bazuje aktualna wersja jest do pobrania tutaj
https://github.com/Espablo/GUI-Generic/tree/develop/lib
Każde urządzenie elektryczne działa o wiele lepiej jeśli podłączysz je do prądu. :? :roll:
User avatar
Goral64
Posts: 3258
Joined: Fri Dec 27, 2019 6:22 pm
Location: Żerniki Wrocławskie
Has thanked: 2 times
Been thanked: 1 time

Post

lukfud wrote: Sun Nov 22, 2020 12:32 pm Zmodyfikuj plik:

Code: Select all

\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266HTTPUpdateServer\src\ESP8266HTTPUpdateServer-impl.h
Wyrzuć odświeżanie z tego miejsca:

Code: Select all

static const char successResponse[] PROGMEM = ( ... )
Jestem niezbyt przychylny do modyfikowania cudzych bibliotek, jeśli nie mam pewności, że ich autor uwzględni moje poprawki.
Bardziej elegancko i zgodnie ze sztuką będzie zmodyfikować GUI-Generic poprzez wstawienie po tej linii poniższego kodu:

Code: Select all

#ifdef SUPLA_OTA
  java_script += F("<script type='text/javascript'>if(window.top.location != window.location){"
    "window.top.location.href = window.location.href;}</script>\n");
#endif
Spowoduje to, że link do strony głównej w IFRAME przeniesie stronę główną do głównego okna.
Widzimy się na Supla Offline Party Season 2026 :D

Image
User avatar
lukfud
Posts: 2480
Joined: Thu Nov 23, 2017 11:33 pm
Location: Warszawa
Has thanked: 13 times
Been thanked: 11 times

Post

Goral64 wrote: Sun Nov 22, 2020 2:31 pm

Code: Select all

#ifdef SUPLA_OTA
  java_script += F("<script type='text/javascript'>if(window.top.location != window.location){"
    "window.top.location.href = window.location.href;}</script>\n");
#endif
Spowoduje to, że link do strony głównej w IFRAME przeniesie stronę główną do głównego okna.
Dzięki za podpowiedź.
https://www.facebook.com/groups/supladiy
https://www.facebook.com/groups/suplazamel
https://www.facebook.com/groups/suplaauraton
https://smartnerzeczy.pl
User avatar
YoMan
Posts: 3521
Joined: Thu Apr 30, 2020 5:18 pm
Location: Częstochowa
Has thanked: 3 times
Been thanked: 3 times

Post

Espablo wrote: Sun Nov 22, 2020 1:09 pm
Tylko po co tak kombinować. Cała biblioteka SuplaDevice na której bazuje aktualna wersja jest do pobrania tutaj
https://github.com/Espablo/GUI-Generic/tree/develop/lib
rany !!! ... już widzę gdzie mnie ogarnęło zaćmienie mózgu .... przecież tam wszystko jest ;) już nie woła bibliotek ale mimo wszystko teraz to już wywalił mi taką listę błędów, że kolana się ugięły.Około 30 błędów.

Code: Select all

In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:17:0:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.h:31:44: error: expected class-name before '{' token
 class SequenceButton : public SimpleButton {
                                            ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp: In constructor 'Supla::Control::SequenceButton::SequenceButton(int, bool, bool)':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:21:7: error: class 'Supla::Control::SequenceButton' does not have any field named 'SimpleButton'
     : SimpleButton(pin, pullUp, invertLogic),
       ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp: In member function 'void Supla::Control::SequenceButton::onTimer()':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:34:21: error: 'state' was not declared in this scope
   int stateResult = state.update();
                     ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:35:22: error: 'TO_PRESSED' was not declared in this scope
   if (stateResult == TO_PRESSED) {
                      ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:37:23: error: 'runAction' was not declared in this scope
     runAction(ON_PRESS);
                       ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:39:29: error: 'TO_RELEASED' was not declared in this scope
   } else if (stateResult == TO_RELEASED) {
                             ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:41:25: error: 'runAction' was not declared in this scope
     runAction(ON_RELEASE);
                         ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:57:44: error: 'RELEASED' was not declared in this scope
     if (clickCounter > 0 && stateResult == RELEASED) {
                                            ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:77:23: error: 'ON_SEQUENCE_DOESNT_MATCH' was not declared in this scope
             runAction(ON_SEQUENCE_DOESNT_MATCH);
                       ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:77:47: error: 'runAction' was not declared in this scope
             runAction(ON_SEQUENCE_DOESNT_MATCH);
                                               ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:89:25: error: 'ON_SEQUENCE_MATCH' was not declared in this scope
               runAction(ON_SEQUENCE_MATCH);
                         ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:89:42: error: 'runAction' was not declared in this scope
               runAction(ON_SEQUENCE_MATCH);
                                          ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: In member function 'int Supla::Control::ButtonState::update()':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:34:50: error: no matching function for call to 'Supla::Io::digitalRead(int&)'
     int currentState = Supla::Io::digitalRead(pin);
                                                  ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:34:50: note: candidate is:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:92:25: error: 'ON_SEQUENCE_DOESNT_MATCH' was not declared in this scope
               runAction(ON_SEQUENCE_DOESNT_MATCH);
                         ^
In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:18:0:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../io.h:33:14: note: static int Supla::Io::digitalRead(int, uint8_t)
   static int digitalRead(int channelNumber, uint8_t pin);
              ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../io.h:33:14: note:   candidate expects 2 arguments, 1 provided
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\sequence_button.cpp:92:49: error: 'runAction' was not declared in this scope
               runAction(ON_SEQUENCE_DOESNT_MATCH);
                                                 ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:47:18: error: 'TO_PRESSED' was not declared in this scope
           return TO_PRESSED;
                  ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:49:18: error: 'TO_RELEASED' was not declared in this scope
           return TO_RELEASED;
                  ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:59:12: error: 'PRESSED' was not declared in this scope
     return PRESSED;
            ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:61:12: error: 'RELEASED' was not declared in this scope
     return RELEASED;
            ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: At global scope:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:65:1: error: 'SimpleButton' in namespace 'Supla::Control' does not name a type
 Supla::Control::SimpleButton::SimpleButton(int pin, bool pullUp, bool invertLogic)
 ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:69:22: error: 'Supla::Control::SimpleButton' has not been declared
 void Supla::Control::SimpleButton::onTimer() {
                      ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: In function 'void onTimer()':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:70:21: error: 'state' was not declared in this scope
   int stateResult = state.update();
                     ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:71:22: error: 'TO_PRESSED' was not declared in this scope
   if (stateResult == TO_PRESSED) {
                      ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:72:15: error: 'ON_PRESS' was not declared in this scope
     runAction(ON_PRESS);
               ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:72:15: note: suggested alternative:
In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\button.h:23:0,
                 from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:17:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../events.h:24:3: note:   'ON_PRESS'
   ON_PRESS,    // Triggered on transition to valueOnPress()
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:72:23: error: 'runAction' was not declared in this scope
     runAction(ON_PRESS);
                       ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:73:15: error: 'ON_CHANGE' was not declared in this scope
     runAction(ON_CHANGE);
               ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:73:15: note: suggested alternative:
In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\button.h:23:0,
                 from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:17:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../events.h:26:3: note:   'ON_CHANGE'
   ON_CHANGE,   // Triggered on all transitions
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:74:29: error: 'TO_RELEASED' was not declared in this scope
   } else if (stateResult == TO_RELEASED) {
                             ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:75:15: error: 'ON_RELEASE' was not declared in this scope
     runAction(ON_RELEASE);
               ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:75:15: note: suggested alternative:
In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\button.h:23:0,
                 from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:17:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../events.h:25:3: note:   'ON_RELEASE'
   ON_RELEASE,  // Triggered on transition from valueOnPress()
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:75:25: error: 'runAction' was not declared in this scope
     runAction(ON_RELEASE);
                         ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:76:15: error: 'ON_CHANGE' was not declared in this scope
     runAction(ON_CHANGE);
               ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:76:15: note: suggested alternative:
In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\button.h:23:0,
                 from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:17:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../events.h:26:3: note:   'ON_CHANGE'
   ON_CHANGE,   // Triggered on all transitions
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: At global scope:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:80:22: error: 'Supla::Control::SimpleButton' has not been declared
 void Supla::Control::SimpleButton::onInit() {
                      ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: In function 'void onInit()':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:81:3: error: 'state' was not declared in this scope
   state.init();
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: In member function 'void Supla::Control::ButtonState::init()':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:85:3: error: 'pinMode' is not a member of 'Supla::Io'
   Supla::Io::pinMode(pin, pullUp ? INPUT_PULLUP : INPUT);
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:86:41: error: no matching function for call to 'Supla::Io::digitalRead(int&)'
   prevState = Supla::Io::digitalRead(pin);
                                         ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:86:41: note: candidate is:
In file included from D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:18:0:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../io.h:33:14: note: static int Supla::Io::digitalRead(int, uint8_t)
   static int digitalRead(int channelNumber, uint8_t pin);
              ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\../io.h:33:14: note:   candidate expects 2 arguments, 1 provided
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: At global scope:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:94:22: error: 'Supla::Control::SimpleButton' has not been declared
 void Supla::Control::SimpleButton::setSwNoiseFilterDelay(unsigned int newDelayMs) {
                      ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: In function 'void setSwNoiseFilterDelay(unsigned int)':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:95:3: error: 'state' was not declared in this scope
   state.setSwNoiseFilterDelay(newDelayMs);
   ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: At global scope:
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:101:22: error: 'Supla::Control::SimpleButton' has not been declared
 void Supla::Control::SimpleButton::setDebounceDelay(unsigned int newDelayMs) {
                      ^
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp: In function 'void setDebounceDelay(unsigned int)':
D:\Moje dokumenty\Arduino\libraries\SuplaDevice\src\supla\control\simple_button.cpp:102:3: error: 'state' was not declared in this scope
   state.setDebounceDelay(newDelayMs);
   ^
exit status 1
Błąd kompilacji dla płytki LOLIN(WEMOS) D1 R2 & mini.

Prawie wszystkie błędy dotyczą plików sequence_button.cpp, simple_button.cpp i button.h i chyba dwa błędy z io.h
menadżer płytek 2.7.4 (w poprzednich wątkach były problemy wynikające z powodu starego menadżera więc zainstalowałem na nowo ale tu chyba nie to)
YoMan
________________________________________
Wziąłem udział w SOP2023 & SOP2024
krycha88
Posts: 5575
Joined: Fri Nov 16, 2018 7:25 am
Been thanked: 5 times

Post

Goral64 wrote: Sun Nov 22, 2020 2:31 pm Bardziej elegancko i zgodnie ze sztuką będzie zmodyfikować GUI-Generic poprzez wstawienie po tej linii poniższego kodu:

Code: Select all

#ifdef SUPLA_OTA
  java_script += F("<script type='text/javascript'>if(window.top.location != window.location){"
    "window.top.location.href = window.location.href;}</script>\n");
#endif
Spowoduje to, że link do strony głównej w IFRAME przeniesie stronę główną do głównego okna.
Dzięki za podpowiedź, poprawie :)

Już niedługo udostępnię sposób aktualizacji oprogramowania przez OTA dla pamięci 1MB :)
https://gui-generic-builder.supla.io/
User avatar
Espablo
Posts: 1754
Joined: Wed Jun 29, 2016 5:04 pm
Location: Oświęcim

Post

YoMan wrote: Sun Nov 22, 2020 2:46 pm Prawie wszystkie błędy dotyczą plików sequence_button.cpp, simple_button.cpp i button.h i chyba dwa błędy z io.h
menadżer płytek 2.7.4 (w poprzednich wątkach były problemy wynikające z powodu starego menadżera więc zainstalowałem na nowo ale tu chyba nie to)
usuń cały SuplaDevice i wgraj z tego linka co podałem wyżej
Każde urządzenie elektryczne działa o wiele lepiej jeśli podłączysz je do prądu. :? :roll:
krycha88
Posts: 5575
Joined: Fri Nov 16, 2018 7:25 am
Been thanked: 5 times

Post

klew wrote: Thu Nov 19, 2020 10:18 am Dodajcie wersjonowanie GUI generic, tak aby firmware version pokazywało wersję GUI generic, a nie biblioteki.
chciałem to dodać, ale z tego co widzę to są dwie metody jedna w begine jako parametr a druga SuplaDevice.setSwVersion
tylko jedna i druga wg mnie niepotrzebnie dodaje "SuplaDevice". Jednak to już nie wersja SuplaDevice jest ważna a wersja GUI generic :)
pierwsza:
SuplaDevice User SW, lib 2.3.2
druga:
SuplaDevice test 444 lib 2.3.2
https://gui-generic-builder.supla.io/

Return to “GUI Generic”