V1 Unpatched Switch ESP32-S3 payload injector

  • Thread starter Thread starter AmeliaFox
  • Start date Start date
  • Views Views 11,388
  • Replies Replies 131
  • 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 expander 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: (firmware attached so you can see what I mean - try to modify the code the source below to show something similar)
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 display 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,
  • Haha
Reactions: mcPickleRick
baby no 5 arrived a little early, putting some of my plans on hold :)

i am excited to look into this. also showed it to my son (12 y/o) and he loved it so i will probably have him mess with it a little to see if he can learn from it and make something cool. the amount of time i have to spend on this will depend on how well baby sleeps so fingers crossed that he loves his zzzzs lol

fyi, my two year old also loves the beat on the popcorn fw (not surprising)
 
baby no 5 arrived a little early, putting some of my plans on hold :)

i am excited to look into this. also showed it to my son (12 y/o) and he loved it so i will probably have him mess with it a little to see if he can learn from it and make something cool. the amount of time i have to spend on this will depend on how well baby sleeps so fingers crossed that he loves his zzzzs lol

fyi, my two year old also loves the beat on the popcorn fw (not surprising)
Congratulations on the baby, no sleep for you for the next few months then :-).

I've completed challenge two - it took about 5 minutes :-), I'll tweak it to remove all the crap we don't need in Amoled version as we are never going to use the rcm/gpio/led code so that can get scrapped. Memory is tight though with those graphics and web browser and mdns running together, so when bluetooth is enabled it doesn't inject properly, Turned off if works fine - but we only need bluetooth for changing payloads and altering settings so it's moot. In a few weeks or so when you complete challenge1 or give up because it was too hard, I'll give you the code. I'll post the firmware for challenge 2 in a day or two once I clean it up. Then you can use your amoled as a payload injector and have the display/sound and buttons working and battery stats. If you fail challenge 1 I won't give you the code for that though as it ...... so you if you want it, there's some motivation for you.

PS, I hope your wife is well after the labour and the other kids are all happy about having a new brother/sister. Once again congratulations and god bless.
 
  • Love
Reactions: mcPickleRick
Congratulations on the baby, no sleep for you for the next few months then :-).

I've completed challenge two - it took about 5 minutes :-), I'll tweak it to remove all the crap we don't need in Amoled version as we are never going to use the rcm/gpio/led code so that can get scrapped. Memory is tight though with those graphics and web browser and mdns running together, so when bluetooth is enabled it doesn't inject properly, Turned off if works fine - but we only need bluetooth for changing payloads and altering settings so it's moot. In a few weeks or so when you complete challenge1 or give up because it was too hard, I'll give you the code. I'll post the firmware for challenge 2 in a day or two once I clean it up. Then you can use your amoled as a payload injector and have the display/sound and buttons working and battery stats. If you fail challenge 1 I won't give you the code for that though as it ...... so you if you want it, there's some motivation for you.

PS, I hope your wife is well after the labour and the other kids are all happy about having a new brother/sister. Once again congratulations and god bless.
kids are very excited and my labor went well, wife is recovering quickly thank you!

and i appreciate the motivation to complete the challenge, im very much looking forward to it.

just need some time to mess with it (if i can find some) :)
 

Site & Scene News

Popular threads in this forum