#Adafruit ESP32-S3 Feather Question

1 messages · Page 1 of 1 (latest)

drifting path
#

I am trying to move an application from an RP2040 Feather to the ESP32-S3 for power reasons. My application uses email, I can not figure out how to initialize the ESP32 Pins (esp32_cs , esp32_ready, esp32_reset) for ESP32 as these pins are not supported in Board, What am I missing? Thanks Steve Schaefer

limpid ginkgo
#

you don't define pins, the microcontroller is an ESP32 already, it uses native wifi

#

how do you use email ? are you using a library for that ?

drifting path
#

The old system created a socket, then did udpsock.send, creating a socket required the esp to be defined. If there is a better way I am open to it. If there is a guide or example I have missed that I should follow please let me know. Thanks

limpid ginkgo
#

yeah you are not using an external wifi chip here, the builtin wifi uses another API

#

let me see if I can find some low level example code

drifting path
#

Ok great, thanks I will look at this approach. Greatly appreciate it.

limpid ginkgo
#

that's a standalone example that does NTP with UDP

import struct
import time
import rtc
import socketpool
import wifi
from secrets import secrets

TZ_OFFSET = 3600
NTP_TO_UNIX_EPOCH = 2_208_988_800  # 1970-01-01 00:00:00
BILLION = 1_000_000_000

wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
pool = socketpool.SocketPool(wifi.radio)
packet = bytearray(48)
packet[0] = 0b00100011

for i in range(1, len(packet)):
    packet[i] = 0

with pool.socket(pool.AF_INET, pool.SOCK_DGRAM) as sock:
    sock.sendto(packet, ("pool.ntp.org", 123))
    sock.settimeout(None)
    sock.recv_into(packet)
    destination = time.monotonic_ns()

print(packet)

seconds = struct.unpack_from("!I", packet, offset=len(packet) - 8)[0]
monotonic_start = seconds - NTP_TO_UNIX_EPOCH - (destination // BILLION)

localTime = time.localtime(time.monotonic_ns() // BILLION + monotonic_start + TZ_OFFSET)
rtc.RTC().datetime = localTime

print(localTime)
drifting path
#

This put me in the right path, conversion in process. Thanks much

drifting path
#

Another ESP32-S3 question

https://circuitpython.org/board/adafruit_feather_esp32s3_nopsram/

From the link above, LiPoly battery monitor - LC709203 chip actively monitors your battery for voltage and state of charge / percentage reporting over I2C. I can't seem to get the I2C to find the module, running the scan i2c addresses show that there is something at 0xb however, I2C says it is empty.

I don't know if I am doing something completely wrong OR I found a hardware or software bug . Current circuit python version using adafruit-circuitpython-bundle-7.x-mpy-20220522
adafruit-circuitpython-adafruit_feather_esp32s3_nopsram-en_US-7.3.0-rc.2.uf2 Code and output detail in attached file. Thanks for your assistance.
Steve Schaefer