aBUGSworstnightmare
Posts: 1445
Joined: Tue Jun 30, 2015 1:35 pm

Trigger(s)/conditions for power symbol in taskbar

Fri Sep 07, 2018 7:19 am

Hi,
I'm currently working on a 'dt-blob.bin' for my CM3L baseboard and hit a problem which I would like to get answered.

Sometimes I have a better symbol in my taskbar, which shows battery status (charge) is 0%, running on external power.
battery symbol.jpg
battery symbol
battery symbol.jpg (11.55 KiB) Viewed 1219 times
I now need to know what is triggering this symbol (as there is neither a battery, nor a charge circuit in my design).
2018-09-06-203136_1280x800_scrot.jpg
screenshot of the desktop
2018-09-06-203136_1280x800_scrot.jpg (62.7 KiB) Viewed 1219 times
Here is the device tree source which leads (sometimes) to this.

Code: Select all

/dts-v1/;

/ {
  videocore {

    pins_cm {

      pin_config {

        pin@default {
          polarity = "active_high";
          termination = "pull_down";
          startup_state = "inactive";
          function = "input";
        }; // pin

        // BANK 0 - USER GPIO //
        pin@p0  { function = "input";   termination = "pull_up";    }; // GPU WILL USE THIS PIN FOR CAMERA 0 I2C0 SDA
        pin@p1  { function = "input";   termination = "pull_up";    }; // GPU WILL USE THIS PIN FOR CAMERA 0 I2C0 SCL
        pin@p2  { function = "output";  termination = "no_pulling"; }; // GPU WILL USE THIS PIN FOR CAMERA 0 LED
        pin@p3  { function = "output";  termination = "no_pulling"; }; // GPU WILL USE THIS PIN FOR CAMERA 0 SHUTDOWN
        pin@p4  { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p5  { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p6  { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p7  { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p8  { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p9  { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p10 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p11 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p12 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p13 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
///////////////////////////////////////////
// TO ENABLE UART0 UNCOMMENT THESE 2 LINES:
//       pin@p14 { function = "uart0";   termination = "no_pulling"; }; // UART0 TX
//       pin@p15 { function = "uart0";   termination = "pull_up";    }; // UART0 RX
// AND COMMENT OUT/REMOVE THESE 2 LINES:
        pin@p14 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p15 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
///////////////////////////////////////////
        pin@p16 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p17 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p18 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p19 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p20 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p21 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p22 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p23 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p24 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p25 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p26 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p27 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE

        // BANK 1 - USER GPIO//
        pin@p28 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE WAS INPUT NO PULL
        pin@p29 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE WAS INPUT NO PULL
        pin@p30 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p31 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p32 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p33 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p34 { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p35 { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p36 { function = "input";   termination = "pull_up";    }; // DEFAULT STATE
        pin@p37 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p38 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p39 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p40 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p41 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p42 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p43 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE
        pin@p44 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE WAS INPUT NO PULL
        pin@p45 { function = "input";   termination = "pull_down";  }; // DEFAULT STATE WAS INPUT NO PULL

        // BANK 2 - DON'T TOUCH UNLESS YOU KNOW WHAT YOU'RE DOING //
        pin@p46 { function = "input";   termination = "no_pulling"; drive_strength_mA = <8>; polarity = "active_high"; }; // HPD_N
        pin@p47 { function = "output";  termination = "no_pulling"; drive_strength_mA = <8>; polarity = "active_low"; startup_state = "active"; }; // STATUS LED / EMMC_DISABLE_N CONTROL
        pin@p48 { function = "sdcard";  termination = "pull_up";    drive_strength_mA = <8>; }; // SD CLK
        pin@p49 { function = "sdcard";  termination = "pull_up";    drive_strength_mA = <8>; }; // SD CMD
        pin@p50 { function = "sdcard";  termination = "pull_up";    drive_strength_mA = <8>; }; // SD D0
        pin@p51 { function = "sdcard";  termination = "pull_up";    drive_strength_mA = <8>; }; // SD D1
        pin@p52 { function = "sdcard";  termination = "pull_up";    drive_strength_mA = <8>; }; // SD D2
        pin@p53 { function = "sdcard";  termination = "pull_up";    drive_strength_mA = <8>; }; // SD D3

      }; // pin_config

      pin_defines {
        pin_define@EMMC_ENABLE {
           type = "internal";
           number = <47>;
        };
        pin_define@NUM_CAMERAS {
          type = "internal";
          number = <1>;
        };
        pin_define@CAMERA_0_LED {
          type = "internal";
          number = <2>;
        };
        pin_define@CAMERA_0_SHUTDOWN {
          type = "internal";
          number = <3>;
        };
        pin_define@CAMERA_0_UNICAM_PORT {
          type = "internal";
          number = <1>;
        };
        pin_define@CAMERA_0_I2C_PORT {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_0_SDA_PIN {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_0_SCL_PIN {
          type = "internal";
          number = <1>;
        };
      }; // pin_defines

    }; // pins_cm

    pins_cm3 {

      pin_config {

        pin@default {
           polarity = "active_high";
           termination = "pull_down";
           startup_state = "inactive";
           function = "input";
        }; // pin

        pin@p44  { function = "input";  termination = "pull_up";    }; // CAMERA 0 I2C0 SDA
        pin@p45  { function = "input";  termination = "pull_up";    }; // CAMERA 0 I2C0 SCL
        pin@p43  { function = "output"; termination = "no_pulling"; }; // CAMERA 0 LED
        pin@p42  { function = "output"; termination = "no_pulling"; }; // CAMERA 0 SHUTDOWN
        pin@p41  { function = "output"; termination = "no_pulling"; startup_state = "active"; }; // BL_EN
        pin@p40  { function = "output"; termination = "no_pulling"; startup_state = "active"; }; // PWM


        pin@p14 { function = "uart0";  termination = "no_pulling"; drive_strength_mA = < 8 >; }; // TX uart0
        pin@p15 { function = "uart0";  termination = "pull_up"; drive_strength_mA = < 8 >; }; // RX uart0
        pin@p46 { function = "input";  termination = "pull_up";    }; // SMPS_SCL
        pin@p47 { function = "input";  termination = "pull_up";    }; // SMPS_SDA
        pin@p48 { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD CLK
        pin@p49 { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD CMD
        pin@p50 { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D0
        pin@p51 { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D1
        pin@p52 { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D2
        pin@p53 { function = "sdcard"; termination = "pull_up";    drive_strength_mA = < 8 >; }; // SD D3
        pin@p128 { function = "input";  termination = "no_pulling"; polarity = "active_low"; }; // Hotplug
        pin@p129 { function = "output"; termination = "no_pulling"; polarity = "active_low"; }; // EMMC_ENABLE_N
      }; // pin_config

      pin_defines {
        pin_define@HDMI_CONTROL_ATTACHED {
           type = "external";
           number = <0>;
        };
        pin_define@EMMC_ENABLE {
           type = "external";
           number = <1>;
        };
        pin_define@POWER_LOW {
           type = "absent";
        };
        pin_define@LEDS_DISK_ACTIVITY {
           type = "absent";
        };
        pin_define@LAN_RUN {
           type = "absent";
        };
        pin_define@SMPS_SDA {
           type = "internal";
           number = <46>;
        };
        pin_define@SMPS_SCL {
           type = "internal";
           number = <47>;
        };
        pin_define@ETH_CLK {
           type = "absent";
        };
        pin_define@WL_LPO_CLK {
           type = "absent";
        };
        pin_define@USB_LIMIT_1A2 {
           type = "absent";
        };
        pin_define@SIO_1V8_SEL {
           type = "absent";
        };
        pin_define@PWML {
           type = "absent";
        };
        pin_define@PWMR {
           type = "absent";
        };
        pin_define@SAFE_MODE {
           type = "absent";
        };
        pin_define@SD_CARD_DETECT {
           type = "absent";
        };
        pin_define@ID_SDA {
           type = "absent";
        };
        pin_define@ID_SCL {
           type = "absent";
        };

        pin_define@NUM_CAMERAS {
          type = "internal";
          number = <1>;
        };
        pin_define@CAMERA_0_LED {
          type = "internal";
          number = <43>;
        };
        pin_define@CAMERA_0_SHUTDOWN {
          type = "internal";
          number = <42>;
        };
        pin_define@CAMERA_0_UNICAM_PORT {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_0_I2C_PORT {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_0_SDA_PIN {
          type = "internal";
          number = <44>;
        };
        pin_define@CAMERA_0_SCL_PIN {
          type = "internal";
          number = <45>;
        };
      }; // pin_defines

    }; // pins_cm3

  };

};

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2279
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Trigger(s)/conditions for power symbol in taskbar

Fri Sep 07, 2018 8:12 am

Interesting. When you see the battery plugin appear, does "/sys/class/power_supply" exist? If so, can you "tar" up the contents (something like:

Code: Select all

tar cvf power.tar -C /sys/class/power_supply .
) and upload it somewhere I can download it?

douglas5962
Posts: 28
Joined: Thu Mar 29, 2018 2:22 pm

Re: Trigger(s)/conditions for power symbol in taskbar

Fri Sep 07, 2018 4:19 pm

Just to chime in, I am having a very similar issue on Raspbian whenever I plug in a Symbol barcode reader. If you hover over the icon there's a tool tip that says the indicator is for the Pi-top laptop battery. For me this is happening with clean Raspbian installs on a CM3 and 3B+ with absolutely no Pi-top software installed.

aBUGSworstnightmare
Posts: 1445
Joined: Tue Jun 30, 2015 1:35 pm

Re: Trigger(s)/conditions for power symbol in taskbar

Thu Sep 13, 2018 7:32 am

Did not manage to replicate the issue. As I'm still in testing phase, changing things on my dt-blob frequently, I will keep looking for this.

First (quick feedback): "/sys/class/power_supply" always exists on my system. I've had a brief look and it shows records/reference of my BT keyboards battery. Honestly speaking, never had any issues/reports of low batteries so far on Raspbian (only know my Apple is reporting this)

Return to “Compute Module”