Hi All!
Did anybody get this error “X509List’ does not name a type”
while compiling Telegram: Request ESP32/ESP8266 Sensor Readings (Arduino IDE) sketch?
I am trying to connect ESP8266 to telegram bot, it works fine with ESP32, but stuck with ESP8266
Can not find any solution on internet yet… Any help would be very appreciated.
Thanks, Konstantin
Hi.
What is the code that you are using for the ESP8266?
In the library manager, update the Telegram Library to the latest version.
Regards,
Sara
Hi Sara,
Thanks for your try to help. I am stuck at the first step, as I just use your sketch without any modification and simply trying to compile it. Code is from this article https://randomnerdtutorials.com/telegram-group-esp32-esp8266/ Have you tried to compile it yourself ?
Arduino is updated to the latest release 1.8.15
Just tried it again and got the following set of errors:
sketch_jun01a:30:3: error: ‘X509List’ does not name a type
X509List cert(TELEGRAM_CERTIFICATE_ROOT);
^
C:\Users\kosbo\Documents\Arduino\sketch_jun01a\sketch_jun01a.ino: In function ‘void setup()’:
sketch_jun01a:90:12: error: ‘class axTLS::WiFiClientSecure’ has no member named ‘setTrustAnchors’
client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org
^
sketch_jun01a:90:29: error: ‘cert’ was not declared in this scope
client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org
^
sketch_jun01a:100:47: error: no matching function for call to ‘axTLS::WiFiClientSecure::setCACert(const char [1369])’
client.setCACert(TELEGRAM_CERTIFICATE_ROOT); // Add root certificate for api.telegram.org
^
C:\Users\kosbo\Documents\Arduino\sketch_jun01a\sketch_jun01a.ino:100:47: note: candidate is:
In file included from C:\Users\kosbo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src/WiFiClientSecure.h:23:0,
from C:\Users\kosbo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:42,
from C:\Users\kosbo\Documents\Arduino\sketch_jun01a\sketch_jun01a.ino:11:
C:\Users\kosbo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src/WiFiClientSecureAxTLS.h:56:8: note: bool axTLS::WiFiClientSecure::setCACert(const uint8_t*, size_t)
bool setCACert(const uint8_t* pk, size_t size);
^
C:\Users\kosbo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src/WiFiClientSecureAxTLS.h:56:8: note: candidate expects 2 arguments, 1 provided
exit status 1
‘X509List’ does not name a type
Hi.
Yes, it is working fine for me.
You need to update the Telegram Bot Library.
Follow the next steps to install the latest release of the library.
- Click here to download the Universal Arduino Telegram Bot library.
- Go to Sketch > Include Library > Add.ZIP Library...
- Add the library you’ve just downloaded.
Then, check the library version. Go Sketch > Include Library > Manage Libraries and search for “universaltelegram”. Check that you have version 1.3.0 installed.
Restart your Arduino IDE. Then, it should compile just fine.
Regards,
Sara
Hi,
Thanks a lot for your help. I have successfully compiled sketch on another PC, so something wrong on my main computer…
Hi,
Just in case if somebody gets similar problem, most likely this error does not related to ArduinoJson or Telegram bot library releases, as I tried different releases and it did not help.
As I am using ESP8266 for a while, my ESP8266 board release in Arduino was 2.4.2.
Just updating it to the current 3.0.0 ESP8266 board release solved the problem.
All the best, Konstantin