🤖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

    Scheduled Pinned Locked Moved M5 Stick/StickC
    3 Posts 2 Posters 2.2k Views
    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 Offline
      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 Offline
        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 Offline
          oody1 @felmue
          last edited by

          Thanks @felmue !

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post