Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jouellnyc/a05fca719dfa10e26a02589a2f83ca5b to your computer and use it in GitHub Desktop.
Save jouellnyc/a05fca719dfa10e26a02589a2f83ca5b to your computer and use it in GitHub Desktop.
###############################################3
# Get MAC Address using Micropython
# Where network_setup.sta_if is the lan object
# See https://stackoverflow.com/questions/71902740/how-to-retrieve-and-format-wifi-mac-address-in-micropython-on-esp32
###############################################3
import ubinascii
import network_setup
print(ubinascii.hexlify(network_setup.sta_if.config('mac'),':').decode().upper())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment