Blade ID and/or SubBlade in ProffieOS 8 not working?

Do we need to make changes to the config for OS8 to work (vs for OS7.15)? If changes to the config are required–just skip to the last paragraph.

Now that OS8 can be installed from a .zip I thought I’d give it a try.
I have a complex install with OLED and multiple crystal chambers/accent pixels and a config that recognizes different blade ids. I installed OS8, copied my configs over to the new install–and installed it.

Only two of my accent pixels work–they are in parallel and use a basic blade definition.
The emitter, 10 pixel strip, button LED, and main blade do not light–all of which use subblade.
Blade-id does not seem to work. Speak Blade-ID gives the expected value when turning the saber on but inserting a blade does not trigger an announcement.

Reinstalling the config under OS7.15 fixes everything.

If the config should work under OS8 without modification, I’ll post my config with Pastebin, but if the config needs to be re-written for OS8, let me know and I’ll research the changes and try again (I did search for such instructions but didn’t find anything).

thanks,
js

1 Like

I’m moving this to a new topic so we can focus on sorting out your particular problems without worrying about derailing the ProffieOS 8.x thread.

Using the same config as with 7.x should work, assuming it doesn’t run out of memory or something.

Please post your config file. There has been some changes in subblade, and maybe that is causing bugs.

1 Like

Here is my full config (although I deleted all but 1 font for each preset).
/**** * NOTES * * *****/#ifd - Pastebin.com

My blade styles are in separate files loaded at the end (created with FETTs using-function), but I don’t think that will matter).

Here are extracts for my blade configs:

 { NO_BLADE, 
     SubBlade(1, 16, WS281XBladePtr<17, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4> >()), //emitter
     SubBlade(0, 0, NULL),  //upper crystal chamber 1
     WS281XBladePtr<1, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), //upper crystal chamber 2 and lower crystal chambers in parallel
     SubBlade(0, 9, WS281XBladePtr<11, blade4Pin, Color8::GRB, PowerPINS<bladePowerPin1> >()), //faux-bar graph
     SubBlade(10, 10, NULL),  //button 1
     SimpleBladePtr<CH1LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), //bluetooth module 
     SubBlade(0, 140, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4> >()), //main blade, irrelevant with NO BLADE
     SubBlade(141, 141, NULL),  //null blade
     SubBlade(142, 142, NULL),
     SubBlade(143, 143, NULL),
     CONFIGARRAY(no_blade_presets) },
{  500, //tritium blade
    SubBlade(1, 16, WS281XBladePtr<17, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4> >()), //emitter
    SubBlade(0, 0, NULL),  //upper crystal chamber 1
    WS281XBladePtr<1, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), //upper crystal chamber 2 and lower crystal chambers in parallel
    SubBlade(0, 9, WS281XBladePtr<11, blade4Pin, Color8::GRB, PowerPINS<bladePowerPin1> >()), //faux-bar graph
    SubBlade(10, 10, NULL),  //button 1
    SimpleBladePtr<CH1LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), //bluetooth module 
    SubBladeWithStride(0, 494, 4, WS281XBladePtr<495, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4> >()), //main blade, four strips
    SubBladeWithStride(1, 494, 4, NULL),  
    SubBladeWithStride(2, 494, 4, NULL),
    SubBladeWithStride(3, 494, 4, NULL),
    CONFIGARRAY(quad_presets)  },

And here is an extract of my code related to blade-id, which also does not seem to be working:

#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4>
#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>
#define BLADE_ID_SCAN_MILLIS 1000
#define BLADE_ID_TIMES 15
#define SPEAK_BLADE_ID //SAY IT!
#define BLADE_DETECT_PIN blade5Pin //free 1

thank you!
js

Not that this is the issue, but I see you have
#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>

SnapshotBladeID is the default Proffieboard V1.5 and V2.2 BLADE_ID_CLASS, so it doesn’t need to defined explicitly when using one of those boards, but you also have #include "proffieboard_v3_config.h"which means you are using a V3 board.

V3 Proffieboards already have a built-in bridged pullup resistor on data1, and BridgedPullupBladeID is the default Proffieboard V3 BLADE_ID_CLASS, so it doesn’t need to defined explicitly with a V3.
BridgedPullupBladeID will give much more accurate readings of resistance, so if you just remove the BLADE_ID_CLASS define, it should work better (when it works).

I don’t think I tested Blade Detect and Blade ID simultaneously
with the recent changes / tests, so it’s possible having BLADE_DETECT_PIN defined has something to do with your issues.

Have you tested with the latest GitHub master version?
https://github.com/profezzorn/ProffieOS/archive/refs/heads/master.zip

P.S. I edited the thread title to be a bit more specific to the issue at hand.

I think this has already been fixed on github, but not been packaged up in a zip file yet.
However, the subblade thing is kind of weird.

Given that blade ID might be acting weird, could you try using #ifdef to comment out all entries in your blades[] array except one, just to make sure it’s not selecting the wrong entry somehow?

I found one bug in SubbladeReverse / SubBladeZZ. Not sure if it is what is causing your problems though. I made an 8.2 zip with all the latest fixes. Please try it and see if anything works better.

I simplified the config and changed the code for blade-id as Brian suggested.
Here is a link to my config:
/**** * NOTES * Test for ProffieOS8.2 * * *****/#ifdef CONFIG_TOP - Pastebin.com

Blade-id is working, but not as expected. The ID’s returned are different–which I can deal with; however, inserting a blade does not trigger a blade-id check, but turning it on causes it to check twice. Also, the values returned by SPEAK_BLADE_ID do not seem to correlate to the blade definition and presets loaded. My saber announced 9000-something but loaded the presets for 10000, not 0.

Unfortunately, the subblades are still not working.

I added a new blade definition without subblades and everything lights up, but the original definition under NO_BLADE with subblades does not light any of the subblades. I used distinct colors so I could tell which blade definition/preset was loaded.

One more note: there is a warning during compile I’ve never seen before:

Compiling sketch...
"C:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\tools\\arm-none-eabi-gcc\\14-2-rel1-xpack/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -O3 -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib -fno-rtti -fno-exceptions -MMD -flto -fdevirtualize-at-ltrans -D_SYSTEM_CORE_CLOCK_=80000000L -D_SYSTEM_PCLK_DIVIDER_=2 -DARDUINO=10607 -DARDUINO_PROFFIEBOARD_V3 -DARDUINO_ARCH_STM32L4 -DSTM32L452xx -DPROFFIEBOARD_VERSION=3 -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs -mslow-flash-data -fsingle-precision-constant -felide-constructors -ffast-math -DUSB_VID=0x1209 -DUSB_PID=0x6668 -DUSB_DID=0xffff "-DUSB_MANUFACTURER=\"hubbe.net\"" "-DUSB_PRODUCT=\"Proffieboard\"" -DUSB_TYPE=USB_TYPE_CDC_WEBUSB -DDOSFS_SDCARD=3 -DDOSFS_SFLASH=0 "-IC:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\4.6/system/CMSIS/Include" "-IC:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\4.6/system/CMSIS/Device/ST/STM32L4xx/Include" "-IC:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\4.6/system/STM32L4xx/Include" "-IC:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\4.6\\cores\\stm32l4" "-IC:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\4.6\\variants\\STM32L452RE-ProffieboardV3" "-IC:\\Users\\jstam\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\4.6\\libraries\\Wire\\src" "C:\\Users\\jstam\\AppData\\Local\\arduino\\sketches\\E5D6A27F752AC4ACB01176085F74AD9B\\sketch\\ProffieOS.ino.cpp" -o "C:\\Users\\jstam\\AppData\\Local\\arduino\\sketches\\E5D6A27F752AC4ACB01176085F74AD9B\\sketch\\ProffieOS.ino.cpp.o"
In file included from C:\Users\jstam\OneDrive\Documents\Saber\ProffieOS-v8.2\ProffieOS\ProffieOS.ino:1533:
C:\Users\jstam\OneDrive\Documents\Saber\ProffieOS-v8.2\ProffieOS\display\ssd1306.h:53:9: warning: "ONCE_PER_EFFECT" redefined
   53 | #define ONCE_PER_EFFECT(X)       \
      |         ^~~~~~~~~~~~~~~
In file included from C:\Users\jstam\OneDrive\Documents\Saber\ProffieOS-v8.2\ProffieOS\display\rgb565frame.h:6,
                 from C:\Users\jstam\OneDrive\Documents\Saber\ProffieOS-v8.2\ProffieOS\styles\display.h:5,
                 from C:\Users\jstam\OneDrive\Documents\Saber\ProffieOS-v8.2\ProffieOS\ProffieOS.ino:526:
C:\Users\jstam\OneDrive\Documents\Saber\ProffieOS-v8.2\ProffieOS\display\layer_controller.h:444:9: note: this is the location of the previous definition
  444 | #define ONCE_PER_EFFECT(X)                      \
      |         ^~~~~~~~~~~~~~~
Compiling libraries...

I just compiled your config as-is, no problem.
Are you sure you downloaded and tried with the 8.2 version or the Github master?

I downloaded the 8.2 zip file Profezzorn posted: https://crucible.hubbe.net/uploads/short-url/dCDzx7C3M6wwgeVeQPf6YwBbbMm.zip
I dont know how to use github–it’s on my list of things to learn.

My config compiled but it had a warning I’d never seen before, which is what I posted. I assume it was just a warning–Did you NOT get the same warning when it compiled for you? I believe the warning is related to using OLED with ONCE_PER_EFFECT being defined in both SSD1306.h and layer_controller.h.

I’m traveling for the next few days and won’t be able to test more until Sunday–but I have ideas about changing up the subblades to possibly isolate the problem. My speculation is likely worthless, but I’m guessing it’s an issue with the NULL in the subsequent subblades and shared power pins. All of my installs are v3.9, have blade-id, and independent emitter and main blade, and most rely heavily on subblade for accent pixels but I have one that only uses subblade for an independent two strip main blade–I’ll switch to testing that hilt–and see if I can replicate the issue with a config that will also work with conventional wiring.

I did not. Although, I have seen it before. When some changes were made not long ago for display stuff, I flagged it but I have to look at what the fix was. It is very odd that you would get it when I just compiled your exact config file on a fresh 8.2 download.
I also tried with one of my own configs with ssd1306 enabled . Still no error. However, I do see that it is defined twice so I’m not sure what the fix was or why you would get that error right now. I got to look some stuff up. Or maybe @profezzorn can chime in in the meanwhile.

1 Like

I switched to testing with a simpler install. I tested an 89Sabers with their universal chassis. The chassis has the main blade (with emitter and a CC in parallel) and a second data pin with buttons and a pommel pixel. My config normally uses subblade to isolate the first pixel as there is a CC with a pixel in parallel with the main blade and emitter. The blade is a KRv1 (two independent strips normally configured with subbladewithstride). For the test, i just isolated the first 11 pixels.

It works fine with 7.15.
The subblade LEDs do not light with 8.2.

You should be able to replicate my results by taking ANY config and splitting the main blade into parts with subblade.

// Ventress config for use with KR Pixel stick v1// main blade with two indepe - Pastebin.com

1 Like

I don’t have a zip yet, but the I think I have a fix for this on github.

1 Like

I don’t know if I used github correctly, but I downloaded the version with the “tag” 8.2 and re-ran everything. Same issues.

so… I looked at the code in sub_blade.h, compared 8.2 to 7.15 and I may have found the problem.

The new sub_blade.h is longer due to the blade list feature, so there are many differences, but I found one near the top that didn’t look quite right.

Here is the code in 7.15: (lines 74-76)

  virtual bool primary() const {
    return !offset_;
  }

And here is the code in 8.2 (lines 76-78).

>   bool primary() const {
>     return primary_;
>   }

I changed the 8.2 version to

>   bool primary() const {
>     return !offset_;
>   }

and it worked… I may have broken something else, but maybe this will help you find the problem.

Apologies–it seems this was a red herring–or a work-around at best, as the new working version has the “return primary_;” code.

the v8.2 tag is identical to the 8.2 zip, and 8.2 does not have the fix.

The fix is here:

And if you just get the latest from the “master” branch, you will get it.

When I make an 8.3 zip, there will be an v8.3 tag which will have the fix.

To download the latest Github Master, click on the green ‘Code’ button, click on Download ZIP.

1 Like

Thank you both–I was able to download the latest version and can confirm the subblade changes now work as expected. The snapshot blade-id class does not work properly with a V3.9 board… it triggers repeated checks/speak-blade-id, but when I commented out that line, it works properly on my V3.9 proffieboard. The returned ID values are all new–so I will need to rewrite the blade definitions to test my zig-zag and quad blades, but I can confirm that accents, buttons, and independent emitters and simple blades are all working properly in the latest master.

Subblade: works
Blade-id: works (without snapshot class)

Will test subblade with stride and reverse this weekend. OLED seems to work fine as well, and I will test bluetooth this weekend.

this test was with a v3.9 proffieboard using Arduino 2.3.5 and board driver 4.6.

PS: the update to 2.3.5 wiped out my stored config list. that was annoying.

thank you!

? what do you mean by this? Arduino version?
“stored list” meaning you had a bunch listed in ProffieOS.ino commented out then choose which one to activae by remocing comment slashes?
You can just copy that part from the previous ProffieOS.ino, it’s not an Arduino thing.

That’s what I was expecting, but not what happened… I don’t understand it, but on one of my computers, when I updated Arduino, all the .ino files were rolled back to their installed state. I just updated my laptop to see if I could replicate the issue–and I couldn’t… but at least now I have recovered my edits. I suppose it could be a OneDrive problem… that accursed app…

Indeed. Run far away from OneDrive with all things Proffie. (Shouldn’t have to, but yeah)

1 Like