🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5StickCP2: isCharging inf Power class does not function

    M5 Stick/StickC
    2
    3
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      oody1
      last edited by

      Hi all,
      I'm trying to detect when M5StickC2+ is connected to power. I'm using the function StickCP2.Power.isCharging() to do so. However the function always return value 2 (charge_unknown) no matter if the M5Stick is connected to power or not. Is there an alternate way to detect power connected?
      Thanks!

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by felmue

        Hello @oody1

        the charger IC (TP4057) in M5StickCPlus2 cannot be queried by software about whether the battery is getting charged or not. It only has two outputs (CHRG and STDBY), but they are not connected. See schematic here. That is the reason the isCharging() function can only return charge_unknown. See here.

        And no, I am not aware of a way to figure out whether M5StickCPlus2 is connected to external power or not.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        O 1 Reply Last reply Reply Quote 0
        • O
          oody1 @felmue
          last edited by

          Thanks @felmue !

          1 Reply Last reply Reply Quote 0
          • First post
            Last post