Phambili-Tech / Newt_Display

An Arduino library for the Phambili Newt - a low power smart display
Other
57 stars 7 forks source link

Loop of Death #48

Open darianbjohnson opened 1 year ago

darianbjohnson commented 1 year ago

Newt will occasionally become caught in a loop at start up - which can only be resolved with a manual upgrade. Not exactly sure why this is happening, or how to fix it.

BlitzCityDIY commented 1 year ago

hihi @darianbjohnson ! I've recently run into this with my Newt and have tried a manual upgrade but it hasn't seemed to take. It did not show up as a USB drive so I used the esp webtool, shows that it wrote the firmware .bin but after resetting it just shows the boot title screen and does not advance. Are there any other troubleshooting tips for this issue?

darianbjohnson commented 1 year ago

Hey @BlitzCityDIY! I've been pulling my hair out on this issue - it's been really hard to figure out why this occurs (it seems to happen randomly, only happens for a subset of users, and doesn't "fix" itself). Anyway, I should have some ideas on why this is happening (and a fix/work around) in the next 10 days.

BlitzCityDIY commented 1 year ago

@darianbjohnson sorry to hear that! if there's any testing you'd like me to try since i have the issue feel free to ping me.

darianbjohnson commented 1 year ago

Hey @gshafer and @BlitzCityDIY - can you

  1. download and perform a manual install using this version (https://phambili-pub.s3.amazonaws.com/Newt_Troubleshooting.1.1.3.bin)
  2. Record the boot process to video and send it to me (or you can post here).

Basically, I've modded the base code to (a) delete an old files stored in SPIFFS and (b) write status messages to the screen. I'll then use those status messages to continue to narrow in on the problem.

Thanks

BlitzCityDIY commented 1 year ago

hihi @darianbjohnson - thanks! i uploaded that firmware using the esp webtool. This is what was shown in the REPL:

Connecting...
Connected successfully.
Try hard reset.
Chip type ESP32-S2
Connected to ESP32-S2
MAC Address: 7C:DF:A1:44:B2:0C
Uploading stub...
Running stub...
Stub is now running...
Detecting Flash Size
FlashId: 0x164020
Flash Manufacturer: 20
Flash Device: 4016
Auto-detected Flash size: 4MB
Image header, Magic=0xE9, FlashMode=0x02, FlashSizeFreq=0x2F
Writing data with filesize: 1221824
Erase size 1221824, blocks 75, block size 0x4000, offset 0x0000, encrypted no
Took 16782ms to write 1221824 bytes
Erase size 0, blocks 0, block size 0x4000, offset 0x0000, encrypted no
To run the new firmware, please reset your device.
[Object.debug:187] Finished read loop

Unfortunately nothing showed up on the screen and in general nothing is showing on the screen.

darianbjohnson commented 1 year ago

hmmm ok @BlitzCityDIY - I think I know the problem; here's what you need to do:

  1. Download the Troubleshooter zip folder - https://phambili-pub.s3.amazonaws.com/Troublershooter_files.zip
  2. Unzip and open the "Trouble_files_1_1_3_web_flasher" folder
  3. Using the https://nabucasa.github.io/esp-web-flasher/ tool a. Erase the flash b. Set "Newt_TRBL_113_bootloader.bin" to install to 0x1000 c. Set "Newt_TRBL_113_partitions.bin" to install to 0x8000 d. Set "Newt_TRBL_113.bin" to install to 0x10000 e. Click Program f. Once the files are uploaded, push the reset button on Newt
  4. Note: Newt will not work yet, but a USB drive with FIRMWARE.BIN should show up
  5. Drag "Newt_TRBL_FINAL_113.bin" (up one level from the webloader files) to the USB drive
  6. After it loads, you should see Newt boot up (note - it will ask you to set up a Wifi connection - use your phone to set up the wifi manager).

Ok - after all of that, you should see messages print to screen. Let me know what the messages say (taking a video might be easier)

darianbjohnson commented 1 year ago

And @BlitzCityDIY - THANK YOU for your help and patience

gshafer commented 1 year ago

Darian,

I was away so did not get a chance to try this.

Do you still want me to do this or did you get enough info from the other person working on this?

…..George

From: Darian Johnson @.> Date: Tuesday, October 25, 2022 at 12:10 AM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

And @BlitzCityDIYhttps://github.com/BlitzCityDIY - THANK YOU for your help and patience

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1289950234, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNVNQIFMBK2W7RVWGRDWE5MSXANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

BlitzCityDIY commented 1 year ago

@darianbjohnson thank you so much! that worked! it's back up and running 😺 in case it's helpful, here is the readout from the webtool after successfully flashing:

ESP Web Flasher loaded.
Connecting...
Connected successfully.
Try hard reset.
Chip type ESP32-S2
Connected to ESP32-S2
MAC Address: 7C:DF:A1:44:B2:0C
Uploading stub...
Running stub...
Stub is now running...
Detecting Flash Size
FlashId: 0x164020
Flash Manufacturer: 20
Flash Device: 4016
Auto-detected Flash size: 4MB
Erasing flash memory. Please wait...
Finished. Took 16934ms to erase.
Image header, Magic=0xE9, FlashMode=0x02, FlashSizeFreq=0x2F
Writing data with filesize: 14624
Erase size 14624, blocks 1, block size 0x4000, offset 0x1000, encrypted no
Took 143ms to write 14624 bytes
Erase size 0, blocks 0, block size 0x4000, offset 0x0000, encrypted no
Image header, Magic=0xAA, FlashMode=0x01, FlashSizeFreq=0x02
Writing data with filesize: 3072
Erase size 3072, blocks 1, block size 0x4000, offset 0x8000, encrypted no
Took 129ms to write 3072 bytes
Erase size 0, blocks 0, block size 0x4000, offset 0x0000, encrypted no
Image header, Magic=0xE9, FlashMode=0x02, FlashSizeFreq=0x2F
Writing data with filesize: 1244848
Erase size 1244848, blocks 76, block size 0x4000, offset 0x10000, encrypted no
Took 16864ms to write 1244848 bytes
Erase size 0, blocks 0, block size 0x4000, offset 0x0000, encrypted no
To run the new firmware, please reset your device.
[Object.debug:187] Finished read loop

thank you so so much for your work on this!

darianbjohnson commented 1 year ago

@BlitzCityDIY that's great. Ok.. so the version you are running now will probably toss some weird text to screen periodically (It's a testing/troublehooting version of the code); I'll get an official release pushed out this weekend which should have the fixes.

@gshafer - Give me until the weekend, then I'll you to do a manual install (drag and drop)... which should fix your issue as well.

darianbjohnson commented 1 year ago

I've uploaded v 1.1,4-RC - which incorporates some of the changes I've made to fix the issues. @gshafer - can you do a manual install of this version, and let me know if that works for your Newts?

https://phambili-pub.s3.amazonaws.com/Newt-1.1.4-RC1.bin

gshafer commented 1 year ago

I downloaded the .bin. I plugged in the Newt and hit the reset button. It appeared as a drive. It continues to cycle. I tried deleting the .bin on Newt with no luck. I tried copying over the .bin but it would not copy. Is there some process I am missing?

From: Darian Johnson @.> Date: Saturday, November 12, 2022 at 11:13 AM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

I've uploaded v 1.1,4-RC - which incorporates some of the changes I've made to fix the issues. @gshaferhttps://github.com/gshafer - can you do a manual install of this version, and let me know if that works for your Newts?

https://phambili-pub.s3.amazonaws.com/Newt-1.1.4-RC1.bin

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1312517941, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNQBPTCJZTWYTXKZGHDWH66ZBANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

darianbjohnson commented 1 year ago

That's weird; you don't need to delete the existing "FIRMWARE.BIN" file ; you only need to drag/drop the new bin file over (it will automatically replace the file once loaded).

Note - if your Newt resets before the upload is complete, then you might need to drag over the "hello world" bin first. Here's what I suggest.

  1. Download and install the "Hello World" bin using the same steps as above. https://phambili-pub.s3.amazonaws.com/Example1-Hello_World.ino.esp32s2usb.bin
  2. Once you see that Hello World is working, then follow the same process (push button for reset, see the drive, etc...) for the latest code version - https://phambili-pub.s3.amazonaws.com/Newt-1.1.4-RC1.bin
gshafer commented 1 year ago

When I drag over the Hello World .bin, I get this error:

The operation can’t be completed because an unexpected error occurred (error code 100093).

FYI --- I am on a Mac.

…..George

From: Darian Johnson @.> Date: Saturday, November 12, 2022 at 1:48 PM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

That's weird; you don't need to delete the existing "FIRMWARE.BIN" file ; you only need to drag/drop the new bin file over (it will automatically replace the file once loaded).

Note - if your Newt resets before the upload is complete, then you might need to drag over the "hello world" bin first. Here's what I suggest.

  1. Download and install the "Hello World" bin using the same steps as above. https://phambili-pub.s3.amazonaws.com/Example1-Hello_World.ino.esp32s2usb.bin
  2. Once you see that Hello World is working, then follow the same process (push button for reset, see the drive, etc...) for the latest code version - https://phambili-pub.s3.amazonaws.com/Newt-1.1.4-RC1.bin

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1312549144, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNSNZELODSAFCX7RR23WH7Q73ANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

darianbjohnson commented 1 year ago

Shoot - this is an error that is just starting to pop up with Pi Picos against the latest version of MacOS (Adafruit talked about it recently on their Ask an Engineer stream- https://youtu.be/Ur8MsnF7Eo0?t=1396). The drag-drop for ESP32S2 is similar, so I guess this is impacting the Newt as well

Ok, any chance you have a Window machine (or even a chromebook) that you can try? Otherwise, there are workarounds; check out https://www.raspberrypi.com/news/the-ventura-problem/

The alternative is to compile the code via Arduino and install.... which isn't overly complex, but will take you downloading more code on your machine....

Let me think about this for a bit and check for some additional work arounds

gshafer commented 1 year ago

I am pretty familiar with command line. Been working with Unix/Linux for 25 years.

So I copied over the file:

sh-3.2# cp -X /Users/georgeshafer_1/Downloads/Newt-1.1.4-RC1.bin .

sh-3.2# ls

.fseventsd FIRMWARE.BIN Newt-1.1.4-RC1.bin

Then I restarted the board:

sh-3.2# cd /Volumes

sh-3.2# ls

.timemachine MacMiniSSD

Backups of Mac Mini M1 S2-Firmware

Backups of Mac Mini M1 1 SamsungPrinterInstaller

Backups of Mac Mini M1 2 Untitled - Data

Backups of Mac Mini M1 3 Untitled - Data 1

GARMIN system-boot

sh-3.2# cd S2*

sh-3.2# ls

.fseventsd FIRMWARE.BIN

sh-3.2#

Now it is no longer cycling.

The screen shows “TOUCH ANY PAD”. If I hit a Pad it will respond “Pressed PAD ONE”.

Is this good?

From: Darian Johnson @.> Date: Saturday, November 12, 2022 at 2:43 PM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

Shoot - this is an error that is just starting to pop up with Pi Picos against the latest version of MacOS (Adafruit talked about it recently on their Ask an Engineer stream- https://youtu.be/Ur8MsnF7Eo0?t=1396). The drag-drop for ESP32S2 is similar, so I guess this is impacting the Newt as well

Ok, any chance you have a Window machine (or even a chromebook) that you can try? Otherwise, there are workarounds; check out https://www.raspberrypi.com/news/the-ventura-problem/

The alternative is to compile the code via Arduino and install.... which isn't overly complex, but will take you downloading more code on your machine....

Let me think about this for a bit and check for some additional work arounds

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1312558300, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNWJXP5T2E3WTKRQXQ3WH7XOBANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

darianbjohnson commented 1 year ago

hmmm... did you copy over "hello world" or "Newt-1.1.4-RC1.bin"? What your device is showing is the Hello World code. Can you try the command again, and make sure that you're using the Newt-1.1.4-RC1.bin file?

Maybe you need to press reset again after the copy???

gshafer commented 1 year ago

I ran the command again:

sh-3.2# cp -X /Users/georgeshafer_1/Downloads/Newt-1.1.4-RC1.bin .

sh-3.2# ls

.fseventsd FIRMWARE.BIN Newt-1.1.4-RC1.bin

You can see after I copied the list command shows the Newt-1.1.4-RC1.bin has copied over.

I reset the board. Still see “TOUCH ANY PAD”. ☹

…..George

From: Darian Johnson @.> Date: Saturday, November 12, 2022 at 3:33 PM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

hmmm... did you copy over "hello world" or "Newt-1.1.4-RC1.bin"? What your device is showing is the Hello World code. Can you try the command again, and make sure that you're using the Newt-1.1.4-RC1.bin file?

Maybe you need to press reset again after the copy???

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1312566689, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNTOUSXG23P5BSY7N3LWH75LFANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

darianbjohnson commented 1 year ago

Ok, can you try to download and install this test code (it's the Adafruit sharp memory display example - changed for Newt) https://phambili-pub.s3.amazonaws.com/Newt_Sharp_Memory_Test.ino.esp32s2usb.bin

This code will print a bunch of shapes to the screen, then will show rotating text. The example will look like this: https://www.youtube.com/watch?v=729yqMJuqPE

gshafer commented 1 year ago

I will try tomorrow AM and get back to you. Thanks!

From: Darian Johnson @.> Date: Saturday, November 12, 2022 at 3:56 PM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

Ok, can you try to download and install this test code (it's the Adafruit sharp memory display example - changed for Newt) https://phambili-pub.s3.amazonaws.com/Newt_Sharp_Memory_Test.ino.esp32s2usb.bin

This code will print a bunch of shapes to the screen, then will show rotating text. The example will look like this: https://www.youtube.com/watch?v=729yqMJuqPE

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1312570196, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNQI5OJHNHFPIRPELZTWH776ZANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

gshafer commented 1 year ago

I loaded that test .bin on both on both boards and it works fine 😊

Looks like we are making progress. What should I load next?

…..George

From: Darian Johnson @.> Date: Saturday, November 12, 2022 at 3:56 PM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

Ok, can you try to download and install this test code (it's the Adafruit sharp memory display example - changed for Newt) https://phambili-pub.s3.amazonaws.com/Newt_Sharp_Memory_Test.ino.esp32s2usb.bin

This code will print a bunch of shapes to the screen, then will show rotating text. The example will look like this: https://www.youtube.com/watch?v=729yqMJuqPE

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1312570196, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNQI5OJHNHFPIRPELZTWH776ZANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

darianbjohnson commented 1 year ago

Ok, can you download this zip file (https://phambili-pub.s3.amazonaws.com/Troublershooter_files.zip) and upload the "Newt_TRBL_FINAL_113.bin" file? This code should (in theory) load a modified version of the base code that prints errors to screen.

gshafer commented 1 year ago

I copied over the suggest code, but it does not seem to take. It continues to run the screen test software after a reset:

Copy over the file:

sh-3.2# cd /Volumes/S2*

sh-3.2# cp -X /Users/georgeshafer_1/Downloads/Newt_TRBL_FINAL_113.bin .

sh-3.2# cd /Volumes/S2*

sh-3.2# ls

.fseventsd FIRMWARE.BIN Newt_TRBL_FINAL_113.bin

sh-3.2# ls -l

total 2981

drwx------ 1 _unknown _unknown 512 14 Nov 14:59 .fseventsd

-rwx------ 1 _unknown _unknown 279168 12 Oct 10:30 FIRMWARE.BIN

-rwx------ 1 _unknown _unknown 1245904 14 Nov 14:59 Newt_TRBL_FINAL_113.bin

I can see the file has copied over. I reset the board:

sh-3.2# ls -l

total 547

drwx------ 1 _unknown _unknown 512 14 Nov 15:00 .fseventsd

-rwx------ 1 _unknown _unknown 279168 12 Oct 10:30 FIRMWARE.BIN

sh-3.2#

Seems like the new file is gone!

…..George

From: Darian Johnson @.> Date: Monday, November 14, 2022 at 10:14 AM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

Ok, can you download this zip file (https://phambili-pub.s3.amazonaws.com/Troublershooter_files.zip) and upload the "Newt_TRBL_FINAL_113.bin" file? This code should (in theory) load a modified version of the base code that prints errors to screen.

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1313911908, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNVH5EUZAODSJZU5T7TWIJJN5ANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

darianbjohnson commented 1 year ago

Wow.. ok.. let me noodle on ideas and get back to you

darianbjohnson commented 1 year ago

@gshafer - checking back in with you... I'm assuming that you're still having problems with your Newts. I just released an updated version... maybe you can try dragging that version over.

gshafer commented 1 year ago

Thanks. I am out of the country until May 2023, so I will have a look at it when I get home.

From: Darian Johnson @.> Date: Monday, January 2, 2023 at 12:56 PM To: Phambili-Tech/Newt_Display @.> Cc: gshafer @.>, Mention @.> Subject: Re: [Phambili-Tech/Newt_Display] Loop of Death (Issue #48)

@gshaferhttps://github.com/gshafer - checking back in with you... I'm assuming that you're still having problems with your Newts. I just released an updated version... maybe you can try dragging that version over.

— Reply to this email directly, view it on GitHubhttps://github.com/Phambili-Tech/Newt_Display/issues/48#issuecomment-1369120026, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABRZNUKOY4TEH2GAMUNV7LWQMJEHANCNFSM6AAAAAAQ5ZGCAE. You are receiving this because you were mentioned.Message ID: @.***>

gshafer commented 1 year ago

I finally got back to this project. I downloaded the latest Firmware and unit comes up fine. Thanks for all your help.