So I was pleasantly surprised to see that mDNS support was enabled somewhere last month. But I didn't see an example how to use it.
After fiddling around I came up with this script that prints the mDNS name of the pyboard. You can then ping it on the local network via this name. Basically the mDNS name is hardcoded and starts with PYBD followed by the last 4 digits of the mac.
Code: Select all
import binascii
import network
wl = network.WLAN()
wl.active(1)
wl.config(antenna=0)
wl.connect('xxxx', 'yyy')
mac = wl.config('mac')
last = binascii.hexlify(mac)[-4:].decode("ascii")
print("ping me on PYBD{}.local".format(last))
A bit of a pity that the name can't be changed during operation. That would have allowed to use more meaningful names...