Chat freely about anything...

User avatar
By kingfisher
#2360 Ok, I found the issue.
it only happens when it's connected to my Fritz.box 7270 router.
when I connect to another router it works just fine (with some delays actually)
as workaround for the fritz I periodically send ARP broadcast
Code: Select all
extern struct netif *netif_list;

struct netif *netif = netif_list;
   while (netif)
   {
      struct pbuf *q = pbuf_alloc(PBUF_RAW, 60, PBUF_RAM);
      if (q != NULL) {
         struct eth_hdr *ethhdr = (struct eth_hdr *)q->payload;
         struct etharp_hdr *hdr = (struct etharp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);

         os_memcpy(&ethhdr->src, netif->hwaddr, 6);
         os_memset(&ethhdr->dest, 0xff, 6);//broadcast

         os_memcpy(&hdr->shwaddr, netif->hwaddr, 6);
         os_memset(&hdr->dhwaddr, 0, 6);

         IPADDR2_COPY(&hdr->sipaddr, &netif->ip_addr);
         IPADDR2_COPY(&hdr->dipaddr, &netif->ip_addr);
         hdr->hwtype = PP_HTONS(1); //HWTYPE_ETHERNET
         hdr->proto = PP_HTONS(ETHTYPE_IP);
         /* set hwlen and protolen */
         hdr->hwlen = ETHARP_HWADDR_LEN;
         hdr->protolen = sizeof(ip_addr_t);
         hdr->opcode = htons(1);
         ethhdr->type = PP_HTONS(ETHTYPE_ARP);
      }
      else {
         LWIP_ASSERT("q != NULL", q != NULL);
      }

      netif->linkoutput(netif, q);
      pbuf_free(q);
      netif = netif->next;
   }
User avatar
By uriy
#2426 It seems in my case esp8266 also has troubles with router.
I'm using old DLINK DIR-300.
I tried to connect directly to module.
Ping time is just 5ms!
It's much better.
I am playing with http server on host MCU.
It works very strange, I have a lot of troubles when module connected to router.
When I am connected directly to module I have not troubles.
kingfisher, are you able to release firmware to upgrade modules?
User avatar
By kingfisher
#3258 it seems the ARP (or better broadcast) deaf ESP is related to some authentication packet, using wlan sniffer the problem occurs ad soon as those packet are handled
Code: Select all111   12:08:40.246544   Avm_xxxxxxx   Espressi_98:72:c9   EAPOL   179   Key (Group Message 1 of 2)
114   12:08:40.252149   Espressi_98:72:c9   Avm_xxxxx   EAPOL   131   Key (Group Message 2 of 2)

just to say...
I cannot find any workaround for that.
one good point could be to use wifi_set_promiscuous_rx_cb and wifi_promiscuous_enable and reset the connection as soon as such a packet is received
but it looks like they work only if set in user_init() and if set they prevent from connecting to the AP.