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

V2 to V3 upgrade broken? #196

Closed
x418 opened this issue Jul 28, 2023 · 4 comments
Closed

V2 to V3 upgrade broken? #196

x418 opened this issue Jul 28, 2023 · 4 comments

Comments

@x418
Copy link
Contributor

x418 commented Jul 28, 2023

What?

I have been using the V2 branch ever since I got my keyboard and have had no issues. I only have minor changes in my keymap (plus two macros). Apart from the annoying merge conflicts every time I try syncing the fork, I have had no issues whatsoever.

However, I tried to migrate to the V3 branch by doing the following (also checked the UPGRADE.md)

  1. Created a new fork from V3.0
  2. Carefully changed the keymap (adv360.keymap & keymap.json) to only remap the keys I changed (mostly first row of the thumb cluster). They are attached below
  3. Cleared existing profile via BT_CLR (In my keymap, Mod+Ctrl) & also remove it from devices (I am on NixOS, if that matters)
  4. Flashed the left & right half with the new firmware as per instructions
  5. Switched on the keyboard & tried pairing again
  6. Pairing fails. I switch off and switch on, try a different profile via (Mod+1 through 5). Same result. BT_CLR doesn't appear to do anything (and none of the LEDs work)
  7. So, I end up reverting to the V2 based firmware
adv360.keymap
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/backlight.h>

#define AS(keycode) &as LS(keycode) keycode     // Autoshift Macro
#define AA(keycode) &aa LA(keycode) keycode     // AutoAlt Macro

/ {
    behaviors {
      #include "macros.dtsi"

      hm: homerow_mods {
          compatible = "zmk,behavior-hold-tap";
          label = "HOMEROW_MODS";
          #binding-cells = <2>;
          tapping-term-ms = <200>;
          quick_tap_ms = <175>;
          flavor = "tap-preferred";
          bindings = <&kp>, <&kp>;
      };

      as: auto_shift {
          compatible = "zmk,behavior-hold-tap";
          label = "AUTO_SHIFT";
          #binding-cells = <2>;
          tapping_term_ms = <135>;
          quick_tap_ms = <0>;
          flavor = "tap-preferred";
          bindings = <&kp>, <&kp>;
       };

      aa: auto_alt {
          compatible = "zmk,behavior-hold-tap";
          label = "AUTO_ALT";
          #binding-cells = <2>;
          tapping_term_ms = <135>;
          quick_tap_ms = <0>;
          flavor = "tap-preferred";
          bindings = <&kp>, <&kp>;
       };
    };

  keymap {
    compatible = "zmk,keymap";

    default_layer {
      bindings = <
        &kp EQUAL &kp N1    &kp N2   &kp N3   &kp N4     &kp N5 &tog 1                                                           &mo 3 &kp N6 &kp N7 &kp N8    &kp N9   &kp N0   &kp MINUS
        &kp TAB   &kp Q     &kp W    &kp E    &kp R      &kp T  &caps_word                                                       &kp INSERT &kp Y  &kp U  &kp I     &kp O    &kp P    &kp BSLH
        &kp ESC   &kp A     &kp S    &kp D    &kp F      &kp G  &none           &kp LEFT_WIN &kp LALT &kp RCTRL  &kp ESC         &kp PRINTSCREEN &kp H  &kp J  &kp K     &kp L    &kp SEMI &kp SQT
        &kp LSHFT &kp Z     &kp X    &kp C    &kp V      &kp B                            &kp HOME &kp PG_UP                           &kp N  &kp M  &kp COMMA &kp DOT  &kp FSLH &kp RSHFT
        &mo 2     &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT                &kp BSPC &kp DEL   &kp END  &kp PG_DN &kp ENTER &kp SPACE              &kp UP &kp DOWN  &kp LBKT &kp RBKT &mo 2
      >;
    };
    keypad {
      bindings = <
        &kp EQUAL &kp N1    &kp N2   &kp N3   &kp N4     &kp N5 &trans                                                           &mo 3 &kp N6 &kp KP_NUM &kp KP_EQUAL &kp KP_DIVIDE &kp KP_MULTIPLY &kp MINUS
        &kp TAB   &kp Q     &kp W    &kp E    &kp R      &kp T  &none                                                            &none &kp Y  &kp KP_N7  &kp KP_N8    &kp KP_N9     &kp KP_MINUS    &kp BSLH
        &kp ESC   &kp A     &kp S    &kp D    &kp F      &kp G  &none           &kp LCTRL &kp LALT &kp LGUI  &kp RCTRL           &none &kp H  &kp KP_N4  &kp KP_N5    &kp KP_N6     &kp KP_PLUS     &kp SQT
        &kp LSHFT &kp Z     &kp X    &kp C    &kp V      &kp B                            &kp HOME &kp PG_UP                           &kp N  &kp KP_N1  &kp KP_N2    &kp KP_N3     &kp KP_ENTER    &kp RSHFT
        &mo 2     &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT                &kp BSPC &kp DEL   &kp END  &kp PG_DN &kp ENTER &kp KP_N0              &kp UP     &kp DOWN     &kp KP_DOT    &kp RBKT        &mo 2
      >;
    };
    fn {
      bindings = <
        &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 AS(F6) &tog 1                                           &mo 3 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
        &trans &trans &trans &trans &trans &trans  &none                                           &none &trans &trans &trans &trans  &trans  &trans
        &trans &trans &trans &trans &trans &trans  &none        &trans &trans &trans &trans        &none &trans &trans &trans &trans  &trans  &trans
        &trans &trans &trans &trans &trans &trans                      &trans &trans                     &trans &trans &trans &trans  &trans  &trans
        &trans &trans &trans &trans &trans               &trans &trans &trans &trans &trans &trans              &kp C_VOL_UP &kp C_VOLUME_DOWN &trans  &trans  &trans
      >;
    };
    mod {
      bindings = <
        &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none                                                                     &trans                 &none        &none        &none        &none &none &none
        &none &none        &none        &none        &none        &none        &bootloader                                                               &bootloader            &none        &none        &none        &none &none &none
        &none &none        &none        &none        &none        &none        &none                   &none &none &bt BT_CLR &none                      &rgb_ug RGB_MEFS_CMD 5 &none        &none        &none        &none &none &none
        &none &none        &none        &none        &none        &none                                      &none &none                                                        &none        &none        &none        &none &none &none
        &none &none        &none        &none        &none                                       &none &none &none &none      &bl BL_TOG &rgb_ug RGB_TOG                                     &bl BL_INC   &bl BL_DEC   &none &none &none
      >;
    };
  };
};

keymap.json
{
  "keyboard": "adv360",
  "keymap": "default",
  "layout": "LAYOUT",
  "layer_names": [
    "base",
    "keypad",
    "fn",
    "mod"
  ],
  "layers": [
    [
      "&kp EQUAL ", "&kp N1    ", "&kp N2   ", "&kp N3   ", "&kp N4     ", "&kp N5 ", "&tog 1                                                                            ", "&mo 3  ", "&kp N6 ", "&kp N7 ", "&kp N8    ", "&kp N9   ", "&kp N0   ", "&kp MINUS",
      "&kp TAB   ", "&kp Q     ", "&kp W    ", "&kp E    ", "&kp R      ", "&kp T  ", "&caps_word                                                                             ", "&kp INSERT  ", "&kp Y  ", "&kp U  ", "&kp I     ", "&kp O    ", "&kp P    ", "&kp BSLH",
      "&kp ESC   ", "&kp A     ", "&kp S    ", "&kp D    ", "&kp F      ", "&kp G  ", "&none           ", "&kp LEFT_WIN ", "&kp LALT ", "&kp RCTRL  ", "&kp ESC",             "&kp PRINTSCREEN  ", "&kp H  ", "&kp J  ", "&kp K     ", "&kp L    ", "&kp SEMI ", "&kp SQT",
      "&kp LSHFT ", "&kp Z     ", "&kp X    ", "&kp C    ", "&kp V      ", "&kp B   ",                                  "&kp HOME ", "&kp PG_UP ",                          "&kp N  ", "&kp M  ", "&kp COMMA ", "&kp DOT  ", "&kp FSLH ", "&kp RSHFT",
      "&mo 2     ", "&kp GRAVE ", "&kp CAPS ", "&kp LEFT ", "&kp RIGHT                   ", "&kp BSPC  ", "&kp DEL   ", "&kp END  ", "&kp PG_DN ", "&kp ENTER ", "&kp SPACE                    ", "&kp UP ", "&kp DOWN  ", "&kp LBKT ", "&kp RBKT ", "&mo 2"
    ], [
      "&kp EQUAL ", "&kp N1    ", "&kp N2   ", "&kp N3   ", "&kp N4     ", "&kp N5 ", "&trans                                                                          ", "&mo 3  ", "&kp N6 ", "&kp KP_NUM ", "&kp KP_EQUAL ", "&kp KP_DIVIDE ", "&kp KP_MULTIPLY ", "&kp MINUS",
      "&kp TAB   ", "&kp Q     ", "&kp W    ", "&kp E    ", "&kp R      ", "&kp T  ", "&none                                                                           ", "&none  ", "&kp Y  ", "&kp KP_N7  ", "&kp KP_N8    ", "&kp KP_N9     ", "&kp KP_MINUS    ", "&kp BSLH",
      "&kp ESC   ", "&kp A     ", "&kp S    ", "&kp D    ", "&kp F      ", "&kp G  ", "&none          ", "&kp LCTRL ", "&kp LALT ", "&kp LGUI  ", "&kp RCTRL           ", "&none  ", "&kp H  ", "&kp KP_N4  ", "&kp KP_N5    ", "&kp KP_N6     ", "&kp KP_PLUS     ", "&kp SQT",
      "&kp LSHFT ", "&kp Z     ", "&kp X    ", "&kp C    ", "&kp V      ", "&kp B        ",                            "&kp HOME ", "&kp PG_UP "                                   , "&kp N  ", "&kp KP_N1  ", "&kp KP_N2    ", "&kp KP_N3     ", "&kp KP_ENTER    ", "&kp RSHFT",
      "&mo 2     ", "&kp GRAVE ", "&kp CAPS ", "&kp LEFT ", "&kp RIGHT                   ", "&kp BSPC ", "&kp DEL   ", "&kp END  ", "&kp PG_DN ", "&kp ENTER ", "&kp KP_N0                    ", "&kp UP     ", "&kp DOWN     ", "&kp KP_DOT    ", "&kp RBKT        ", "&mo 2"
    ], [
      "&kp F1    ", "&kp F2    ", "&kp F3   ", "&kp F4   ", "&kp F5     ", "&kp F6 ", "&tog 1                                                                       ", "&mo 3  ", "&kp F7 ", "&kp F8 ", "&kp F9    ", "&kp F10  ", "&kp F11  ", "&kp F12",
      "&trans    ", "&trans    ", "&trans   ", "&trans   ", "&trans     ", "&trans ", "&none                                                                        ", "&none  ", "&trans ", "&trans ", "&trans    ", "&trans   ", "&trans   ", "&trans ",
      "&trans    ", "&trans    ", "&trans   ", "&trans   ", "&trans     ", "&trans ", "&none          ", "&trans    ", "&trans   ", "&trans    ", "&trans           ", "&none  ", "&trans ", "&trans ", "&trans    ", "&trans   ", "&trans   ", "&trans ",
      "&trans    ", "&trans    ", "&trans   ", "&trans   ", "&trans     ", "&trans       ",                            "&trans   ", "&trans    ",                                 "&trans ", "&trans ", "&trans    ", "&trans   ", "&trans   ", "&trans ",
      "&trans    ", "&trans    ", "&trans   ", "&trans   ", "&trans                      ", "&trans   ", "&trans    ", "&trans   ", "&trans    ", "&trans    ", "&trans                   ", "&kp C_VOL_UP ", "&kp C_VOLUME_DOWN    ", "&trans   ", "&trans   ", "&trans"
    ], [
      "&none ", "&bt BT_SEL 0 ", "&bt BT_SEL 1 ", "&bt BT_SEL 2 ", "&bt BT_SEL 3 ", "&bt BT_SEL 4 ", "&none                                                                                        ", "&trans        ", "&none        ", "&none        ", "&none        ", "&none        ", "&none        ", "&none",
      "&none ", "&none        ", "&none        ", "&none        ", "&none        ", "&none        ", "&bootloader                                                                                  ", "&bootloader   ", "&none        ", "&none        ", "&none        ", "&none        ", "&none        ", "&none",
      "&none ", "&none        ", "&none        ", "&none        ", "&none        ", "&none        ", "&none                ", "&none", "&none ", "&bt BT_CLR ", "&none ",                             "&rgb_ug RGB_MEFS_CMD 5 ", "&none        ", "&none        ", "&none        ", "&none        ", "&none        ", "&none",
      "&none ", "&none        ", "&none        ", "&none        ", "&none        ", "&none                                          ", "&none ", "&none ",                                                              "&none        ", "&none        ", "&none        ", "&none        ", "&none        ", "&none",
      "&none ", "&none        ", "&none        ", "&none        ", "&none                                         ", "&none", "&none", "&none ", "&none      ", "&bl BL_TOG ", "&rgb_ug RGB_TOG                                ", "&bl BL_INC   ", "&bl BL_DEC   ", "&none        ", "&none        ", "&none"
    ]
  ]
}

@ReFil
Copy link
Collaborator

ReFil commented Jul 28, 2023

Can you please provide more information? What problems are you encountering, have you followed the upgrade guide in UPGRADE.MD?

@x418
Copy link
Contributor Author

x418 commented Jul 28, 2023

Can you please provide more information? What problems are you encountering, have you followed the upgrade guide in UPGRADE.MD?

Ha! That was quick. Sorry, I accidentally hit enter and now updating the description with details. Bear with me.

@x418
Copy link
Contributor Author

x418 commented Jul 28, 2023

Quick Update:

As I was composing this issue description, I thought of just using the V3 version of settings-reset.uf2 firmware to reset both halves of the keyboard (Since I am upgrading from V2 to V3). After doing that, I flashed with the V3 firmware.

This time, however, I started seeing more than 1 device when running scan on via bluetoothctl. However, after a few trial and error attempts, I was able to successfully pair with the first profile (Mod + 1). (Unlike in the past, where I just got the same device ID and didn't have to choose profiles).

That said, I am glad to say that I was able to fix the issue on my own. And leaving this issue for documentation. Feel free to close the issue. And thanks for the hard work you put in.

@ReFil
Copy link
Collaborator

ReFil commented Jul 28, 2023

Glad to hear it's all sorted, we are aware there exists a route for confusion with the multiple settings reset files, and shall be improving this in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants