blinker-iot / blinker-library

An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
https://diandeng.tech/
MIT License
3.9k stars 232 forks source link

arduino-esp32 版本变动导致的 __FlashStringHelper 相关问题 #606

Closed laxtiz closed 1 year ago

laxtiz commented 1 year ago

基本信息

设备信息

问题描述

起因

https://github.com/espressif/arduino-esp32/blob/d3254f75a3e646d733d95cd4c096cba5d3d3a195/cores/esp32/WString.h#L34-L38

变动

https://github.com/blinker-iot/blinker-library/blob/c20e2e215c5b91233419ccb086d5e9fa59c8fbd0/src/modules/mqtt/Adafruit_MQTT.h#L174-L182

回调

https://github.com/espressif/arduino-esp32/blob/3670e2bf2aca822f2e1225fdb0e0796e490005a8/cores/esp32/WString.h#L34-L38

现状

看完我的描述,你就明白,blinker-library@0.3.10 只能兼容 arudino-esp32@2.0.8

arduino-esp32 blinker-library 结果
2.0.8 其他版本 无法编译
2.0.8 0.3.10 兼容
其他版本 0.3.10 无法编译
其他版本 其他版本 兼容

以这家公司的按需开源习惯,目前只能等他们的程序员哪天想起来上号发PR,普通用户自己回退版本吧

上游项目 Adafruit_MQTT_Library 并未跟随此次改动,不受影响

代码

#define BLINKER_MQTT
#define DBLINKER_ESP_SMARTCONFIG
#include <Blinker.h>

const char *authKey = "abcd1234";

void setup()
{
  Blinker.begin(authKey);
}

void loop()
{
}

LOG信息

编译信息

In file included from /home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:176,
                 from .pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.h:25,
                 from .pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:22:
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp: In member function 'const char* Adafruit_MQTT::connectErrorString(int8_t)':
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:279:22: note: in expansion of macro 'F'
       case 1: return F("The Server does not support the level of the MQTT protocol requested");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:280:22: note: in expansion of macro 'F'
       case 2: return F("The Client identifier is correct UTF-8 but not allowed by the Server");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:281:22: note: in expansion of macro 'F'
       case 3: return F("The MQTT service is unavailable");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:282:22: note: in expansion of macro 'F'
       case 4: return F("The data in the user name or password is malformed");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:283:22: note: in expansion of macro 'F'
       case 5: return F("Not authorized to connect");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:284:22: note: in expansion of macro 'F'
       case 6: return F("Exceeded reconnect rate limit. Please try again later.");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:285:22: note: in expansion of macro 'F'
       case 7: return F("You have been banned from connecting. Please contact the MQTT server administrator for more details.");
                      ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:286:23: note: in expansion of macro 'F'
       case -1: return F("Connection failed");
                       ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:287:23: note: in expansion of macro 'F'
       case -2: return F("Failed to subscribe");
                       ^
/home/laxtiz/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:38:55: error: cannot convert 'const __FlashStringHelper*' to 'const char*' in return
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                                       ^
.pio/libdeps/debug/Blinker/src/modules/mqtt/Adafruit_MQTT.cpp:288:23: note: in expansion of macro 'F'
       default: return F("Unknown error");
                       ^
i3water commented 1 year ago

该问题5月已处理,建议直接拉取github最新版本而非release版本进行测试。