AsyncMqtt_Generic erster Kompilierversuch schlägt schon fehl?!

Moin,

ich wollte gerade mit dem Beispiel "FullyFeatured_ESP8266" der "AsyncMQTT_Generic" Library anfangen....aber es kommt direkt beim ersten kompilier Versuch folgende Fehlermeldung:

"C:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2/tools/sdk/include" "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2/tools/sdk/lwip2/include" "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\Chris\\AppData\\Local\\Temp\\arduino_build_178239/core" -c -Wall -Wextra -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10819 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DESP8266 "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2\\cores\\esp8266" "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2\\variants\\nodemcu" "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2\\libraries\\ESP8266WiFi\\src" "-IC:\\Users\\Chris\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2\\libraries\\Ticker" "-IC:\\Users\\Chris\\Documents\\Arduino\\libraries\\AsyncMQTT_Generic\\src" "-IC:\\Users\\Chris\\Documents\\Arduino\\libraries\\ESPAsyncTCP-master\\src" "C:\\Users\\Chris\\AppData\\Local\\Temp\\arduino_build_178239\\sketch\\MQTT_AsyncMQTT_Generic_FullyFeatured_ESP8266_001.ino.cpp" -o "C:\\Users\\Chris\\AppData\\Local\\Temp\\arduino_build_178239\\sketch\\MQTT_AsyncMQTT_Generic_FullyFeatured_ESP8266_001.ino.cpp.o"
In file included from C:\Users\Chris\Documents\Arduino\libraries\AsyncMQTT_Generic\src/AsyncMqtt_Generic.h:31:0,
                 from H:\nodeMCU\Sketch\MQTT_AsyncMQTT_Generic_FullyFeatured_ESP8266_001\MQTT_AsyncMQTT_Generic_FullyFeatured_ESP8266_001.ino:17:
C:\Users\Chris\Documents\Arduino\libraries\AsyncMQTT_Generic\src/AsyncMqttClient_Generic_Impl.h: In member function 'uint16_t AsyncMqttClient::publish(const char*, uint8_t, bool, const char*, size_t, bool, uint16_t)':
C:\Users\Chris\Documents\Arduino\libraries\AsyncMQTT_Generic\src/AsyncMqttClient_Generic.hpp:176:37: error: 'class EspClass' has no member named 'getMaxFreeBlockSize'
   #define GET_FREE_MEMORY()     ESP.getMaxFreeBlockSize()
                                     ^
C:\Users\Chris\Documents\Arduino\libraries\AsyncMQTT_Generic\src/AsyncMqttClient_Generic_Impl.h:1270:30: note: in expansion of macro 'GET_FREE_MEMORY'
   if (_state != CONNECTED || GET_FREE_MEMORY() < MQTT_MIN_FREE_MEMORY)
                              ^
Bibliothek ESP8266WiFi in Version 1.0 im Ordner: C:\Users\Chris\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi  wird verwendet
Bibliothek Ticker in Version 1.0 im Ordner: C:\Users\Chris\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\Ticker  wird verwendet
Bibliothek AsyncMQTT_Generic in Version 1.5.0 im Ordner: C:\Users\Chris\Documents\Arduino\libraries\AsyncMQTT_Generic  wird verwendet
Bibliothek ESPAsyncTCP-master in Version 1.2.0 im Ordner: C:\Users\Chris\Documents\Arduino\libraries\ESPAsyncTCP-master  wird verwendet
exit status 1
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

Vermutlich ist das der Fehler "'class EspClass' has no member named 'getMaxFreeBlockSize'"

Wie löse ich nun dieses Problem?

Beste Grüße,
Chris

Sie verwenden den sehr alten ESP8266-Kern v2.4.2. Sie müssen den ESP8266-Core auf v2.7.2+ aktualisieren, am besten auf den neuesten Core v3.0.2

(Mit Google Übersetzer)

1 Like

Okay, thanks a lot, this works!

Now I can compile it.

After starting the sketch there occurs new problems. Here is the error message:

02:07:34.739 -> 
02:07:34.739 -> Starting FullyFeature_ESP8266 on ESP8266_NODEMCU_ESP12E
02:07:34.807 -> AsyncMQTT_Generic v1.5.0 for ESP8266
02:07:34.841 -> Connecting to Wi-Fi...
02:07:38.541 -> Connected to Wi-Fi. IP address: 192.168.178.123
02:07:38.608 -> Connecting to MQTT...
02:07:38.608 -> Publish acknowledged.
02:07:38.642 ->   packetId: 21584
02:07:38.676 -> Publish acknowledged.
02:07:38.676 ->   packetId: 29556
02:07:38.710 -> [AMQTT] _onData: rcv PROTOCOL VIOLATION
02:07:38.744 -> Disconnected from MQTT.
02:07:38.778 -> [AMQTT] _onData: rcv PROTOCOL VIOLATION
02:07:38.812 -> 
02:07:38.812 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
02:07:38.880 -> 
02:07:38.880 -> Exception (28):
02:07:38.914 -> epc1=0x402023eb epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
02:07:38.982 -> 
02:07:38.982 -> >>>stack>>>
02:07:39.016 -> 
02:07:39.016 -> ctx: sys
02:07:39.016 -> sp: 3fffec40 end: 3fffffb0 offset: 0190
02:07:39.050 -> 3fffedd0:  3fff0142 3ffeea68 3ffee8e8 4020237c  
02:07:39.118 -> 3fffede0:  3ffeff74 3ffefb14 402010c4 40208da8  
02:07:39.152 -> 3fffedf0:  402025bc 00000000 3ffee8e8 0012fb28  
02:07:39.220 -> 3fffee00:  0000001b 00000000 4bc6a7f0 00000000  
02:07:39.288 -> 3fffee10:  3ffeead0 3ffefc04 4010030d 00000000  
02:07:39.322 -> 3fffee20:  0000106a 00000168 3ffe85e0 3ffee8e8  
02:07:39.390 -> 3fffee30:  3fff00fc 3ffefb14 00000000 40202434  
02:07:39.424 -> 3fffee40:  3ffefb14 3ffefb14 3fff00fc 40205780  
02:07:39.492 -> 3fffee50:  00000145 3fff0142 3ffee8e8 3ffee8e8  
02:07:39.526 -> 3fffee60:  00000006 0000001c 3ffee8e8 3ffef314  
02:07:39.594 -> 3fffee70:  3ffefb14 3ffef318 3ffef319 402057c4  
02:07:39.628 -> 3fffee80:  3ffefb14 3ffef318 3ffef319 4021a521  
02:07:39.696 -> 3fffee90:  00000000 3fffdad0 3ffeec10 00000030  
02:07:39.730 -> 3fffeea0:  00000018 00000000 00000000 00000000  
02:07:39.798 -> 3fffeeb0:  3fff0000 0000017b 00000020 3ffeeee0  
02:07:39.832 -> 3fffeec0:  3ffef348 3fff011a 3fff00fc 40217ca9  
02:07:39.900 -> 3fffeed0:  00000014 3ffeeee0 3ffe85e0 401007c7  
02:07:39.934 -> 3fffeee0:  00000000 3ffef4ec 3ffecce0 3fff00cc  

Any Idea what the problem is?

Try the unchanged examples first to use broker.emqx.io broker @ port 1883 to be sure everything is OK on your side. Then moving on step-by-step.

The error is caused by receiving wrong/corrupted packetType

Possible your MQTT broker, network, etc. I have no idea what's wrong. Sorry.

Try to have more debugging msgs by

#define _ASYNC_MQTT_LOGLEVEL_               4

Working OK here using broker.emqx.io broker @ port 1883

Starting FullyFeature_ESP8266 on ESP8266_NODEMCU_ESP12E
AsyncMQTT_Generic v1.5.0 for ESP8266
Connecting to Wi-Fi...
Connected to Wi-Fi. IP address: 192.168.2.111
Connecting to MQTT...
Connected to MQTT broker: broker.emqx.io, port: 1883
PubTopic: async-mqtt/ESP8266_Pub
************************************************
Session present: 0
Subscribing at QoS 2, packetId: 1
Publishing at QoS 0
Publishing at QoS 1, packetId: 2
Publishing at QoS 2, packetId: 3
************************************************
Subscribe acknowledged.
  packetId: 1
  qos: 2
Publish received.
  topic: async-mqtt/ESP8266_Pub
  qos: 2
  dup: 0
  retain: 1
  len: 13
  index: 0
  total: 13
Publish acknowledged.
  packetId: 2
Publish received.
  topic: async-mqtt/ESP8266_Pub
  qos: 0
  dup: 0
  retain: 0
  len: 13
  index: 0
  total: 13
Publish received.
  topic: async-mqtt/ESP8266_Pub
  qos: 1
  dup: 0
  retain: 0
  len: 13
  index: 0
  total: 13
Publish received.
  topic: async-mqtt/ESP8266_Pub
  qos: 2
  dup: 0
  retain: 0
  len: 13
  index: 0
  total: 13
Publish acknowledged.
  packetId: 3
1 Like

Now it works!

Thanks a lot!

Best regards,
Chris

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.