Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send packets failed while integrating the send function in the receiver side (AEGHB-830) #208

Open
3 tasks done
Yaqi3707 opened this issue Oct 1, 2024 · 1 comment
Open
3 tasks done

Comments

@Yaqi3707
Copy link

Yaqi3707 commented Oct 1, 2024

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate.
  • Provided a clear description of your suggestion.
  • Included any relevant context or examples.

Issue or Suggestion Description

Greetings ESP32 developers,

As I browsed the issues about whether it was possible to integrate both the send and receive functions in either the sender or receiver side, the answer is yes #142. So I would like to implement these two functions on my sender and receiver side.

I am using Rpi4 with OS: Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux

My ESP-idf is: ESP-IDF v5.4-dev-1873-g41dd1a351b

I modified the sender and receiver here(receiver.txt, sender.txt).
In my code, I added the send function right after the CSI capture and print function since I wanted a quick response (I temporarily disabled the CSI data print function). The issue came from the receiver side so far, which showed me that the send function failed after each CSI packet was received. I made sure no error came from the code, but I could not figure out why the send function always failed.
Screenshot 2024-09-30 203624

I truly and sincerely appreciate any suggestions and guidance that help me on this implementation.

@github-actions github-actions bot changed the title Send packets failed while integrating the send function in the receiver side Send packets failed while integrating the send function in the receiver side (AEGHB-830) Oct 1, 2024
@NingYuxiang
Copy link

NingYuxiang commented Nov 19, 2024

In the receiver.txt file, the peer structure in the main function:

    esp_now_peer_info_t peer = {
        .channel = CONFIG_LESS_INTERFERENCE_CHANNEL,
        .ifidx = WIFI_IF_STA,
        .encrypt = false,
        .peer_addr = {0x1a, 0x00, 0x00, 0x00, 0x00, 0x00},
    };

should be modified to a static variable:

    static esp_now_peer_info_t peer = {
        .channel = CONFIG_LESS_INTERFERENCE_CHANNEL,
        .ifidx = WIFI_IF_STA,
        .encrypt = false,
        .peer_addr = {0x1a, 0x00, 0x00, 0x00, 0x00, 0x00},
    };

This is necessary because, once the main function finishes execution, the variable will be released, making it inaccessible for subsequent operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants