adafruit / Adafruit_Wippersnapper_Arduino

WipperSnapper is a firmware for creating no-code IoT electronics projects.
https://io.adafruit.com/welcome
MIT License
29 stars 44 forks source link

qt py loses secrets.json when battery goes down #621

Open migs35323 opened 3 weeks ago

migs35323 commented 3 weeks ago

Describe the bug

my qt-py s3 randomly loses the secrets.json credentials. when battery power goes out/down i had noticed this issue in firmware beta .88 and right now i was testing with alpha .89 and same behavior I usually power it through usb but i had been testing battery endurance, so i had been letting the battery go out on purpose.

as a side note, I once had the yellow light and boot out telling me the credentials where wrong, when i opened them in notepad/vscode, the file was correct. but i had to delete the file and recreate it to accept the credentials, however i can't seem to reproduce this again. in this last behavior the only thing that comes to my mind, is there any sensitivity between LF and CRLF in the file? maybe i edited the file in windows and mixed it in ubuntu and WipperSnapper is not liking it...

Arduino board qt-py s3 psram version aka qtpy-esp32s3-n4r2

To Reproduce Steps to reproduce the behavior:

  1. setup qt py with battery and best friend
  2. let it run out of battery
  3. when plugging it again it shows yellow light, boot.out warns about credentials, secrets.json is back to stock again. PS: this doesn't happen every time, but about 2 out of 3 times it's not 100% consistent

Expected behavior secrets,json to not be erased, or maybe turn it into a toggeable feature where we can choose the secrets to be erased as security feature lol

Which components are connected to your device qt py s3 (psram version) with battery best friend attached + 2 adafruit temperature sensors connected with stemma qt,

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

brentru commented 3 weeks ago

@tyeth Do you have cycles available to look at this bug?

migs35323 commented 3 weeks ago

@tyeth Do you have cycles available to look at this bug?

what do you mean by cycles? battery cycles?

brentru commented 3 weeks ago

@migs35323 Tyeth is an Adafruit engineer who works on WipperSnapper with me.

To clarify - I'm using "cycles" instead of "time", so I'm asking him if he has time to look at this or if I should.

tyeth commented 3 weeks ago

👋 I've been running with shorter cycles myself this week, medical issue, so likely to have a look around the middle of next week (once BFF arrives). It's possible that using a mix of line endings might be considered corrupt and it self formatting. At the same time I have seen similar behaviour before. Will report back.

tyeth commented 2 weeks ago

Hardware just arrived, will setup a test. Not that it should matter, but please comment as to which sensors you have attached to the StemmaQT port, and which kind of battery

tyeth commented 2 weeks ago

I've run it yesterday and this morning to the point where the battery cuts out (just below 2.9v), repeatedly, and not yet seen the secrets corruption. I've got three I2C devices connected: an LPS22 temp+pressure, an sht3x temp+humidity sensor, and a max17048 i2c lipo fuel gauge which the battery is connected via. I'm using the usb isolator to get the 5v line disconnected and avoid charging the battery unless desired. It's a 340maH 3.7v lithium polymer cell with protection.

On Thu, 22 Aug 2024, 21:42 Brent Rubell, @.***> wrote:

@migs35323 https://github.com/migs35323 Tyeth is an Adafruit engineer who works on WipperSnapper with me.

To clarify - I'm using "cycles" instead of "time", so I'm asking him if he has time to look at this or if I should.

— Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/issues/621#issuecomment-2305597352, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTBZ43ABV74QXGRNKEKIWDZSZEMVAVCNFSM6AAAAABM63PAIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBVGU4TOMZVGI . You are receiving this because you were mentioned.Message ID: @.***>

migs35323 commented 2 weeks ago

Hardware just arrived, will setup a test. Not that it should matter, but please comment as to which sensors you have attached to the StemmaQT port, and which kind of battery

it's a pimoroni galleon battery (really love that one, it has a plastic shell so it doesn't freak me that i might pierce it with a header pin by accident and burn my house down lol) i usually have some sensors like the tmp117, SHT45 and now MCP9808, i noticed it doesn't matter which ones i have..

I also have it connected usually to my raspberry pi 4 usb port as a power source, its a data cable but the rpi has no auto mount enabled (its acting as a server) but i noticed it doesn't matter as well, happens no matter where i power it

i noticed that the file basiscally reverts to "insert credentials" so it doesn't get like blank or have some weird characters, i edit it, save it, the qt py s3 connects to ada io, but when power goes out, i connect it to a usb port and YELLOW LIGHT, file reverts back to original "PLS FILL ME" state