ESPythoNOW icon indicating copy to clipboard operation
ESPythoNOW copied to clipboard

Fixed issue n3: no member "get_if_raw_hwaddr"

Open TechTheGuy opened this issue 1 year ago • 2 comments

Here's the pull request I was referring to in issue n3: The code sends the packets (I checked with Wireshark). The problem is that my esp8266 doesn't receive them for some reason... I don't know what to think... I mean, the code at least runs now. Thanks

TechTheGuy avatar Oct 12 '24 21:10 TechTheGuy

Can you check with scapy version 2.5.0? This yields an error for me

raise Scapy_Exception("Unsupported address family (%i) for interface [%s]" % (addrfamily, iff))  # noqa: E501
scapy.error.Scapy_Exception: Unsupported address family (803) for interface [*interface*]

ChuckMash avatar Oct 24 '24 03:10 ChuckMash

Ah, The issue for me with this is after my interface is put into monitor mode, the previous error occurs. If I skip prep.sh then it works correctly, but then scapy cannot do what we need it to do.

I suggest the following try except for the time being.

  def hw_mac_as_str(self, interface):
    try:
      return scapy.get_if_hwaddr(interface).upper()
    except:
      return ("%02X:" * 6)[:-1] % tuple(scapy.orb(x) for x in scapy.get_if_raw_hwaddr(self.l2_socket.iface)[1])

If that works for you, please update the PR with this and I will approve it.

ChuckMash avatar Oct 24 '24 04:10 ChuckMash