Chat freely about anything...

User avatar
By theThing
#46241
vasimv wrote:I've ran into same problem with Arduino IDE (ESP-12E works but stops sending ARP answers, so everyone on network loses it). To fix this, i'm calling every second function to force send gratuitous ARP announce:

extern "C" {
char *netif_list;
uint8_t etharp_request(char *, char *);
}

void forceARP() {
char *netif = netif_list;

while (netif)
{
etharp_request((netif), (netif+4));
netif = *((char **) netif);
}
}




Hi, i have the exact same issue, arp replies sometimes go missing. In my case is not deterministic. I tried this piece of code to send gratuitous arp every 10 seconds but i'm not smart enough to tweak it to work can you help?



The Arduino IDE throws this errors:

/home/user/.arduino15/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/lib/liblwip.a(netif.o):(.bss+0x0): multiple definition of `netif_list'
sketch/WeMos_NATIVE_WEB_v3.ino.ino.cpp.o:/home/user/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional:2069: first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board WeMos D1 R2 & mini.
User avatar
By martinayotte
#46252 Although I don't know if this code is running fine, to get in compiled, you need to add an "extern" :

Code: Select allextern "C" {
  extern char *netif_list;
  uint8_t etharp_request(char *, char *);
}
User avatar
By theThing
#46282 Thanks so much!! The missing extern worked!

Now my sketch is usable, some minor glitch when connecting from mobile devices that flush arp cache but perfectly usable now!
User avatar
By Akash Ashok
#51326 Hi When i try to refresh ARP ESP8266 crashes

oft WDT reset

ctx: cont
sp: 3fff0180 end: 3fff0410 offset: 01b0

>>>stack>>>
3fff0330: 4021044e 3ffed130 3fff11ac 00000000
3fff0340: 3ffef3d8 00000292 00000292 fffffffc
3fff0350: 00000024 0000002a 3fff1624 401004d8
3fff0360: 40217410 4021746e 3fff1454 40107304
3fff0370: 03030201 40217614 3fff1454 4022c408
3fff0380: 00000002 00000001 00000000 3ffed130
3fff0390: 3fff21cc 4022ef7c 3fff21cc 3fff1624
3fff03a0: 3fffdad0 3fff1657 3fff1624 4022eee9
3fff03b0: 3fff1628 3fff1628 00000000 00000001
3fff03c0: 3fffdad0 3ffef3e4 4020bd90 3ffef3e4
3fff03d0: 3fffdad0 3fff1628 3fff1624 402067bc
3fff03e0: 00000000 00000000 3ffef3dc 40206833
3fff03f0: feefeffe feefeffe 3ffef3dc 4020bddc
3fff0400: feefeffe feefeffe 3ffef3f0 40100718
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,6)

Any idea how what i might be doing wrong?

Here is my code
Code: Select all#include <ArduinoJson.h>

#include "FS.h"

extern "C" {
   extern char *netif_list;
   uint8_t etharp_request(char *, char *);
}

void forceARP() {
   char *netif = netif_list;
   while (netif) {
      etharp_request((netif), (netif + 4));
      netif = ((char *)netif);
   }
}


void setup(void) {
   Serial.begin(115200);

   Serial.println(ESP.getResetInfo());
}



void loop(void) {
   delay(1000);
   forceARP();
}