josefadamcik / SofleKeyboard

A split keyboard based on Lily58, Crkbd and Helix keyboards
https://josefadamcik.github.io/SofleKeyboard/
Other
1.86k stars 285 forks source link

Help: (Choc) split RGB LED and OLED issues #124

Open blewisemt opened 2 years ago

blewisemt commented 2 years ago

Kind of issue? I cant seem to get the RGB matrix pattern to change on the slave side of the board. I also can't seem to get the OLEDs to function at all or get the board to change layers. The board defaults the "breathing" pattern, and is on the first layer.

Which Board? Choc

Which Board Revision? 2.1

What steps have you taken

What is the issue? I initially used the Choc firmware at https://github.com/brianlow/qmk_firmware, built/flashed for VIA per the Choc build guide, resulting in the innermost vertical column of LEDs on each side working, and the OLEDs functioning. I then reflashed using the firmware at https://github.com/brianlow/qmk_firmware/blob/5264ae0ce57033322638b87ada26a377a4b25eab/keyboards/sofle/keymaps/choc-brian/config.h#L17-L19. This resulted in all of the LEDs working, but the slave half is stuck in the breathing matrix pattern. Additionally, The OLED screens no longer work. Perhaps I don't know how the keyboard works, but I can,t get the board to switch layers.

What you expected: I'm trying to change RGB modes to either solid or heatmap. I would also like the OLEDs to indicate the layer, and to be able to be able to swap layers. (How is this normally done?)

brianlow commented 2 years ago

Thanks for opening a new issue.

This resulted in all of the LEDs working, but the slave half is stuck in the breathing matrix pattern.

I have the same problem. If you don’t change lighting much, a workaround is to plug just the right side in to the computer, change the lighting then plug everything back normally. You'll need temporarily map some keys on the master half to adjust lighting. If that isn't acceptable, you'll need to use the regular choc firmware. Last I looked VIA didn't seem to be getting much love. Be interesting to see if Vial is a good option.

swap layers. (How is this normally done?)

To switch to a layer, hold the raise or lower key (blue and red here): image

Pressing both raise + lower enters an "adjust" layer where some keys will change things like lighting. Since you are using the choc_brian firmware, download and run https://caniusevia.com/ and it will let you view/change your keymap on the fly.

image

I would also like the OLEDs to indicate the layer

Perhaps flash the regular choc firmware to double-check the OLEDs wiring is still good - maybe a marginal connection. Next, I'd compare the OLED code in the two firmwares. I moved it around between versions but check out choc/keymap.c (at the bottom) and choc-brian/oled.c. Maybe change the firmware to just print a fixed string "Hello World" to see it can talk to the device.

blewisemt commented 2 years ago

So I think I've solved the layer issue using the information you provided. Still working on the RGB, as the first firmware I tried replicated the initial issue. OLEDs worked again as well. Transitioned back to the firmware you suggested, and once again nothing on the OLEDs.

brianlow commented 2 years ago

Some ideas for the OLED issue:

brianlow commented 2 years ago

@blewisemt just seeing if you had any luck solving

antoineroux commented 2 years ago

I just want to report I had the same issue with the right side not changing animation or color. The workaround worked for me.

Is it more a QMK bug or an issue with the keymap?

derpus-potatus commented 2 years ago

I believe I managed to solve the RGB issues. I am able to change animations and toggle the LEDs on/off on both sides using keys on either side of the board, no need for the workaround described earlier in the thread. My OLEDs also work fine. However... a preface:

With that out of the way, I suspected that the two sides were not communicating certain instructions. Given that normal modifiers (shift etc) work, there must be another function that communicates things like power, RGB effects etc.

After managing to get the two sides to accept commands like changing RGB modes, the LEDs on the slave side no longer illuminated on their own (did not follow their defined "RGB_MATRIX_STARTUP_MODE").

At that point, I guessed that the driver/controller did not know how to address the LEDs, or did not "know" that the LEDs existed. So I increased the number of LEDs in config.h and also "defined the matrix" for the slave side (this was very difficult for my weak untrained mind).

I've put my keymap/config/rules files here: https://github.com/derpus-potatus/sofle-choc

And here are the changes that I remember making:

In config.h

added:

#define SPLIT_TRANSPORT_MIRROR

changed lines 18 and 19:

#define RGB_MATRIX_SPLIT { 29, 29 }
#define DRIVER_LED_TOTAL 58

In keymap.c

In the block of code where the RGB matrices are defined, I added definitions(?) for the right side (master is left). The whole block now reads:

// RGB Matrix Configuration
#ifdef RGB_MATRIX_ENABLE

led_config_t g_led_config = { {
  // Key Matrix to LED Index
    // Left
    { 28, 21, 20, 11, 10,      0 },
    { 27, 22, 19, 12,  9,      1 },
    { 26, 23, 18, 13,  8,      2 },
    { 25, 24, 17, 14,  7,      3 },
    { 16, 15,  6,  5,  4, NO_LED },

    // Right
    { 57, 50, 49, 40, 39,     29 },
    { 56, 51, 48, 41, 38,     30 },
    { 55, 52, 47, 42, 37,     31 },
    { 54, 53, 46, 43, 36,     32 },
    { 45, 44, 35, 34, 33, NO_LED }

}, {
  // LED Index to Physical Position
    // LEFT
    {  95,   7 }, {  95,  21 }, {  95,  36 }, {  95,  50 }, { 115,  64 },
    {  95,  64 }, {  76,  62 }, {  76,  48 }, {  76,  33 }, {  76,  19 },
    {  76,   5 }, {  57,   3 }, {  57,  17 }, {  57,  31 }, {  57,  46 },
    {  57,  62 }, {  38,  64 }, {  38,  48 }, {  38,  33 }, {  38,  19 },
    {  38,   5 }, {  19,   7 }, {  19,  21 }, {  19,  36 }, {  19,  50 },
    {   0,  50 }, {   0,  36 }, {   0,  21 }, {   0,   7 },

    // RIGHT
    { 129,   7 }, { 129,  21 }, { 129,  36 }, { 129,  50 }, { 119, 64 },
    { 129,  64 }, { 148,  62 }, { 148,  48 }, { 148,  33 }, { 148, 19 },
    { 148,   5 }, { 167,   3 }, { 167,  17 }, { 167,  31 }, { 167, 46 },
    { 167,  62 }, { 186,  64 }, { 186,  48 }, { 186,  33 }, { 186, 19 },
    { 186,   5 }, { 209,   7 }, { 209,  21 }, { 209,  36 }, { 209, 50 },
    { 224,  50 }, { 224,  36 }, { 224,  21 }, { 224,   7 }

}, {
  // LED Index to Flag
    // LEFT
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1,

    // RIGHT
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1, 1,
    1, 1, 1, 1

} };

#endif
brianlow commented 2 years ago

@derpus-potatus thanks for posting! I should try getting my branch on latest QMK

killua99 commented 2 years ago

@derpus-potatus this somehow could / might work with ZMK firmware ?