Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added POV image effect #3539

Merged
merged 1 commit into from
Aug 18, 2024
Merged

Added POV image effect #3539

merged 1 commit into from
Aug 18, 2024

Conversation

Liliputech
Copy link

@Liliputech Liliputech commented Nov 23, 2023

Setup is really easy, after first boot and WiFi/LEDs setup: go to wled.local/edit and upload a couple image to WLed's filesystem. Only PNG is supported right now, further support for GIF is planned. The image should be as wide as the 1D segment you want to apply to.

When done, go to the Effect page on the UI, select "POV Image" effect.

There should be a new selector, near the Effect Speed slider. You can use that selector to set the image for display on POV.

You could also update the image with a post to the JSON-API like this: curl -X POST http://[wled]/json/state -d '{"seg":{"id":0,"fx":114,"f":"/axel.png"}}'

The segment should move at around 120RPM (that's 2revolutions per seconds) for an image to showup. More informations and pictures here : https://www.instagram.com/lumina.toys/

@blazoncek
Copy link
Collaborator

Thank you for the contribution. Looks like a nice enhancement, however...

Before this gets merged, please do the following:

  • move all file handling functions into file.cpp
  • move all segment drawing functions into FX.cpp
  • remove all unnecessary *.h files (the ones that parent *.htm didn't receive updates)
  • remove file property from Segment class and use segment name instead.
  • remove file extension from effect filters (there is no need for that)
  • modify file selector to be displayed beneath segment name input field
  • make sure only GIF and PNG files are displayed (do not hide just cfg.json and presets.json)
  • make sure this works in AP mode as well (I am not sure /edit works without internet)
  • please provide memory footprint for ESP8266 and ESP32 (flash and RAM)

I would personally suggest to make a usermod from this as including additional libraries may be problematic for ESP8266 as it is already on the verge of usability.

@blazoncek blazoncek added the waiting for feedback addition information needed to better understand the issue label Nov 26, 2023
@Liliputech
Copy link
Author

Hello Kristan,
Alright, I'll work on all those separate points asap.
I was also thinking of making this a usermod.
Keep in touch

@Liliputech Liliputech force-pushed the pov_display branch 3 times, most recently from e26f742 to e25798e Compare December 1, 2023 04:58
@Liliputech
Copy link
Author

I moved mostly everything to a Usermod, but still some work to do.

@blazoncek
Copy link
Collaborator

Do not force push changes. Please.
If you mess up things just open a new PR.

@Liliputech
Copy link
Author

Hi Kristan,
I still have a question, given my patch do change index.js file (even in its usermod version) am I not supposed to re-generate the html_ui.h file and add it to the changes?
Best,

@Liliputech
Copy link
Author

Building in release mode
Compiling .pio/build/esp32c3dev/src/wled00.ino.cpp.o
Retrieving maximum program size .pio/build/esp32c3dev/firmware.elf
Checking size .pio/build/esp32c3dev/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [==== ] 44.5% (used 145964 bytes from 327680 bytes)
Flash: [========= ] 90.4% (used 1421534 bytes from 1572864 bytes)

@blazoncek
Copy link
Collaborator

Sorry for late reply. Changing index.js for purposes of usermod is out of the question as the usermod is optional feature.
ATM I have no solution for this problem (selecting filenames in UI).

It is possible to hack into Info page and (with clever approach) use it to select a file. But it may be a dirty hack.
It is also possible to add a HTTP handler and serve custom HTML page for such purpose.

Will get back if I have any idea how to get those.

@Liliputech
Copy link
Author

Hi Kristan,
Ok, I'll make some changes to my commit with your advice and provide a better version.
Just thinking out loud, what if I create like "yet another web UI" for WLED dedicated to my purpose?
Just like PixelMagicTool did at the time?
Then I would be able to compile and install it from source as well as everyone else along with WLED, without the need for me to put too much crap in the original WLED repository? what do you think?
Like this one? #3042
Best,

@blazoncek blazoncek added the usermod usermod related label Jan 22, 2024
Copy link

Hey! This pull request has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs.
Thank you for contributing to WLED! ❤️

@github-actions github-actions bot added the stale This issue will be closed soon because of prolonged inactivity label May 21, 2024
@blazoncek blazoncek added keep This issue will never become stale/closed automatically and removed stale This issue will be closed soon because of prolonged inactivity labels May 22, 2024
@blazoncek
Copy link
Collaborator

Hi. please take a look at #3835 for idea how to use segment name as an image selector.
And update the PR for 0_15 branch.

@Liliputech
Copy link
Author

Liliputech commented May 28, 2024 via email

@Manut38
Copy link

Manut38 commented Jun 25, 2024

Just dropping in to say that I absolutely love this!! 😍

@Liliputech Liliputech changed the base branch from main to 0_15 August 7, 2024 10:51
@Liliputech
Copy link
Author

Hi,
I've rebased my commit on top of 0_15 branch :)
I've also tried with https://github.com/Manut38/WLED-GifPlayer-html -> works like a charm except the filename sent is missing a "/" before the filename.
Hope this is going to be merged soon :)

Copy link
Collaborator

@blazoncek blazoncek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove changes to platformio.ini and consider if you can implement suggestions.

platformio.ini Outdated Show resolved Hide resolved
usermods/pov_display/usermod_pov_display.h Outdated Show resolved Hide resolved
Setup is really easy, after first boot and WiFi/LEDs setup:
go to wled.local/edit and upload a couple image to WLed's filesystem.
Only PNG is supported right now, further support for GIF is planned.
The image should be as wide as the 1D segment you want to apply to.

When done, go to the Effect page on the UI, select "POV Image" effect.

You could also update the image with a post to the JSON-API like this:
curl -X POST http://[wled]/json/state -d '{"seg":{"id":0,"fx":114,"f":"/axel.png"}}'

The segment should move at around 120RPM (that's 2revolutions per seconds) for an image to showup.
More informations and pictures here : https://lumina.toys
@Liliputech
Copy link
Author

Thank you very much for your approval! Can't wait for this change to be merged :)

@blazoncek blazoncek merged commit 72d38f4 into Aircoookie:0_15 Aug 18, 2024
18 checks passed
@Liliputech Liliputech deleted the pov_display branch August 23, 2024 21:45
@Scabattoir
Copy link

Scabattoir commented Nov 16, 2024

Hi Liliputech and all.
I spent the better part of my last week trying to make this POV usermod work but I couldn't.
Is there any chance it could be updated so it would work?
Unfortunately I'm not good at coding, it took me about five days to be able to install VSCode and do a successful compile / upload of the unmodified code…
Thank you.

Edit:
my main question is: should I need to edit any other files than the platformio_override? If yes, which and what needs to change?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effect keep This issue will never become stale/closed automatically usermod usermod related waiting for feedback addition information needed to better understand the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants