When I run this code :
Code: Untitled.c Select all
#include <stdio.h>
#include <string.h>
#include "esp_system.h"
#include "esp_console.h"
#include "esp_vfs_dev.h"
#include "esp_vfs_fat.h"
#include "esp_wifi.h"
#include "driver/uart.h"
#include "nvs_flash.h"
#include "esp_http_client.h"
#define EXAMPLE_ESP_WIFI_SSID "iPhone"
#define EXAMPLE_ESP_WIFI_PASS "XXXXXXXXXXXX"
void app_main(void)
{
char dest[100] = "https://XXXXXXXXXXXXXXXXX.com/connect.php?texte=";
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
ESP_ERROR_CHECK(uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0));
esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);
esp_vfs_dev_uart_port_set_rx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CR);
esp_vfs_dev_uart_port_set_tx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CRLF);
nvs_flash_init();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
wifi_config_t wifi_config = {
.sta = {
.ssid = EXAMPLE_ESP_WIFI_SSID,
.password = EXAMPLE_ESP_WIFI_PASS,
.threshold.authmode = WIFI_AUTH_WPA2_PSK,
.pmf_cfg = {
.capable = true,
.required = false,
},
},
};
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config));
ESP_ERROR_CHECK(esp_wifi_start());
esp_wifi_connect();
printf("Connected...");
char chr[40];
while(1){
printf("Enter Data : ");
scanf("%39s\n", chr);
printf(strcat(dest, chr));
esp_http_client_config_t config = {
.url = strcat(dest, chr)
};
esp_http_client_handle_t client = esp_http_client_init(&config);
esp_http_client_perform(client);
esp_http_client_cleanup(client);
}
}
Code: Untitled.txt Select all
assertion "Invalid mbox" failed: file "C:/Users/XXXX/Desktop/esp-idf/components/lwip/lwip/src/api/tcpip.c", line 455, function: tcpip_send_msg_wait_semThanks you in advance.
AH.
