-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Usermod settings SCL and SDA not showing platformio values #2931
Comments
They do, as a placeholder (remove -1 or any other input by deleting digits). This is intentional as to not allocate GPIO during boot. Not a bug but intentional behaviour. |
I saw the placeholder functionality. It's info only, not assigned to anything I would say setting hw_pin_sda/scl (or not setting) determines if gpio should be allocated or not. We are currently reviewing the sda/scl functionality. After review will let you know our advice. |
Well, it is not intended in the way you think. Confusing or not these setting are meant for advanced users who know how are they compiling and for what.
I wish you luck. I stumbled to a roadblock when trying to use 2 I2C devices on the same HW pins. Looks like a bug in Espressif/Arduino implementation. Since I2C is not used for LEDs and global SPI may conflict if using APS102 they are secondary in priority so I dropped any further development. |
Is it documented anywhere? Discord links also okay. Not to criticize your approach but get a general understanding how it is supposed to be used in different scenarios, improve documentation if needed and also test together multiple i2c devices |
I2C SPI Scrapbook: PART1:highest level declarations are in pins_arduino.h: If no HW_PIN values set in platformio and above variables commented out we see where these vars are used due to errors: SCK and MOSI NeoPixelBus/src/internal/*DotStarGenericMethod.h NeoPixelBus/src/internal/DotStarEsp32DmaSpiMethod.h const.h pinmanager.cpp .platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/libraries/SPI/src/SPI.cpp .platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/libraries/Wire/src/Wire.cpp U8g2/src/U8x8lib.cpp libraries/SD/src/SD.h Conclusion from above:
PART 2wled.h defines global variables which are used to set and get persistent values platformio has currently only one entry where standard values for an environment are defined (lolin_s2_mini): SPI values (HW_PIN_CLOCKSPI, HW_PIN_DATASPI, HW_PIN_MISOSPI) used in usermod_v2_four_line_display_ALT.h in case the global variables are -1 and used in pin_manager.cpp and xml.cpp for display purposes SPI values (HW_PIN_SCL, HW_PIN_SDA) used in above SPI cases in case the global variables are -1
U8X8_PIN_I2C_DATA and U8X8_PIN_I2C_DATA Conclusions:
Part 3Use of FLD_PIN_* values in usermod_v2_four_line_display_ALT.h Conclusion:
Part 4
Proposal
... to be continued ... |
Search in #dev-general for the "I2C" keyword on Discord. The advanced users in question were @softhack007 and @Matoran ( #2740 ) As for documentation: If you want clarifications or complaint about missing information/documentation open different kind of issue. Or ask on Discord. As noted above the implementation of shareable I2C and SPI failed and since it is not crucial for workings of WLED, further development stopped beyond the entry fields in usermod settings. Which work as intended. I do admit that this information (how & why) needs to be added somewhere. Perhaps in WLED-docs by someone that has time and will to do that and has played with usermods that use them. In current implementation you have global variables |
Hi, thanks @blazoncek and @ewoudwijma, this explains a lot how WLED behaves today. Proposal: give me some time to digest & numbercrunch this in my head. I'll need liquid cooling (beer) for this, so can do it on the weekend. Then i'll make a proposal in discord (SR-to-WLED team), about how I2C sharing could/should behave (kind of one-line requirements) including user perspective. We discuss in discord, then I try to improve the current implementation. |
SPI sharing seems to be a different beast:
So we could first try to improve I2C only, and then see what can be done for SPI. |
resolved by #2955 |
What happened?
Usermod settings do not show values for build flags HW_PIN_SCL and HW_PIN_SDA on new install. Show -1 instead:
To Reproduce Bug
erase flash: pio run --target erase
Set in platformio environment xyz
-D HW_PIN_SCL=22 -D HW_PIN_SDA=21
build xyz
go to settings / usermod
Expected Behavior
Install Method
Self-Compiled
What version of WLED?
0.14.0 latest
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
No response
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: