Callback on packets received over ethernet on ESP32C6

endi83
Posts: 24
Joined: Wed Nov 22, 2023 2:43 pm

Callback on packets received over ethernet on ESP32C6

Postby endi83 » Fri May 17, 2024 9:41 am

I am working on a project with the aim of testing that the ESP32C6 devices that are manufactured can send and receive packets both by wifi and by ethernet. For this, I am going to have a fixed device that will be the Tester and the other device will be the DUT (Device Under Test), one of the devices that are manufactured to test. I am doing tests with two ESP32C6 that I have available.

I managed to do the wifi test but I encountered a problem with the ethernet one. Both devices have a transparent ethernet bridge between eth1 and eth2. What I do is connect the Tester eth1 with the DUT eth1 using a crossover ethernet cable and the Tester eth2 with DUT 2 eth2 using another crossover ethernet cable.

I send a packet from the Tester using the “esp_eth_transmit” function and I see through Wireshark that the packet continuously travels through the two devices (the transparent bridge is doing it correctly and I am creating an ethernet loop).

Is it possible to somehow make an ethernet callback to be able to see the packets that I am receiving and thus not need the Wireshark and be able to act so that when the Tester has received 10 packets, the communication is cut off and stops sending?

endi83
Posts: 24
Joined: Wed Nov 22, 2023 2:43 pm

Re: Callback on packets received over ethernet on ESP32C6

Postby endi83 » Tue May 21, 2024 11:20 am

At the moment, I have not found a solution, so I have opted to change my strategy when it comes to sending packets.

I have created a socket on the Tester and another socket on the DUT. Through the sockets, I am able to send a packet from the Tester to the DUT and from the DUT see that it has received the packet. However, it is not able to return the packet to the Tester considering that I maintain the transparent bridge configuration between the two ethernets. Therefore, with this strategy, I am not able to verify that the transparent bridge is working correctly.

Current status:
1.- Using the “esp_eth_transmit” function, the packets that I receive through one ethernet port, I send through the other ethernet port (performs transparent bridging) BUT I am not able to operate on the packets that I receive to count them and cut off communication when necessary.
2.- Using sockets, I manage to see the messages that I receive and operate on them BUT I am not able to return these messages automatically through a transparent bridge, so I cannot verify that the transparent bridge is well implemented. Using the send() function, I do return the message via socket, but that’s not what I’m looking for because I need it to do it automatically.

Can anyone please help me?

Thank you

endi83
Posts: 24
Joined: Wed Nov 22, 2023 2:43 pm

Re: Callback on packets received over ethernet on ESP32C6

Postby endi83 » Fri May 24, 2024 9:22 am

Nobody knows how to help me to solve the problem? I'm really stuck :(

DrMickeyLauer
Posts: 168
Joined: Sun May 22, 2022 2:42 pm

Re: Callback on packets received over ethernet on ESP32C6

Postby DrMickeyLauer » Fri May 24, 2024 3:09 pm

Can you flash a dedicated firmware to one of the ESP devices? If so, just configure one as DHCP server and the other ones as DHCP clients. Whenever you receive an IP address, the Ethernet connectivity seems to be ok.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 62 guests