-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 a usermod for interacting with BLE Pixels Dice. #4093
Conversation
@axlan thanks for your contribution.
More comments in the next few weeks, as I'm very busy in real life these days. @blazoncek what's your opinion on changing |
The 256KB FS partition did not fit this build for 4MB flash chips. Due to the alignment requirements for the app partitions, 64KB was the most FS that could be allocated. However, it's not actually used for the working builds since I only had 8MB ESP32-S3 boards to test. I used it to test the 4MB ESP32 boards I had, but there were other issues documented in the README that cause problems there. I'll add a disclaimer in the README about that partition size. |
…ng in a 4MB partition.
I've experimented with 64kB FS and it is useless except for testing. 128kB on the other hand will work unless user starts creating a lot of presets and uploads various ledmaps or other JSON files. Regarding Adding BT or BLE has always been controversial due to its size. IMO it is pointless to provide BLE support for anything with less than 8MB flash. Especially for usermods which will require custom compilation anyway. |
For sure using fixed IDs is the easiest way to handle this. That's what I had done initially before I cleaned this up for a PR. Presets don't totally fit for the use case here, since I want to still be able to use presets to control multiple segments, and setting the effects through the menu is intended only for the currently selected segment. It would also make tracking the state between the web UI and the usermod pretty messy. At the end of the day, this just needs to be able to detect if the current mode matches one of the usermods "die" modes. Technically, the easiest way to do that without this mod would be to check |
Why not? Preset can have anything form JSON API. Including effect on a single segment or just partial setting.
How or why? What makes you think so? Effects are reflected automatically and presets are tracked as well.
You can do that by using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can adjust according to my comments, I have no other objection.
@axlan please verify if the usermod and WLED are still working after the conflict resolution. |
@blazoncek Tested everything is still working. Thanks. |
The purpose of this mod is to support controlling effects from Pixels Dice. The board acts as a BLE central for the dice acting as peripherals. While any ESP32 variant with BLE capabilities should be able to support this usermod, in practice I found that the original ESP32 did not work (see the README for more details).
The only other ESP32 variant I tested was the ESP32-S3, which worked without issue. While there's still concern over the contention between BLE and WiFi for the radio, I haven't noticed any performance impact in practice. The only special behavior that was needed was setting
noWifiSleep = false;
to allow the OS to sleep the WiFi when the BLE is active.High level features:
The only modification I made outside of the usermod and constants, was a small change to
WS2812FX::addEffect()
to allow getting the index of the value added with the 255 wildcard. It wasn't entirely clear to me what the behavior should be once the mode vectors pass 255 elements, so I didn't change the current behavior.