Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed MAC reverse byte order issue within the ESP32SPI library as it … #66

Merged
merged 5 commits into from Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion adafruit_esp32spi/adafruit_esp32spi.py 100644 → 100755
Expand Up @@ -337,7 +337,9 @@ def MAC_address(self): # pylint: disable=invalid-name
if self._debug:
print("MAC address")
resp = self._send_command_get_response(_GET_MACADDR_CMD, [b'\xFF'])
return resp[0]
new_resp = bytearray(resp[0])
ladyada marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down Expand Up @@ -760,3 +762,4 @@ def set_analog_write(self, pin, analog_value):
((pin,), (value,)))
if resp[0][0] != 1:
raise RuntimeError("Failed to write to pin")

3 changes: 3 additions & 0 deletions examples/server/esp32spi_wsgiserver.py 100644 → 100755
Expand Up @@ -39,6 +39,8 @@
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])

"""Use below for Most Boards"""
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
Expand Down Expand Up @@ -213,3 +215,4 @@ def led_color(environ): # pylint: disable=unused-argument
print("Failed to update server, restarting ESP32\n", e)
wifi.reset()
continue