Guide I'm following: https://learn.adafruit.com/welcome-to-a ... o/overview
I got the quote example to work and get time.
I am running circuitpyton 7.x on feather ESP32 S3
********************************
Code: Select all
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# adafruit_circuitpython_adafruitio usage with a CPython socket
import socket
import ssl
from random import randint
import adafruit_requests
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and
# "password" keys with your WiFi credentials. DO NOT share that file or commit it into Git or other
# source control.
# pylint: disable=no-name-in-module,wrong-import-order
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# Set your Adafruit IO Username and Key in secrets.py
# (visit io.adafruit.com if you need to create an account,
# or if you need your Adafruit IO key.)
aio_username = secrets["aio_username"]
aio_key = secrets["aio_key"]
requests = adafruit_requests.Session(socket, ssl.create_default_context())
# Initialize an Adafruit IO HTTP API object
io = IO_HTTP(aio_username, aio_key, requests)
try:
# Get the 'temperature' feed from Adafruit IO
temperature_feed = io.get_feed("temperature")
except AdafruitIO_RequestError:
# If no 'temperature' feed exists, create one
temperature_feed = io.create_new_feed("temperature")
# Send random integer values to the feed
random_value = randint(0, 50)
print("Sending {0} to temperature feed...".format(random_value))
io.send_data(temperature_feed["key"], random_value)
print("Data sent!")
# Retrieve data value from the feed
print("Retrieving data from temperature feed...")
received_data = io.receive_data(temperature_feed["key"])
print("Data from temperature feed: ", received_data["value"])
Guide I'm following: https://learn.adafruit.com/welcome-to-a ... o/overview
I got the quote example to work and get time.
I am running circuitpyton 7.x on feather ESP32 S3
********************************
Similar error on CS in
Other IOT codes like this feed example :
Code: Select all
# Feed to iot example not running 7-3-2022
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# Adafruit IO HTTP API - Feed Interactions
# Documentation: https://io.adafruit.com/api/docs/#feeds
# adafruit_circuitpython_adafruitio with an esp32spi_socket
import board
import busio
from digitalio import DigitalInOut
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
from adafruit_esp32spi import adafruit_esp32spi
import adafruit_requests as requests
from adafruit_io.adafruit_io import IO_HTTP
# Add a secrets.py to your filesystem that
# has a dictionary called secrets with "ssid" and
# "password" keys with your WiFi credentials.
# DO NOT share that file or commit it into Git or other
# source control.
# pylint: disable=no-name-in-module,wrong-import-order
# pylint: disable=no-name-in-module,wrong-import-order
print("completed imports")
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# If you are using a board with pre-defined ESP32 Pins:
esp32_cs = DigitalInOut(board.ESP_CS)
esp32_ready = DigitalInOut(board.ESP_BUSY)
esp32_reset = DigitalInOut(board.ESP_RESET)
# If you have an externally connected ESP32:
# esp32_cs = DigitalInOut(board.D9)
# esp32_ready = DigitalInOut(board.D10)
# esp32_reset = DigitalInOut(board.D5)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
print("Connecting to AP...")
while not esp.is_connected:
try:
esp.connect_AP(secrets["ssid"], secrets["password"])
except RuntimeError as e:
print("could not connect to AP, retrying: ", e)
continue
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)
socket.set_interface(esp)
requests.set_socket(socket, esp)
# Set your Adafruit IO Username and Key in secrets.py
# (visit io.adafruit.com if you need to create an account,
# or if you need your Adafruit IO key.)
aio_username = secrets["aio_username"]
aio_key = secrets["aio_key"]
# Initialize an Adafruit IO HTTP API object
io = IO_HTTP(aio_username, aio_key, requests)
# Create a new 'circuitpython' feed with a description
print("Creating new Adafruit IO feed...")
feed = io.create_new_feed("circuitpython", "a Adafruit IO CircuitPython feed")
# List a specified feed
# print("Retrieving new Adafruit IO feed...")
# specified_feed = io.get_feed("circuitpython")
print("specified_feed")
# Delete a specified feed by feed key
# print("Deleting feed...")
# io.delete_feed(specified_feed["key"])
print("done")
These give same error for CS_ using either the external or internal board versions. I can not determine which individual pins to try to define for S3 board usage. I will need I2C for intended pressure sensor project. https://learn.adafruit.com/lps35hw-wate ... ure-sensor. Help is greatly appreciated as I am at max frustration level currently.