Hi, I'm trying to communicate to my telegram bot using the https_request example in the ESP-IDF. On the long road I want the ESP32 to send data to the bot, but now I'am just trying to communicate with it. I believe I understand how the example works so I made these changes:
Code: Select all
#define WEB_SERVER "https://api.telegram.org"
#define WEB_PORT "443"
#define WEB_URL "https://api.telegram.org/bot<your-bot-token>/getme"
Code: Select all
static const char *REQUEST = "GET " WEB_URL " HTTP/1.0\r\n"
"Host: "WEB_SERVER"\r\n"
"User-Agent: esp-idf/1.0 esp32\r\n"
"\r\n";
Code: Select all
{'id': 123456789, 'first_name': 'Test', 'is_bot': True, 'username': 'Espressif', 'can_join_groups': True, 'can_read_all_group_messages': False, 'supports_inline_queries': True}
Code: Select all
E (3110) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
E (3120) esp-tls: Failed to open new connection
Note 2: to learn about the example I used these defines and everything worked fine:
Code: Select all
#define WEB_SERVER "www.swapi.dev"
#define WEB_PORT "443"
#define WEB_URL "https://swapi.dev/api/people/1/"
Note 4: I'm trying now esp_http_client example to see if it work there, but until now I have found the same error when I use the function https_with_url with a little changes.
Thanks