Deep Sleep

Is deep sleep still possible on the 3.9? I haven’t heard a lot about it, and I know that the low-voltage switch is no longer something that can be done on the 3.9, so I’m curious if deep sleep is still in the works or not.

Yes. it hasn’t been a high priority for me since the standby power is usually very good, but it’s still my intent to make it happen.

It’s still possible, but requires an external FET, same as on the V2 boards.

Well it’s good that it’s still possible. I’m excited for it, especially for hilts too tiny for kill switches that are a pain to swap batteries, like the child hilt.

Is deep sleep supported on the v3.9 yet? I recently swapped out a Xenopixel for a Proffieboard v3.9 and am finding that I have a lot of drain in standby. I lost about 20% battery overnight last night to give you a gauge.

I have a BT909 connected to the SD power pin on the v3.9 per the configuration tool but it always shows up as a connectable device even after 5min pass. I have “#define IDLE_OFF_TIME 60 * 5 * 1000” defined in my CONFIG_TOP section. Let me know if I have that set wrong somehow.

Thanks!

Proper deep sleep is not implemented yet.
Using SD_VDD to control something is basically dependent on deep sleep as well, so it doesn’t do anything yet, which might explain the poor standby time.

The current workaround for this is usually to create a blade for the BT module, and then hook up the negative side to one of the LED* pads and let it control the power.

Or use a kill switch of course.

Well, that’s unfortunate. I don’t have room in the chassis for a kill switch (it’s a Xeno drop-in core).

I guess I’ll have to try that workaround for now. Any idea when proper deep sleep will be implemented? I didn’t realize this was a limitation for the v3.9 which tbh makes it less appealing if I have to swap batteries out this often… The extra flash memory is handy, though, for those of us who like a lot of fonts/styles.

Thanks for the info!

It’s probably time that I attempt to implement deep sleep anyways, so if you’re willing to wait, I may be able to make it work. It might take a couple of weeks to do though, so some patience would be required. Also, I’ve had problems with making these sort of things work reliably in the past, so there is a chance that I won’t be able to make it work at the end of those weeks.

2 Likes

If you’re willing to start the process of implementing deep sleep on the v3.9 that would be amazing. I’m sure you’re plenty busy so I won’t anticipate results too fast but I’m sure I’m not the only one who would appreciate your efforts on this one. Please let me know if I can help with testing!

Regarding the workaround, I think I need some help on the config file setup of adding a fake blade. How would I configure the BladeConfig section for this application?

On 2.2 you’d bridge the 3.3 and the gnd with a 47-100 uF 6.3-10V ceramic capacitor (603 or 805), wire power from the 3.3 and put the gnd on a blade pin - in the below case i used pin 6. For 3.9 proffie you can just use the 805 pads on the board as shown here (thanks to prof for this image):


blade config:

SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),

and because it’s a blade, you’ve got to give it a style. give it something like this:

StylePtr<Blue>(),

so it stays on when the board is active. when inactive it’ll switch off via the mosfet like all the blades do. much better on power.

Is the negative for the BT909 connected to Ground or to one of the main LED pads? If it’s connected to Ground, the the Idle Off Time won’t affect it - you need that neg connected to an LED pad, then set the config so that it is effectively handled as a blade which is ON even with the main blade off. That way the idle off time will shut off all LEDs, including the 909 module, after whatever time you specifiy.

blade config:

SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),

I tried entering this into my blade config but I’m now getting a compilation error. Full blade config reads as follows:

BladeConfig blades[] = {
 { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), 
 SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
 CONFIGARRAY(presets) },
};

Compilation error:

In file included from C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\ProffieOS.ino:632:
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\config\my_saber1.h:1135:1: error: too many initializers for 'Preset'
 1135 | };
      | ^
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\config\my_saber1.h:1139:73: error: cannot convert 'BladeBase*' to 'Preset*' in initialization
 1139 |  SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
      |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                                         |
      |                                                                         BladeBase*
In file included from C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\ProffieOS.ino:602:
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\config\my_saber1.h:1140:14: error: invalid conversion from 'Preset*' to 'size_t' {aka 'unsigned int'} [-fpermissive]
 1140 |  CONFIGARRAY(presets) },
      |              ^~~~~~~
      |              |
      |              Preset*
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\common\preset.h:6:24: note: in definition of macro 'CONFIGARRAY'
    6 | #define CONFIGARRAY(X) X, NELEM(X)
      |                        ^
In file included from C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\ProffieOS.ino:243:
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\common\common.h:18:28: error: invalid conversion from 'unsigned int' to 'const char*' [-fpermissive]
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                  ~~~~~~~~~~^~~~~~~~~~~~~~~~
      |                            |
      |                            unsigned int
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\common\preset.h:6:27: note: in expansion of macro 'NELEM'
    6 | #define CONFIGARRAY(X) X, NELEM(X)
      |                           ^~~~~
C:\Users\Administrator\Downloads\ProffieOS-v7.14\ProffieOS\config\my_saber1.h:1140:2: note: in expansion of macro 'CONFIGARRAY'
 1140 |  CONFIGARRAY(presets) },
      |  ^~~~~~~~~~~
Multiple libraries were found for "Wire.h"
  Used: C:\Users\Administrator\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\libraries\Wire
  Not used: C:\Users\Administrator\Documents\Arduino\libraries\Wire
Using library Wire at version 1.0 in folder: C:\Users\Administrator\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\libraries\Wire 
exit status 1

Compilation error: too many initializers for 'Preset'

I did make sure to include the blade style you suggested in each of my presets.

As of yesterday, the positive lead for the BT909 is connected to the SD card power pad and the negative lead is connected to LED6.

1 Like

Did you update your blade count? Also don’t forget to add a styleptr like above to the blade profiles - each one needs one. doesn’t need to be fancy, just a StylePtr(), will do. Color doesn’t matter, but blue helps me remember what it’s for.

Doh! I thought I did, but apparently I accidentally CTRL-Z’d it without realizing it. Once I fixed that, it compiled and loaded.

Unfortunately, the BT909 is not turning on. I know the connections are good because when I duplicated my primary blade in the blade config it did turn on but only when the blade was on. In this case, it doesn’t turn on regardless of what condition the saber is in.

Advice?

what power pin is your bt on?

Like I said above, the positive lead is connected to SD card power and negative is connected to LED6.

Try the 3.3 instead. That’s what I always use.

Still no luck. I’m measuring 0 volts between LED6 and the 3.3 pad. When I measure between 3.3 and GND, I get 3.3v. I get continuity (in one direction) between LED6 and the negative terminal of the battery just as I do with LED2 and LED3 but no continuity between LED2/3 and LED6.

Did you put a capacitor on the pair of pads on the board circled in red? You need that too.

Yes, I have the capacitor installed.

I suspect the issue is either a hardware limitation or to do with the blade config.