Skip to content

repeated start soft-AP at ESP32-S3 and esp_hosted_fg #678

@bern123456789

Description

@bern123456789

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

Hello,
we setup a system with the ESP32-S3 and the esp_hosted_fg. It is a regular feature to start and stop the soft-ap without reset of the host controller.
The soft-ap was started, used and stopped. The soft-ap is now started again and the WiFi communication is expected, because a WiFi client is connected and sends UDP data packets. It is expected, that the lwip stack on the host receives the packets.

Actual behavior (suspected bug)

The soft-ap is now started again and the WiFi communication is expected, because a WiFi client is connected and sends UDP data packets. The received data packet is dropped by the function netdev_rx. The value ndev->state has NETDEV_STATE_DOWN.
I detected an bug in the following function. When the host driver shall start the soft-ap again, then the rx_q is already created. The case of the condition if (ndev->rx_q) do not update of the ndev->state.

int netdev_open(netdev_handle_t ndev)
{
	if (!ndev)
		return STM_FAIL;

	if (ndev->rx_q) {
		xQueueReset(ndev->rx_q);
		return STM_OK;
	}

	ndev->rx_q = xQueueCreate(RX_QUEUE_SIZE, sizeof(struct esp_pbuf));

	if (!ndev->rx_q)
		return STM_FAIL;

	ndev->state = NETDEV_STATE_UP;

	return STM_OK;
}

Error logs or terminal output

Steps to reproduce the behavior

  1. start soft AP
  2. communication with client is possible
  3. stop soft AP
  4. start soft AP
  5. communication with client is not possible

Project release version

https://github.com/espressif/esp-hosted.git d9e607d

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Windows

Operating system version

Windows 11

Shell

ZSH

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions