eth / wifi bridge example

maxzen
Posts: 15
Joined: Fri Jun 08, 2018 11:56 am

eth / wifi bridge example

Postby maxzen » Thu Sep 06, 2018 10:27 am

Hello all

I am looking at eth2wifi example that I found here

I have some questions about it
  • when the first eth packed is received, they start wifi and set its mac address to the mac address of the sender. Why?
  • when a station connects to espAP, they register a callback: this is done for every connection. How the callback is tied to the station? Can I start wifi and immediately register the callback?
  • inside the wifi callback they send the packet to eth, but when a packet comes from eth, they send a message to a queue where a task is waiting for, and then this task trasmit the packet to wifi. Why the task does not serve both interfaces ?
  • a packet from eth is sent to wifi without the last four bytes, but a packet from wifi is sent completely. What are the last bytes?
I would like to start from the example and add a lwip interface so that esp can serve tcp/udp connections

maxzen
Posts: 15
Joined: Fri Jun 08, 2018 11:56 am

Re: eth / wifi bridge example

Postby maxzen » Thu Sep 13, 2018 7:49 am

can anyone help me?

maxzen
Posts: 15
Joined: Fri Jun 08, 2018 11:56 am

Re: eth / wifi bridge example

Postby maxzen » Fri Sep 21, 2018 11:40 am

Going on with the bridge example, I added a lwip netif + dchp client || dhcp server + echo server and all is running

What does not work is mdns, looking at the code it does:

Code: Select all

    for (i=0; i<TCPIP_ADAPTER_IF_MAX; i++) {
        if (!tcpip_adapter_get_ip6_linklocal(i, &tmp_addr6) && !_ipv6_address_is_zero(tmp_addr6)) {
            _mdns_enable_pcb(i, MDNS_IP_PROTOCOL_V6);
        }
        if (!tcpip_adapter_get_ip_info(i, &if_ip_info) && if_ip_info.ip.addr) {
            _mdns_enable_pcb(i, MDNS_IP_PROTOCOL_V4);
        }
    }
So it will never use my interface.

I found also this:

Code: Select all

esp_err_t tcpip_adapter_get_netif(tcpip_adapter_if_t tcpip_if, void ** netif);
Can I reuse an existing interface?

Who is online

Users browsing this forum: Google [Bot] and 110 guests