#Adafruit ESP32-S3 Feather Question
1 messages · Page 1 of 1 (latest)
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 ?
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
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
the basic is that you use the socketpool module to get you sockets and the ssl module to wrap them for SSL
https://docs.circuitpython.org/en/latest/shared-bindings/socketpool/index.html
https://docs.circuitpython.org/en/latest/shared-bindings/ssl/index.html
Ok great, thanks I will look at this approach. Greatly appreciate it.
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)
This put me in the right path, conversion in process. Thanks much
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