Layer: Foundation (tutorial) ยท Build flags: -DPROTOCORE_ENABLE_IDEMIP=1 (in build_opt.h)
This sketch runs the idemIP stack on one Wi-Fi station. The station joins one network and takes one static IPv4 address. It then answers ARP requests and pings at that address. The sketch uses no esp_netif and no lwIP. The radio gives each frame to the link, and the stack reads each frame from the link.
Set four values at the top of the sketch: WIFI_SSID, WIFI_PASSWORD, STATION_ADDRESS and STATION_MASK. Flash the sketch, then ping STATION_ADDRESS from a host on the same network.
loop() calls Stack.tick with the clock and a random word. Each call drains the receive ring of the link, sends each reply, and runs the services of idemIP. Once each second, the serial monitor shows the state of the link and the frames that the ticks drained, sent and dropped.
The link has PROTOCORE_RX_BUFFERS receive buffers, each one frame of 1536 bytes. The count is 32 by default and 8 on the classic ESP32. It is in vendor/board_profiles/stack_profile.h.
The feature lives in the library, so its flag must reach the whole build:
(The Arduino IDE reads the flag from build_opt.h beside the sketch automatically.)