V1 Unpatched Switch ESP32-S3 payload injector

  • Thread starter Thread starter AmeliaFox
  • Start date Start date
  • Views Views 11,302
  • Replies Replies 128
  • Likes Likes 9
Yes it's good, mrdude wrote the audio engine as a seperate program specifically to decode and play mod files which are free from mod archive. These are the music that was used in old demos from the demoscene. I wanted to run the graphics on one core and the audio on another core so the graphics wouldn't interfere with audio playback. When programming something that's constantly running - like the graphics routine we usually put things like that in tasks which can be given a priority. Since music playback or button code/touch code should always be responsive when something else is running, it's better to assign that to a different core (sort of like using threads in a computer program) so nothing can interfere with it - does that make sense? That's also why i added touch detection to the program as I wanted to see how it would react if running music.

On another note I found you're not the only one having issues with usbhost drivers on the newest esp32 boards (3.3.11)
https://github.com/espressif/arduino-esp32/issues/12783

FIX:
Above setup() add this:
Code:
static bool usb_enum_filter(const usb_device_desc_t* desc, uint8_t* bConfigurationValue) {
return true;  // Allow all USB devices to enumerate
}

Then inside setup look for these lines:
Code:
usb_host_config_t host_config = {};
host_config.skip_phy_setup = false;
host_config.intr_flags = ESP_INTR_FLAG_LEVEL1;
host_config.enum_filter_cb = usb_enum_filter;  // <-- ADD THIS LINE

That should fix 3.3.11 injection and be backwards compatible.

As for the issue with sleep, here's a pedometer firmware I compiled (from volos github)
https://docs.waveshare.com/ESP32-S3-Touch-AMOLED-1.8/Resources-And-Documents

Wakeup is working fine from the touch screen so I guess it's a code issue. Use the attached firmware to test your chip though just to be sure.
i tested it on 3.3.10 with the fix applied and it still worked fine but on 3.3.11 it still doesnt work
 
ok, recompiled after resetting the board settings and now its working. thanks!
Arduino keeps cached files to save you recompiling everything after small changes, you probably had the usb driver compiled and when you changed the board settings it got recompiled and overwrote the cached version.
Post automatically merged:

@mcPickleRick

Finally after a 4 day slog I finished all the pages now, These are tested fully on pc and phone and I don't see any issues. Let me know if you find any bugs. if not I'll mark this as complete and start on themes for them.
 

Attachments

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

Here's the popcorn code, sorry about the delay posting it - I had to ask mrdude if I could share the audio engine code and it took him a while to reply.

I updated it to show how to use the buttons on waveshare amoled touch 1.8 v1.

Example code;
Boot button press - turns screen off (music plays in background)
Power button short press - mute/unmute audio toggle.
Power button longer press - power down esp32-s3. (sleep mode)
Power button even longer press - fully turn of chip.
Touch screen touch detection - toggle scrolling text.

Example is used to learn how to use both cores, using the buttons and debouncing without delays, custom font/music arrays.

If you find the code hard to grasp, feed it into claude or another AI and ask it to explain what each part of the code does, for example you can ask it to explain the code that deals with button presses, or how the touch screen works. Or why we need code for the io explander chip..

That code should help you understand how to implement a menu system into the board for payload selection, you should look at learning to use lvgl and squareline studio for custom interfaces though. I can't share the Amoled injector sketch as mrdude doesn't want me to, but the attached code should give you a very good grounding on how to begin doing that yourself.

Challenge 1:
Since you already have all the code for injection, and this popcorn code what you could do is this....
1: When you touch the screen instead of showing "SOME OTHER TEXT" - you could make it dispay the battery percentage.

Challenge 2:
Once you complete challenge 1, combine both code bases so that you bascically have the popcorn and injector sketches as 1 program running on your dongle. (use AI to help if you get stuck).

Once you complete these 2 challenges - then try to create your own graphics (just a basic sketch), once that works do the same thing, at this point you will become awesome like me and eveyone will think you are cool :-)....haha.
 

Attachments

Last edited by snuffbot1,

Site & Scene News

Popular threads in this forum