LAN Module: Reading RAW-packets

  • Hello everyone!

    I would like to use an M5Stack (ESP32) with LAN module (w5500)
    to read CDP (Cisco Discovery Protocol) packages.

    Working examples of M5Stack (ESP32) with LAN module (w5500) all using Layer3 and 4 (IP+TCP or IP+UDP).

    However, CDP works on Layer2 like pure ARP broadcasts.
    To do this, you probably have to open a socket in MAC RAW Mode.

    Examples that use the W5x00 in this mode can only be found on
    Atmega base. In addition, there is a huge mess of Ethernet libraries for
    Arduino. Incompatibilities with certain Arduino IDE versions.
    Libraries that don't know all the commands I use in the Atmega examples. Etc...

    The first goal for me now would be to receive all packets as raw data,
    or packets sent to the Ethernet multicast address (01-00-0C-CC-CC-CC).

    Can someone help me, with an excample Code that works on m5?

  • I got it!

    Some changes needed:

    replace "mr" with "mra"
    replace "MR" with "MRA". MR or mr is already in use from the esp-library

    replace Wiznet5500 w5500; --> Wiznet5500 w5500(26);

    Thank you for reading!

  • hi,

    i want to make a lldp sniffer with my m5stack core + batterie module and lan module

    is your research avancing and would you be willing to help a fellow m5stack-man ?