Example for connections in access point mode? #131
Replies: 2 comments 14 replies
-
You cannot start connection if you are not connected to a wifi access point. |
Beta Was this translation helpful? Give feedback.
-
So, how should I start a UDP transmission when the esp32 is the AP itself? In the comment where I showed the logs, they were two separate logs, as described in this comment:
|
Beta Was this translation helpful? Give feedback.
-
I'm having trouble with connections in AP mode, this is the "flow" of my code:
The problem occurs at step 4, if I define LWESP_CFG_MODE_STATION to 1(default), I get error 9, if I define it to 0, I get error 2.
Here's my code(I'm using a nucleo f411re with an esp32-wroom-32), am I doing something wrong?:
void Startinit_thread(void argument) {
/ USER CODE BEGIN Startinit_thread */
{
lwespr_t res;
if ((res = lwesp_init(examples_common_lwesp_callback_func, 1)) != lwespOK) {
printf("Failed initializing LwESP, error code: %i, stopping\r\n", res);
Error_Handler();
}
}
lwespr_t lwesp_global_events_func(lwesp_evt_t *evt) {
switch (lwesp_evt_get_type(evt)) {
case LWESP_EVT_AP_CONNECTED_STA: {
lwesp_mac_t *mac = lwesp_evt_ap_connected_sta_get_mac(evt);
utils_print_mac("New station connected to access point with MAC address: ",
mac, "\r\n");
break;
}
case LWESP_EVT_AP_IP_STA: {
lwesp_mac_t *mac = lwesp_evt_ap_ip_sta_get_mac(evt);
lwesp_ip_t *ip = lwesp_evt_ap_ip_sta_get_ip(evt);
}
lwespr_t conn_callback_func(lwesp_evt_t* evt) {
lwesp_conn_p conn;
//lwespr_t res;
uint8_t conn_num;
}
Beta Was this translation helpful? Give feedback.
All reactions