Repository navigation
Description
Adafruit CircuitPython 10.0.0-alpha.6 on 2025-05-17; Adafruit Feather ESP32S2 with ESP32S2
Reproducer code:
import alarm
import board
import digitalio
import neopixel
from os import getenv
import random
import time
import adafruit_connection_manager
import adafruit_requests
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
import wifi
# On MagTag, enable power to NeoPixels.
# Remove these two lines on boards without board.NEOPIXEL_POWER.
np_power = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
np_power.switch_to_output(value=True)
builtin_led = digitalio.DigitalInOut(board.LED)
builtin_led.switch_to_output(value=True)
status_pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.1, pixel_order=neopixel.GRB, auto_write=True)
status_pixel[0] = 0xff0000
status_pixel[0] = 0xffff00
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("WIFI_SSID")
password = getenv("WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
print("Connecting to %s" % ssid)
wifi.radio.connect(ssid, password)
print("Connected to %s!" % ssid)
pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)
requests = adafruit_requests.Session(pool, ssl_context)
# Initialize an Adafruit IO HTTP API object
io = IO_HTTP(aio_username, aio_key, requests)
status_pixel[0] = 0x00ff00
try:
random_feed = io.get_feed("random")
io.send_data(random_feed["key"], random.randint(0,9999))
except AdafruitIO_RequestError as e:
print(e)
#print("You must create feeds on AdafruitIO for: temperature, humidity, and pressure")
except OSError as e:
print(e)
np_power.value = False
builtin_led.value = False
# Create a an alarm that will trigger 20 seconds from now.
# time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + (5 * 60))
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 60)
# Exit the program, and then deep sleep until the alarm wakes us.
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
# Does not return, so we never get here.
I ran this code on a Feather S2 powered by a 3.7v battery connected to the JST port. After running for "a while" and then unplugging the battery and plugging the feather back in to the computer the flash storage shows signs of corruption.
Most of the times that I've seen it happen it creates a file with a weird four character filename:
The file does not always have the same name, but it is often similar. Here is another one:
One time instead of creating a file like this there were a few characters within the code.py that got corrupted instead leading to syntax error when it tried to run.
After having the corrupted file appear I have been using storage.erase_filesystem() in the REPL to format the flash and get back to a clean state before starting the next trial.
Often times the code seems to keep running seemingly successfully, the neopixel blinks yellow and green during successful wake up / network connect / post data and I've seen that it has continued doing that but after "a while" when I switched to the PC I found the corrupted file.
I tested 9.2.8 and never had the same issue occur. I've also tested 10 alpha 6 with code that only joins the WIFI network and does not POST data, and I did not have the issue occur under that code either.
"a while" seems to be anywhere from a few minutes to an hour or two. On the trials where it did not occur I left them running for 8+ hours and never saw the issue come up.
I will test on USB power from a wall adapter next to try to remove the JST connected battery from the equation.


Activity
FoamyGuy commentedon Jun 2, 2025
Maybe the last 3 characters in the filename are consistent. Looking back at screenshots from when it occurred before I found a third instance with a different filename but only the first character differs between all 3 of them. I believe the other times the file appeared matched this pattern as well but I don't have screenshots of any others.
FoamyGuy commentedon Jun 2, 2025
Just had this issue occur on USB power from a wall adapter instead of battery via JST. This time it repeated one of the prior weird filenames instead of being unique
áy■?FoamyGuy commentedon Jun 4, 2025
I have tested this under 10 alpha 6 with two new variations and neither have gotten corrupted after running several hours each.
http://wifitest.adafruit.com/testwifi/index.htmldhalbert commentedon Jun 4, 2025
Is
Adafruit_IO_HTTPusing https or http?FoamyGuy commentedon Jun 4, 2025
It's using https. https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/blob/d570eebcfd63f7dabf837e2e7d653a06ea0c2ade/adafruit_io/adafruit_io.py#L537
I could start a new trial with it POST'ing to something else that uses https instead of my local http webserver on the same network. Or a GET request that uses https as now I notice the wifi test doesn't
FoamyGuy commentedon Jun 4, 2025
HTTPS being involved is looking like a promising theory. I also think that I've narrowed down to POST specifically, I've yet to see it occur with a GET request, and I did run a test with GET requests to an HTTPS URL for a while.
In my latest test I had this corruption occur with this code that makes a POST to httpbin.org:
I got this corrupted file created while running this script:
Again the same pattern with the final characters of the filename.
This removes Adafruit IO from the equation entirely. It is feeling like somehow this is tied to HTTPS and specifically POST'ing data.
dhalbert commentedon Jul 29, 2025
See a similar report of random overwrites of files in https://forums.adafruit.com/viewtopic.php?t=219390.
dhalbert commentedon Jul 30, 2025
@FoamyGuy have you seen this at all on anything after 10.0.0-alpha.6? https://forums.adafruit.com/viewtopic.php?t=219390 does report file corruption in 10.0.0-beta.0, apparently.
dhalbert commentedon Aug 7, 2025
I have been unable to reproduce this on 10.0.0-beta.2, on a Feather ESP32-S2. I was doing HTTP (not HTTPS) POST's to httpbin.org, and then doing HTTP GET's to a local server. I'm powering it with a power-only USB cable. I don't see stray directory entries. I sped up the sleep a lot so it's waking up after 5 seconds. I believe you saw this, but I'm not sure how to reproduce. This could be some kind of brownout issue with the flash, since there's otherwise no writing of the flash going on. The fact that it's directory entries makes me suspicious it's in the first block of flash.
FoamyGuy commentedon Aug 8, 2025
I updated to
Adafruit CircuitPython 10.0.0-beta.2 on 2025-07-31; Adafruit Feather ESP32S2 with ESP32S2and started up the reproducer script again today and had this corruption happen again.It was running for 2-3 hours powered by a USB C cable connected to a wall adapter before it crashed and then had the corrupted file on the drive when I plugged it in to a computer afterward.
The cable itself supports both data and power, but the wall adapter it is connected to should be power only.
dhalbert commentedon Nov 14, 2026
@FoamyGuy Have you seen this in recent builds? If not I'll close.