Forum: Mikrocontroller und Digitale Elektronik ESP32 - Fehler beim Kompilieren von c't Basecamp mit Asynctcp.h


von Andreas G. (andreasgs)


Lesenswert?

Hi,

In der c't war letztens ein intersantes Projekt für den ESP32 
abgedruckt. Hier der Link zum github repository: 
https://github.com/merlinschumacher/Basecamp. Das Projekt Basecamp 
stellt hierbei alle nötigen Randbedingungen zur Verfügung um einen ESP32 
mit einem MQTT - Broker kommunizieren zu können.

Das Thema habe ich schon auf github gepostet, hoffe hier aber auf eine 
breitere Leserschaft.

Ich habe eine Arduino IDE mit dazugehörigen Bibliotheken aufgesetzt und 
versucht, ein Beispielsketch zu kompilieren:
1
#include <Basecamp.hpp>
2
Basecamp iot;
3
4
void setup() {
5
  iot.begin();
6
    //The mqtt object is an instance of Async MQTT Client. See it's documentation for details.
7
    iot.mqtt.subscribe("test/lol",2);
8
9
    //Use the web object to add elements to the interface
10
    iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor");
11
    iot.web.setInterfaceElementAttribute("color", "type", "text");
12
13
}
14
15
void loop() {
16
  //your code
17
}


Nun bekomme ich eine Reihe von Kompilierfehlern:
1
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:27: error: field 'call' has incomplete type 'tcpip_api_call'
2
3
     struct tcpip_api_call call;
4
5
                           ^
6
7
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: forward declaration of 'struct tcpip_api_call'
8
9
     struct tcpip_api_call call;
10
11
            ^
12
13
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_output(tcp_pcb*)':
14
15
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:291:65: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
16
17
     tcpip_api_call(_tcp_output_api, (struct tcpip_api_call*)&msg);
18
19
                                                                 ^
20
21
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:291:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
22
23
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
24
25
     struct tcpip_api_call call;
26
27
            ^
28
29
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_write(tcp_pcb*, const char*, size_t, uint8_t)':
30
31
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:307:64: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
32
33
     tcpip_api_call(_tcp_write_api, (struct tcpip_api_call*)&msg);
34
35
                                                                ^
36
37
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:307:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
38
39
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
40
41
     struct tcpip_api_call call;
42
43
            ^
44
45
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_recved(tcp_pcb*, size_t)':
46
47
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:322:65: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
48
49
     tcpip_api_call(_tcp_recved_api, (struct tcpip_api_call*)&msg);
50
51
                                                                 ^
52
53
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:322:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
54
55
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
56
57
     struct tcpip_api_call call;
58
59
            ^
60
61
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_connect(tcp_pcb*, ip_addr_t*, uint16_t, tcp_connected_fn)':
62
63
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:338:66: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
64
65
     tcpip_api_call(_tcp_connect_api, (struct tcpip_api_call*)&msg);
66
67
                                                                  ^
68
69
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:338:66: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
70
71
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
72
73
     struct tcpip_api_call call;
74
75
            ^
76
77
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_close(tcp_pcb*)':
78
79
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:352:64: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
80
81
     tcpip_api_call(_tcp_close_api, (struct tcpip_api_call*)&msg);
82
83
                                                                ^
84
85
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:352:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
86
87
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
88
89
     struct tcpip_api_call call;
90
91
            ^
92
93
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_abort(tcp_pcb*)':
94
95
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:367:64: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
96
97
     tcpip_api_call(_tcp_abort_api, (struct tcpip_api_call*)&msg);
98
99
                                                                ^
100
101
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:367:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
102
103
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
104
105
     struct tcpip_api_call call;
106
107
            ^
108
109
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_bind(tcp_pcb*, ip_addr_t*, uint16_t)':
110
111
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:382:63: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
112
113
     tcpip_api_call(_tcp_bind_api, (struct tcpip_api_call*)&msg);
114
115
                                                               ^
116
117
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:382:63: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
118
119
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
120
121
     struct tcpip_api_call call;
122
123
            ^
124
125
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'tcp_pcb* _tcp_listen_with_backlog(tcp_pcb*, uint8_t)':
126
127
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:397:65: error: invalid conversion from 'err_t (*)(tcpip_api_call*) {aka signed char (*)(tcpip_api_call*)}' to 'tcpip_api_call_fn {aka signed char (*)(tcpip_api_call_data*)}' [-fpermissive]
128
129
     tcpip_api_call(_tcp_listen_api, (struct tcpip_api_call*)&msg);
130
131
                                                                 ^
132
133
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:397:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'
134
135
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
136
137
     struct tcpip_api_call call;
138
139
            ^
140
141
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: At global scope:
142
143
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:624:6: error: prototype for 'void AsyncClient::_dns_found(ip_addr_t*)' does not match any in class 'AsyncClient'
144
145
 void AsyncClient::_dns_found(ip_addr_t *ipaddr){
146
147
      ^
148
149
In file included from C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:24:0:
150
151
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.h:84:10: error: candidate is: void AsyncClient::_dns_found(_ip_addr*)
152
153
     void _dns_found(struct _ip_addr *ipaddr);
154
155
          ^
156
157
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:946:6: error: prototype for 'void AsyncClient::_s_dns_found(const char*, ip_addr_t*, void*)' does not match any in class 'AsyncClient'
158
159
 void AsyncClient::_s_dns_found(const char * name, ip_addr_t * ipaddr, void * arg){
160
161
      ^
162
163
In file included from C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:24:0:
164
165
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.h:164:17: error: candidate is: static void AsyncClient::_s_dns_found(const char*, _ip_addr*, void*)
166
167
     static void _s_dns_found(const char *name, struct _ip_addr *ipaddr, void *arg);
168
169
                 ^
170
171
Mehrere Bibliotheken wurden für "WiFi.h" gefunden
172
 Benutzt: C:\Users\Andreas\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
173
 Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\WiFi
174
exit status 1
175
Fehler beim Kompilieren für das Board ESP32 Wrover Module.

Ich verwende folgende Versionen der Module:
Arduino 1.8.7
Basecamp 0.1.8 (Downgrade auf 0.1.6 brachte die selben Fehler wie oben)
ESPAsyncWebServer (Masterbranch vom 1.11.18)
ArduinoJSON (Masterbranch vom 1.11.18, ArduinoJson-5.13.3 keine 
Änderung, ArduinoJson-6.5.0-beta keine Änderung)
Async MQTT Client 0.8.1 (Anpassung in AsyncMqttClient.hpp der 
Includedatei ESPAsynctcp.h auf Asynctcp.h)
AsyncTCP (Masterbranch vom 1.11.18)

Ich hoffe sie können mir weiterhelfen. Ich hab die selben 
Fehlermeldungen auf zwei unterschiedlichen Rechnern so reproduzieren 
können.

Grüße
Andreas

: Verschoben durch User
von Suran (Gast)


Lesenswert?

> Mehrere Bibliotheken wurden für "WiFi.h" gefunden ...

Wie kommt es, dass es mehr als eine WiFi.h gibt?

Könnte die Ursache für alle Fehler sein.

von Rufus Τ. F. (rufus) Benutzerseite


Lesenswert?

Wie in C und C++ üblich, verbirgt sich das Problem in der ersten 
Fehlermeldung.
1
C:\Users\Andreas\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:27: error: field 'call' has incomplete type 'tcpip_api_call'
2
3
     struct tcpip_api_call call;

Und das, was da steht, muss man halt genau lesen und verstehen.

Hier bedeutet es, daß der Strukturtyp "struct tcpip_api_call" nicht 
bekannt ist, sondern nur als Vorwärtsdeklaration vorliegt.

Also solltest Du Deine Sourcen nach der Deklaration der Struktur 
durchforsten und die betreffende Headerdatei in Dein Sourcefile 
einbinden, damit die Struktur vollständig deklariert ist.

von Michael U. (amiga)


Lesenswert?

Hallo,

ich habe BaseCamp bisher ignoriert, aber jetzt trotzdem al runtergeladen 
und reingeworfen.
ArduinoJson und ESPAsyncWebServer mußte ich noch nachinstallieren, hatte 
ich in der Test-IDE nicht drauf.
Dann compiliertes es Deinen Sketch aber ohne zu meckern.
IDE 1.8.8, ESP32 1.0.0 Boardmanager-Release.

Gibt zwar noch eine Warnung in AsyncJson wegen
converting a string constant to 'char*'
aber die kann man schnell beheben. Passiert durch die Änderungen der 
Packages zum C++ Standard z.Z. in etlichen Libs, die noch nicht 
angepasst wurde.
Sollte prinzipiell auch mit der Warnung spielen.

Gruß aus Berlin
Michael

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.