I bought 5 more of these, and am seeing the same thing:
Hey folks,
I bought 5 more AdaFruit QT PY #SP32-C3 modules and theyre also not connecting to the network.
Attached is a 4 minute Wireshark capture of all traffic to and from one of the boards running the connect code below:
Code: Select all
import network
import utime
import machine
import neopixel
sta_if = network.WLAN(network.STA_IF)
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
np = neopixel.NeoPixel(machine.Pin(2), 1)
np[0] = (128, 128, 128, 0)
np.write()
def connect():
count = 0
sta_if.active(True)
utime.sleep(0.1) # this could be important, recent posting by robert-hh
# seems more reliable to start with a fresh connect()
if sta_if.isconnected():
sta_if.disconnect()
print (f'started in the connected state, but now disconnected')
else:
print (f'started in the disconnected state')
utime.sleep(0.1) # this could be important
if not sta_if.isconnected():
print (f'connecting to hotspot...')
utime.sleep(0.1)
try:
sta_if.ifconfig((secrets["IPAddress"],secrets["SubnetMask"],secrets["GatewayIP"],secrets["DNSIP"]))
sta_if.connect(secrets["ssid"], secrets["password"])
except OSError as error:
print(error)
while (count < 10):
count += 1
if (sta_if.isconnected()):
count = 0
print (f'network config: {sta_if.ifconfig()}')
break
print (f'. ')
np[0] = (128, 128, 128, 0)
np.write()
utime.sleep(1)
np[0] = (0, 0, 0, 0)
np.write()
utime.sleep(1)
if (count == 10):
try:
with open('errors.txt', 'w') as outfile:
outfile.write('failed to connect after 5 tries' + '\n')
except Exception as e:
pass
disconnect() # or you could get errors
print (f'machine reset')
utime.sleep(0.1)
machine.reset() # start from scratch
rssi = sta_if.status('rssi')
print (f'RSSI = {rssi} dBm')
utime.sleep(0.1)
if ((rssi < -95) or (rssi == 0)):
print (f'signal level is below -95dBm')
utime.sleep(0.1)
disconnect() # or you could get errors
print (f'machine reset')
utime.sleep(0.1)
machine.reset() # start from scratch
def disconnect():
sta_if.disconnect()
sta_if.active(False)
the log:
Code: Select all
machine reset
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x403806e6
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6dc
load:0x403d0000,len:0x28ac
entry 0x403ce000
started in the disconnected state
connecting to hotspot...
.
.
.
.
.
.
.
.
.
.
machine reset
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x403806e6
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6dc
load:0x403d0000,len:0x28ac
entry 0x403ce000
started in the disconnected state
connecting to hotspot...
.
.
.
.
.
.
.
.
.
.
machine reset
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x403806e6
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6dc
load:0x403d0000,len:0x28ac
entry 0x403ce000
started in the disconnected state
connecting to hotspot...
.
.
.
.
.
.
.
.
.
.
machine reset
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x403806e6
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6dc
load:0x403d0000,len:0x28ac
entry 0x403ce000
started in the disconnected state
connecting to hotspot...
.
.
.
.
.
.
.
.
.
.
I am seeing a lot of malformed packets sent by the ESP32:
There is some sort of bug in the stack, and I need to figure out who/how to fix.... OR the antenna on these units is designed badly...
Attached is a pcap (I am using a test network so passwords in this stuff dont matter):
PCAP:
https://github.com/micropython/micropyt ... e.pcap.zip
The ESP and the access point are about 7 feet apart.
This is a copy of
https://github.com/micropython/micropyt ... ions/10524