starkillerOG / h801-mqtt-json

The is an alternative firmware for the H801 LED dimmer that uses MQTT JSON as a control channel. This makes it easy to integrate into Home Assistant and other Home Automation applications.
MIT License
12 stars 2 forks source link

'mqtt_server_conf' was not declared in this scope? #2

Closed farkasn closed 4 years ago

farkasn commented 4 years ago

Hi, when I try to verify the h801-mqtt-json i get this error :( Can you help how can I solve this?

Thanks: Norbert

Arduino: 1.8.13 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), no dtr (aka ck), 26 MHz, 40MHz, DIO, 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Serial, None, Only Sketch, 115200"

In file included from sketch\h801-mqtt-json.ino.cpp:1:0:

C:\Users\norbert.farkas\Desktop\home\h801-mqtt-json-master\h801-mqtt-json\h801-mqtt-json.ino: In function 'void get_m_state_from_transition_state()':

C:\Users\norbert.farkas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:256:85: internal compiler error: in cp_parser_abort_tentative_parse, at cp/parser.c:23793

 #define _max(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a > _b? _a : _b; })

                                                                                     ^

C:\Users\norbert.farkas\Desktop\home\h801-mqtt-json-master\h801-mqtt-json\h801-mqtt-json.ino:1074:24: note: in expansion of macro '_max'

     m_rgb_brightness = _max(transition_red, _max(transition_green, transition_blue));

                        ^

C:\Users\norbert.farkas\Desktop\home\h801-mqtt-json-master\h801-mqtt-json\h801-mqtt-json.ino:1074:45: note: in expansion of macro '_max'

     m_rgb_brightness = _max(transition_red, _max(transition_green, transition_blue));

                                             ^

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

exit status 1

Error compiling for board Generic ESP8266 Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
starkillerOG commented 4 years ago

You need to add the Config.h file and you need to fill in the correct settings in the Config.h file. (you MQTT broker adress, username, password etc.)

Edit: that were the previous errors you got, I think you now have a diffrent error

starkillerOG commented 4 years ago

try to replace _max with std::max on the following lines: 2x on line: https://github.com/starkillerOG/h801-mqtt-json/blob/8e30bf54d04e638c528dc24ae7a86937e16c12e0/h801-mqtt-json.ino#L1074 1x on line: https://github.com/starkillerOG/h801-mqtt-json/blob/8e30bf54d04e638c528dc24ae7a86937e16c12e0/h801-mqtt-json.ino#L1087

starkillerOG commented 4 years ago

I tried the std::max and that indeed fixes this issue. I committed the changes so this issue can now be closed.