<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5stack Tough Mac Address]]></title><description><![CDATA[<p dir="auto">Hi,<br />
Is there anyway to get the WiFi Mac Address for an M5stack Tough via the M5BlockMaker. I need a unique ID for the device to write in a Database.<br />
I tried some code but always gets the devices hanging and not responding, the latest was:</p>
<p dir="auto">import ubinascii<br />
import network<br />
ubinascii.hexlify(network.WLAN(network.STA_IF)).decode()</p>
<p dir="auto">The above was obtained from: <a href="https://stackoverflow.com/questions/71902740/how-to-retrieve-and-format-wifi-mac-address-in-micropython-on-esp32" target="_blank" rel="noopener noreferrer nofollow ugc">link text</a></p>
<p dir="auto">Thanks in advance</p>
]]></description><link>https://community.m5stack.com/topic/5247/m5stack-tough-mac-address</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 12:37:37 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5247.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Apr 2023 08:31:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5stack Tough Mac Address on Thu, 27 Apr 2023 20:07:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> .<br />
Thanks for the reply. I think I got the solution the same time you sent me yours. I did use the code in <a href="https://stackoverflow.com/questions/71902740/how-to-retrieve-and-format-wifi-mac-address-in-micropython-on-esp32" target="_blank" rel="noopener noreferrer nofollow ugc">here</a> as below:</p>
<p dir="auto">I did an 'Execute' Block:</p>
<pre><code> import ubinascii
 import network
 wlan_sta = network.WLAN(network.STA_IF)
 wlan_sta.active(True)
 wlan_mac = wlan_sta.config('mac')
 wlan_mac=ubinascii.hexlify(wlan_mac).decode().upper()
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1682625962466-76e881c1-37df-4e5b-94f1-c33c0da572aa-image.png" alt="0_1682625965698_76e881c1-37df-4e5b-94f1-c33c0da572aa-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">then a Label Block:</p>
<pre><code>wlan_mac
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1682626003960-147bf674-2e3a-4ea5-84fc-41c072d1ce42-image.png" alt="0_1682626008432_147bf674-2e3a-4ea5-84fc-41c072d1ce42-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Anyway, thanks for taking the time and effort to reply.<br />
Rami</p>
]]></description><link>https://community.m5stack.com/post/20694</link><guid isPermaLink="true">https://community.m5stack.com/post/20694</guid><dc:creator><![CDATA[RASBR]]></dc:creator><pubDate>Thu, 27 Apr 2023 20:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to M5stack Tough Mac Address on Wed, 26 Apr 2023 18:30:53 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/rasbr" aria-label="Profile: RASBR">@<bdi>RASBR</bdi></a></p>
<p dir="auto">try something like below. Works for me.</p>
<pre><code>import network
import binascii

label0 = M5Label('label0', x=13, y=16, color=0x000, font=FONT_MONT_22, parent=None)
wlan = network.WLAN(network.STA_IF)
mac_bytes = wlan.config('mac')
mac_str = binascii.hexlify(mac_bytes).decode()
label0.set_text(mac_str)
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/20684</link><guid isPermaLink="true">https://community.m5stack.com/post/20684</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 26 Apr 2023 18:30:53 GMT</pubDate></item></channel></rss>