V1 Unpatched Switch ESP32-S3 payload injector

  • Thread starter Thread starter AmeliaFox
  • Start date Start date
  • Views Views 10,517
  • Replies Replies 109
  • Likes Likes 9
You should compile it for a 4MB board. It will still work on your board (but the flash will show less space).

I think you are confused about sleep functions, you should check this page - https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/sleep_modes.html

It will show you how they work, that code line to sleep for 1 micro second was added on purpose so that the esp32-s3 had time to do something else in the browser or something else, I can't remember of the top of my head but it wasn't just added for no reason.
thanks for the additional info, ill compile a 4MB version and test soon.

ill also have a peek at that sleep modes documentation. i left the esp_deep_sleep(1) /reboot alone and added a ESP.restart() call at /reboot-hard and am only using it for the firmware update page after a firmware flash (this worked great when i tested). the other pages are still using the /reboot call which does the esp_deep_sleep(1)
 
  • Like
Reactions: snuffbot1
thanks for the additional info, ill compile a 4MB version and test soon.

ill also have a peek at that sleep modes documentation. i left the esp_deep_sleep(1) /reboot alone and added a ESP.restart() call at /reboot-hard and am only using it for the firmware update page after a firmware flash (this worked great when i tested). the other pages are still using the /reboot call which does the esp_deep_sleep(1)
Ok that's great, still make a list though of the files/functions changed or added and what the changes do so that they can be reviewed easily. Alot of testing was already carried out, but some things might have been missed (like typo's), so it's good you are pointing out issues so that when this program is finally completed everyone can enjoy it.

PS: as far as I remember that line esp_deep_sleep(1) forced the esp32 wifi to shutdown and restart, and the webage has a timer that makes the page refresh so that when the fw update was called the page reloaded. When you call esp restart code you are basically not allowing this to happen. ESP.restart() as far as I know doesn't do a proper hard restart so that's why it wasn't used.

ESP.reset() - hard restart (can leave some of the registers in the old state which can lead to problems)
ESP.restart() - soft restart (still uses the firmware you are already running)
Post automatically merged:

@mcPickleRick

FYI, if you don't know, you can just upload the html webfiles I gave you to the root of the flash and these will superceed/take prioriy over the hard coded ones. that way you don't need to keep building firmware/flashing/rebooting to test. You can just use the chips own filemanager to upload these, and if you make small changes you can use the built in file editor.

For some reason I am thinking you are not doing that.
 
Last edited by snuffbot1,
  • Love
Reactions: mcPickleRick
Ok that's great, still make a list though of the files/functions changed or added and what the changes do so that they can be reviewed easily. Alot of testing was already carried out, but some things might have been missed (like typo's), so it's good you are pointing out issues so that when this program is finally completed everyone can enjoy it.

PS: as far as I remember that line esp_deep_sleep(1) forced the esp32 wifi to shutdown and restart, and the webage has a timer that makes the page refresh so that when the fw update was called the page reloaded. When you call esp restart code you are basically not allowing this to happen. ESP.restart() as far as I know doesn't do a proper hard restart so that's why it wasn't used.

ESP.reset() - hard restart (can leave some of the registers in the old state which can lead to problems)
ESP.restart() - soft restart (still uses the firmware you are already running)
Post automatically merged:

@mcPickleRick

FYI, if you don't know, you can just upload the html webfiles I gave you to the root of the flash and these will superceed/take prioriy over the hard coded ones. that way you don't need to keep building firmware/flashing/rebooting to test. You can just use the chips own filemanager to upload these, and if you make small changes you can use the built in file editor.

For some reason I am thinking you are not doing that.
i hadnt tested the ESP.reset() but i know for sure that the ESP.restart() loads the newly uploaded firmware right away without issue from the web interface. the esp_deep_sleep(1) works fine for the wifi on the config page. the only spot i changed it was for the firmware updates because it seems to be a better experience for me.

and youre right lol, i have been recompiling and flashing the new firmware. i was not aware that i could upload the files to the root. that would have saved me alot of time :) do i upload the html files directly or run the script and upload the newly created header files?
 
i hadnt tested the ESP.reset() but i know for sure that the ESP.restart() loads the newly uploaded firmware right away without issue from the web interface. the esp_deep_sleep(1) works fine for the wifi on the config page. the only spot i changed it was for the firmware updates because it seems to be a better experience for me.

and youre right lol, i have been recompiling and flashing the new firmware. i was not aware that i could upload the files to the root. that would have saved me alot of time :) do i upload the html files directly or run the script and upload the newly created header files?
No you don't need to run the script, just upload the html files directly. This will save you a lot of time. You only need to run the scripts when you are finished modding the html pages.
 
  • Like
Reactions: mcPickleRick
damn, this is so much faster for testing. not sure why it didnt cross my mind
You do know you can edit them directly on the esp32 board using the file editor, right? If you are just making small changes like typo's and stuff like that. Also you can run the ftp server and upload files via ftp - that's fast as well.
 
Last edited by snuffbot1,
yeah after you mentioned it i turned on ftp to test it. im making progress faster because i can test small changes quickly now, thanks!
Post automatically merged:

I figured out how to add new pages, so i added a system information page and removed the system information modal from the Payload Manager page (the home page). Added the System Information as a option in the navigation dropdown on each of the pages.

currently working on shrinking the file sizes by having one css reference file and removing the style tag from each of the pages and linking to the css file. config page works fine this way, thats the only one i completed so far
 
Last edited by mcPickleRick,
  • Like
Reactions: snuffbot1
yeah after you mentioned it i turned on ftp to test it. im making progress faster because i can test small changes quickly now, thanks!
Post automatically merged:

I figured out how to add new pages, so i added a system information page and removed the system information modal from the Payload Manager page (the home page). Added the System Information as a option in the navigation dropdown on each of the pages.

currently working on shrinking the file sizes by having one css reference file and removing the style tag from each of the pages and linking to the css file. config page works fine this way, thats the only one i completed so far
The fastest way to do this is to just upload all the pages to Deepseek AI (free version) or some other AI, tell it you want an unified CSS file that will work for all the pages on both mobile and PC and let it do it's thing. That will save you a huge amount of work and you can tweak anything it goes wrong. You can also ask it to re theme to a colour scheme of your choice. Keep the original html and javascript but just replace the css code in each page.

Ok I've had a look at the code now since I got some time, I've changed the code to this for rebooting as this is the correct way after a firmware update according to the esp32-s3 documentation.

Code:
#include "soc/rtc_cntl_reg.h"   // or use the raw address

void full_restart(void) {
    // Preferred (uses the proper register definition)
    REG_WRITE(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_SYS_RST);

    // Equivalent raw form (from TRM / reported working):
    // REG_WRITE(0x60008000, 1UL << 31);

    while (1) {}   // never returns
}

As for the html/css - don't bother, i've already done it now and will post updated files + sketch + tools later.
Post automatically merged:

Here you go, all the new fixes applied and new theme with easier to edit css file. I've included the source for the Android apk and the apk + page header file scripts and programs. There's some other info like pdf files and pictures for the RCM circuit for internal installs. New theme tested on pc+mobile. If you want to make new themes easily, just upload the css file to your favourite Ai, tell it the colours you want and hopefully it will give you the correct css file back. Claude seems good for this, so does deep seek.

Themes's zip contains 6 themes so you can change the look of the webui to suit your own preferences, once you compile and flash the updated firmware if you want to change the theme just upload one of the themed css files into the root of your flash and make sure it's called styles.css, then refresh the page. These themes are very quickly made and look pretty neat. I am sure you can make your own based on these.
 

Attachments

Last edited by snuffbot1,
  • Love
Reactions: mcPickleRick
The fastest way to do this is to just upload all the pages to Deepseek AI (free version) or some other AI, tell it you want an unified CSS file that will work for all the pages on both mobile and PC and let it do it's thing. That will save you a huge amount of work and you can tweak anything it goes wrong. You can also ask it to re theme to a colour scheme of your choice. Keep the original html and javascript but just replace the css code in each page.

Ok I've had a look at the code now since I got some time, I've changed the code to this for rebooting as this is the correct way after a firmware update according to the esp32-s3 documentation.

Code:
#include "soc/rtc_cntl_reg.h"   // or use the raw address

void full_restart(void) {
    // Preferred (uses the proper register definition)
    REG_WRITE(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_SYS_RST);

    // Equivalent raw form (from TRM / reported working):
    // REG_WRITE(0x60008000, 1UL << 31);

    while (1) {}   // never returns
}

As for the html/css - don't bother, i've already done it now and will post updated files + sketch + tools later.
Post automatically merged:

Here you go, all the new fixes applied and new theme with easier to edit css file. I've included the source for the Android apk and the apk + page header file scripts and programs. There's some other info like pdf files and pictures for the RCM circuit for internal installs. New theme tested on pc+mobile. If you want to make new themes easily, just upload the css file to your favourite Ai, tell it the colours you want and hopefully it will give you the correct css file back. Claude seems good for this, so does deep seek.

Themes's zip contains 6 themes so you can change the look of the webui to suit your own preferences, once you compile and flash the updated firmware if you want to change the theme just upload one of the themed css files into the root of your flash and make sure it's called styles.css, then refresh the page. These themes are very quickly made and look pretty neat. I am sure you can make your own based on these.
i havent had time to work on this over the weekend with school having started (4 kids and one more due any day now) but i appreciate all youve done here and will review when i have time. I didnt want to throw everything into AI as this has been a big learning opportunity for me. the minify program didnt work well with my CSS so i iterated with AI until i got a program that works well (css specific). that was the first C++ program ive worked on, so that was fun! alot of firsts for me on this. i have already gone through the and updated the following pages:
config, home page, fw update
and added a new page for system information
going through it has helped me better understand the project and learned a bunch of things along the way.
attaching my latest version for reference, will check out your changes and themes when i have some time. thanks again for all the time you spent helping me with this :)
Post automatically merged:

heres some screenshots:
1788239842253.png

1788239862436.png

1788239880081.png

1788241345892.png

1788239908354.png
 

Attachments

Last edited by mcPickleRick,
  • Like
Reactions: snuffbot1
@mcPickleRick

I spent all day yesterday fixing/adding stuff and redesigning the web pages. You should use the attached files from now on as the base files as these are what will be used going forward. The file editor has search and replace added to it and there's new logic/script in some pages. Sorry about that, but like you say - you did learn quite alot, which is good. Have a look at these as I addressed all the issues you pointed out. I like your system info page but I prefer the popup one in the attached pages if I am honest (each to there own). These pages are probably going to be the final design unless you can find some issues with them and maybe we can work together to address that. You should give me your minify program so I can check it out, I can add it to the tools I use. I've still to test fully on mobile phones but that will not affect the pages - only css if anything needs changed. I won't bother attaching screenshots for now. I'll wait until you test these before making any themes for them.

i know you will be dissapointed probably as you spent quite a bit of time moddifiying all the old pages, but these ones have better logic as you will see when you test them - so if you want to make any changes going forward please use these. Sorry about that. Use the updated code I posted in the previous thread but replace the pages with these and generate new headers before compiling.
 

Attachments

Site & Scene News

Popular threads in this forum