diff --git a/adafruit_esp32spi/adafruit_esp32spi.py b/adafruit_esp32spi/adafruit_esp32spi.py old mode 100644 new mode 100755 index 3e16df0..4d0d389 --- a/adafruit_esp32spi/adafruit_esp32spi.py +++ b/adafruit_esp32spi/adafruit_esp32spi.py @@ -339,6 +339,16 @@ def MAC_address(self): # pylint: disable=invalid-name resp = self._send_command_get_response(_GET_MACADDR_CMD, [b'\xFF']) return resp[0] + @property + def MAC_address_actual(self): # pylint: disable=invalid-name + """A bytearray containing the actual MAC address of the ESP32""" + if self._debug: + print("MAC address") + resp = self._send_command_get_response(_GET_MACADDR_CMD, [b'\xFF']) + new_resp = bytearray(resp[0]) + new_resp = reversed(new_resp) + return new_resp + def start_scan_networks(self): """Begin a scan of visible access points. Follow up with a call to 'get_scan_networks' for response""" diff --git a/examples/server/esp32spi_wsgiserver.py b/examples/server/esp32spi_wsgiserver.py old mode 100644 new mode 100755 index a247c77..0f7fcdb --- a/examples/server/esp32spi_wsgiserver.py +++ b/examples/server/esp32spi_wsgiserver.py @@ -39,6 +39,9 @@ spi = busio.SPI(board.SCK, board.MOSI, board.MISO) esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset) # pylint: disable=line-too-long +print("MAC addr:", [hex(i) for i in esp.MAC_address]) +print("MAC addr actual:", [hex(i) for i in esp.MAC_address_actual]) + """Use below for Most Boards""" status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards """Uncomment below for ItsyBitsy M4""" @@ -213,3 +216,4 @@ def led_color(environ): # pylint: disable=unused-argument print("Failed to update server, restarting ESP32\n", e) wifi.reset() continue + \ No newline at end of file