Skip to content

ESP-NOW example does not work with any other channel than 0 and 1 (IDFGH-8090) #9592

@PilnyTomas

Description

@PilnyTomas

Environment

  • Development Kit: ESP32-C3-DevKitC-02
  • Kit version (for WroverKit/PicoKit/DevKitC): v1.1
  • Module or chip used: ESP32-C3-WROOM-02
  • IDF version : v5.1-dev-224-g4d14c2ef2d
  • Build System: idf.py
  • Compiler version : 11.2.0
  • Operating System: Linux - Fedora
  • Using an IDE?: No
  • Power Supply: USB

Problem Description

ESP-NOW example outputs error and does not work when the channel is to anything but 0 or 1

Expected Behavior

If this is expected behavior, please update the example and its documentation to prevent confusion.
If the channel really is supposed to be changeable, then please fix the reason.

Actual Behavior

Does not work.

Steps to reproduce

  1. Go to ESP-NOW example in IDF examples/wifi/espnow
  2. In menuconfig go to Example Configuration ---> Channel and set number 2 or more
  3. Flash and run
  4. Observer errors:
E (5499) ESPNOW: Peer channel is not equal to the home channel, send fail!
E (5499) espnow_example: Send error

Code to reproduce this issue

ESP-NOW example in IDF examples/wifi/espnow

Optionaly you can add extra debug output at the end of the function example_wifi_init - (under line 57)

    uint8_t primaryChan = 0;
    wifi_second_chan_t secondChan = WIFI_SECOND_CHAN_NONE;
    esp_wifi_get_channel(&primaryChan, &secondChan);
    ESP_LOGI(TAG, "CONFIG_ESPNOW_CHANNEL=%d; WiFi is on channel %d  ", CONFIG_ESPNOW_CHANNEL, primaryChan);

A related issue in Arduin-ESP32 espressif/arduino-esp32#2653
Probably related #4311

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions