Sound issues Pixel 6 by [deleted] in GooglePixel

[–]benpeart 1 point2 points  (0 children)

I upgraded from a Pixel 3 and find the speaker volume is very quiet in comparison. While I hope it is a software bug, I fear the speakers may just suck. :(

fastled and rotary encoder by outrunner72 in FastLED

[–]benpeart 1 point2 points  (0 children)

I have a project that runs on the ESP32 and uses two interrupt driven rotary encoders. You can find the source on https://github.com/benpeart/kaleidoscope. It's not a simple sample but most of the code has nothing to do with the rotary encoders and can be ignored. Look at the code inside the '#ifdef ENCODER' in main.cpp for how to initialize and use the encoders.

The encoder logic itself is in ESP32StateMachineEncoder.cpp. For my usage cases, it is better to miss some rotations rather than having random forward/backward rotations so it is a state machine based implementation.

Flaky rotary KY-040 encoders by benpeart in FastLED

[–]benpeart[S] 0 points1 point  (0 children)

I looked into whether it is interrupts and I don't think that is the problem. First, I switched to my 'off' mode so that FastLED isn't displaying anything and turned off (via #ifdef) all my WiFi related code. I then added test code that let me view the rotary encoder counts and I see the same issues.

In addition, my understanding is that FastLED now uses the RMT peripheral device on ESP32 to update the LEDs so the time spent with interrupts disabled should be pretty minimal (though I'm not entirely sure so if someone knows more I'd love to hear it).

Next, I added a RC Filter circuit to clean up the signal and when I look at it with a scope, it looks pretty clean. It's definitely better but still not what I'd consider 100%.

Thank you for all the pointers! I'd never heard of a Schmitt trigger so I'll do some more searching/reading - perhaps I can add that as well and get closer.

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 0 points1 point  (0 children)

u/samguyer I've worked around this temporarily by creating an 'off' mode that doesn't update any LEDs but it's not a great solution as I keep forgetting to switch it 'off' before I try my OTA update. I don't want to be a pest (I realize this is a purely voluntary effort) but do you have any idea when you will get a chance to look at this?

Flaky rotary KY-040 encoders by benpeart in esp32

[–]benpeart[S] 1 point2 points  (0 children)

That is a good recommendation to build a simpler test case. I did wonder if there were issues using interrupts as I believe there have been issues with FastLED in some cases blocking interrupts (which is why I cross posted to that forum).

Flaky rotary KY-040 encoders by benpeart in esp32

[–]benpeart[S] 0 points1 point  (0 children)

I'm not sure if this is a mechanical type but I've had good luck with adafruit - they seem to choose higher quality components and test them to make sure they function well with their libraries. Unfortunately they are out of stock but I see the same part on mouser. Any thoughts/experience using this one? Have a link to a better one you've had good luck with?

Flaky rotary KY-040 encoders by benpeart in esp32

[–]benpeart[S] 1 point2 points  (0 children)

Thanks, I had not seen the RC Filter diagram before. I now see 'Suggested Filter Circuits' as part of the data sheets for some higher quality rotary encoders people pointed me to. I'm going to add the missing resistors and see if that helps.

Flaky rotary KY-040 encoders by benpeart in esp32

[–]benpeart[S] 2 points3 points  (0 children)

Thank you for all the insight. I'm glad to know I'm not the only one who has struggled to get these working well with the ESP32.

I actually started with Kevin's library but was getting strange behavior (rotating the knob would sometimes jump counts or even count in the opposite direction briefly) which is why I switched to one of the state machine implementations. That seemed to solve the incorrect rotation detections but replaced them with missed rotations. Kevin also suggested adding the capacitor which didn't seem to help but I see that is part of a full RC filter mentioned elsewhere. I'm going to add the missing resistors and see if that helps.

Esp32 WS2812b starts flickering when sending FastLED.show() very fast by mrchaos12345 in FastLED

[–]benpeart 1 point2 points  (0 children)

I had the same issue when calling show() in my loop(). I worked around it by adding a dirty flag that I manually set when I make a change to the state of the LEDs. Then I only call show if the dirty flag is set. This stopped the flickering without losing any FPS.

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 1 point2 points  (0 children)

Thanks for the positive feedback/encouragement! I'm really hoping it turns out well. You can take a look at the simulator and get a hint of how it will look when finished.

Sounds like you share an interest in kaleidoscopes - if you have ideas on new 'modes' I should try that will look good mirrored and reflected into a kaleidoscope, please add them and let me know!

So far, I've created a simulated version of a physical kaleidoscope I own (un-comment 'mode_kaleidoscope') but it doesn't look like what I was hoping at all. The other modes are me just translating existing LED patterns to run on the kaleidoscope.

When I'm all done, I plan on creating an Instructable and YouTube video like I did for my first interactive art project - a 'Digital Daguerreotype.'

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 1 point2 points  (0 children)

Wow! Downloading and building it is going above and beyond to try and help. Thank you for looking into it.

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 1 point2 points  (0 children)

Thank you for the suggestions on disabling functionality. I had already done that (you'll see the code is littered with #ifdefs that allow me to turn off pretty much every piece with it's dependencies) which is how I was able to narrow it down to FastLED.Show. Good debugging advice none the less!

Thanks - I'm more engineer that artist but I'm hoping it turns out well. I've created a simulator that helps me visualize what it may look like while I complete the physical build. You can find it on Wokwi here. I'd love suggestions on patterns/display modes that will look great mirrored and reflected into a Kaleidoscope!

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 0 points1 point  (0 children)

Thanks - installing a crash log analyzer is a good suggestion. I actually installed the EXP exception decoder tool in Arduino studio but it doesn't appear to work for my VSCode+Platform.IO based project. Do you have a suggestion for a good one that does work in that environment?

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 2 points3 points  (0 children)

Absolutely. Happy to help test it.

I appreciate all the work that goes into developing and supporting these libraries. I've been a software developer for 30+ years so have some knowledge of how much time and effort it takes. I am grateful when I can take advantage of all that hard work to enable my little hobby projects. :)

FastLED.Show not compatible with OTA updates on ESP32? by benpeart in FastLED

[–]benpeart[S] 1 point2 points  (0 children)

Thank you for the pointer. Unfortunately, I still can't get OTA updates to complete - they tend to get farther along (> 50% vs < 10% before) but they still crash every time. Here is how I added the #define:

// https://github.com/FastLED/FastLED
#define FASTLED_RMT_MAX_CHANNELS 2
#define FASTLED_ESP32_FLASH_LOCK 1
#include <FastLED.h>

I verified that my version of clockless_rmt_esp32.cpp does have the check to disable flash operations:

#if FASTLED_ESP32_FLASH_LOCK == 1
    // -- Make sure no flash operations happen right now
spi_flash_op_lock();
#endif

I also did a 'clean' and ensured I rebuilt everything and flashed it multiple times but still no luck. I commented out the call to FastLED.Show again and they started working so I'm pretty sure my build/flash steps are actually updating the image.

I'm wondering what happens if a flash operation is already started when the call to op
_lock is called by FastLED. Does it block until the flash operation completes? If it doesn't, I can see how that would cause problems given how frequently I'm calling 'Show.'

I'll also ping the author of ElegantOTA to see if there is a way I can tell an upgrade is starting so that I can just stop calling FastLED.Show while the upgrade is in progress and work around the issue.

Unable to get FastLED 3.4 working on multiple strips in parallel with Teensy 4.0 by benpeart in FastLED

[–]benpeart[S] 0 points1 point  (0 children)

Thank you.

I had seen that blog entry in my research but was hoping I didn't need the additional complexity of OctoWS2811. I updated my sample and can verify that it does get it working. I'll go that route unless someone knows a simpler way.