Skip to content

Does not work with adafruit_esp32spi_socket #27

Closed
@mattdm

Description

@mattdm

I found #16, which seems somewhat ironic. I have the Adafruit matrix portal, but I want to actually use the NTP server on my local network rather than the web API the example code seems to lean on. As a simple test, I'm doing

import adafruit_esp32spi.adafruit_esp32spi_socket as socket

[... wifi setup and stuff ... ]


ntp = adafruit_ntp.NTP(socket)

while True:
    print(ntp.datetime)
    time.sleep(1)

Traceback (most recent call last):
  File "code.py", line 62, in <module>
  File "adafruit_ntp.py", line 77, in datetime
AttributeError: 'socket' object has no attribute '__exit__'\

(Line 62, which triggers the error, is the ntp.datetime call.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions