Adafruit CircuitPython 9.1.0-beta.1 on 2024-04-19; Adafruit Camera with ESP32S3
If the pycam = adafruilt_pycamera.PyCamera() line is commented out from the code.py file below the code runs fine, however when the line is included the io.get_feed("camera") statement fails with a "Name or service not known" error.
import os
import adafruit_pycamera
import wifi
import adafruit_requests
import adafruit_connection_manager
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
# Initialize memento camera
pycam = adafruit_pycamera.PyCamera()
print(f"Connecting to {os.getenv('CIRCUITPY_WIFI_SSID')}")
wifi.radio.connect(
os.getenv("CIRCUITPY_WIFI_SSID"), os.getenv("CIRCUITPY_WIFI_PASSWORD")
)
print(f"Connected to {os.getenv('CIRCUITPY_WIFI_SSID')}!")
pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
requests = adafruit_requests.Session(pool, adafruit_connection_manager.get_radio_ssl_context(wifi.radio))
# Initialize an Adafruit IO HTTP API object
aio_username = os.getenv("ADAFRUIT_AIO_USERNAME")
aio_key = os.getenv("ADAFRUIT_AIO_KEY")
io = IO_HTTP(os.getenv("ADAFRUIT_AIO_USERNAME"), os.getenv("ADAFRUIT_AIO_KEY"), requests)
# Adafruit IO feed configuration
# Get the 'camera' feed from Adafruit IO
feed_camera = io.get_feed("camera")
Error Output:
code.py output:
Found AW9523
reset camera
Initializing camera
Found camera OV5640 (240 x 176) at I2C address 3c
colors 16777215
colors 16777215
/lib/adafruit_pycamera/ov5640_autofocus.bin
init done @ 2.86206
sdcard init @ 2.9209
mount vfs @ 3.03101
Connecting to twilightzone
Connected to twilightzone!
Traceback (most recent call last):
File "code.py", line 28, in <module>
File "adafruit_io/adafruit_io.py", line 748, in get_feed
File "adafruit_io/adafruit_io.py", line 578, in _get
File "adafruit_requests.py", line 591, in get
File "adafruit_requests.py", line 525, in request
File "adafruit_connection_manager.py", line 321, in get_socket
gaierror: (-2, 'Name or service not known')
This isn't a Pycamera library issue, I just reproduced it using espcamera directly. I'm going to do a little more testing and either open a support ticket or an issue on the core.
Adafruit CircuitPython 9.1.0-beta.1 on 2024-04-19; Adafruit Camera with ESP32S3
If the
pycam = adafruilt_pycamera.PyCamera()
line is commented out from the code.py file below the code runs fine, however when the line is included theio.get_feed("camera")
statement fails with a "Name or service not known" error.Error Output: