Electron version 1.5 breaks solar and using setPowerConfiguration can't get USB charging

Before v1.5 we our 1watt solar panels were working great. When we updated, they stopped charging and the charge light just flashes fast.

We added config settings (not so familiar with these) to fix the solar charging, but now power from the usb port and pin, won’t charge the battery. What did I do wrong?

SystemPowerConfiguration conf;
PMIC pmic;
void setup_power_mode() {

conf.powerSourceMaxCurrent(900)         
    .powerSourceMinVoltage(5080)       
    .batteryChargeCurrent(1024)         
    .batteryChargeVoltage(4208)         
    .feature(SystemPowerFeature::PMIC_DETECTION)  //Tried without this and the next line and I get the redlight fault
    .feature(SystemPowerFeature::USE_VIN_SETTINGS_WITH_USB_HOST) ;
System.setPowerConfiguration(conf);  

}

void setup(){
setup_power_mode();

A little upset, the update should not have messed with the default, previous working settings!

That line will require your USB port to maintain 5.08 V under load (which most wont do).
I'm not sure why USE_VIN_SETTINGS_WITH_USB_HOST didn't help with that, though.

Thanks for looking, I will fix that, but we keep finding other issues with versions >1.5. I lost trust in the new OS versions so we are currently working on how to revert to version 1.4. That doesn’t look easy either.

Other issues so far but I need to get get code examples for once we get a solution going.

  • getSoc() when used with >1.5 and setPowerConfiguration causes a fed light fault.
  • batteryCharge() returns -1.
1 Like

.powerSourceMaxCurrent(900)
.powerSourceMinVoltage(5080)
.batteryChargeCurrent(1024)
.batteryChargeVoltage(4208)

Your values are much too aggressive.
Lower your powerSourceMinVoltage and batteryChargeCurrent. Solar panels regularly drop below 5V and it will stop charging because the PMIC cannot source what you tell it to.

.feature(SystemPowerFeature::PMIC_DETECTION) is for E-Series/B-Series that have External PMICs
Also, don’t call PMIC pmic; without using it, the SystemPowerConfiguration takes care of charging.

If you need to use the PMIC functions (getSoc()) etc. call PMIC pmic; inside a function.

1 Like

Was there some kind of warning when going to 1.5 version I missed? Some more info on these setting and when/how to adjust them in the documentation would be good it is hard to get a clear picture from so many different posts with different goals and values.

We tried reverting to an older version, but something doesn’t get put back, because they still did charge or work like our “not upgraded” ones.
So we had to use 1.5.2 here is the code we used :

FuelGauge fuel;
SystemPowerConfiguration conf;

void setup_power_mode() {
    System.setPowerConfiguration(SystemPowerConfiguration());
    conf.powerSourceMaxCurrent(900)         // default is 900mA this let's me charge faster
        .powerSourceMinVoltage(4300)        // This is the default value for the Boron
        .batteryChargeCurrent(1024)         // default is 2048mA (011000) = 512mA+1024mA+512mA)
        .batteryChargeVoltage(4208)         // default is 4.112V termination voltage
        .feature(SystemPowerFeature::USE_VIN_SETTINGS_WITH_USB_HOST) ;
    System.setPowerConfiguration(conf);     
}

void setup(){
    setup_power_mode();
....
1 Like

One critical part we discovered was that .powerSourceMinVoltage must be > 4100 or it will not charge in the sun for us. But we also tested and unless we go lower than this a .55amp charger will not charge it.

@runfastman, that's somewhat expected. A "cheap" half amp power supply could have trouble meeting the current requirements while maintaining 4.1V.

For a purely "Solar" application, powerSourceMinVoltage(5080) is the best available choice for a 6V Solar Panel. But it appears that you also want to be able to re-charge via USB on occasion.

There are a few threads on this forum that show you how to disable the System Power Manager completely. That might get you back close to your previous "Pre- v1.5" condition.

But you can still dig a little deeper to determine where the differences are.....depending on your previous Firmware Version.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.