pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

PebbleOS

  • Overview
  • Start here
    • Getting started guide
    • Playground
  • Development
    • The pbl CLI
      • pbl configure
      • pbl build
      • pbl bundle
      • pbl menuconfig
      • pbl clean
      • pbl test
      • pbl itest
      • pbl run
      • pbl console
      • pbl debug
      • pbl debugserver
      • pbl emulator
      • pbl image_resources
      • pbl image_recovery
      • pbl erase
      • pbl lab
      • pbl power
      • Extending pbl
    • Build system
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Subsystems
    • Drivers
    • Services
    • Libraries
    • Third-party
    • Application SDK
  • Hardware
    • Boards
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

pbl power

Power the watch on, off or through a cycle, or measure the current it draws, with the supply the lab (see pbl lab) wires to its battery terminals.

pbl power on --voltage 3800
pbl run --resources
pbl power measure --seconds 30
pbl power start --name sync
# ... anything else: pbl console, an app on the phone, ...
pbl power stop --save results
pbl power off

on (and cycle) start a background process that holds the supply until off: some supplies, the PPK2 among them, cut the power when their port closes. Every other pbl power command talks to that process, so the watch stays powered in between, and any other command runs meanwhile. status shows whether it runs, the voltage and any measurement under way. Its log is next to the locks (see Locks).

The supply is the one of the lab’s watch for the build, the one of the watch given with --watch, or the one given with --supply. --voltage sets what it supplies; without it the supply keeps its voltage.

measure measures for --seconds and prints the mean, maximum and 99th percentile of the current. start and stop measure everything in between instead, across other commands. --json prints the whole summary, and --save DIR writes it as <name>.json, along with <name>.csv (1 ms means). Only supplies that sample the current can measure. A measurement is kept in memory until it stops: about 24 MB a minute with a PPK2.

The background process holds the supply’s lock, so an pbl itest session on the watch fails right away, naming it, until pbl power off.

Supplies

Type

Supply

Measures

ppk2

Nordic Power Profiler Kit II, in source-meter mode

yes

A supply type is a module of pbl.power implementing pbl.power.Supply, registered in pbl.power.TYPES; lab files, pbl power and the integration tests take any registered type.

Options

pbl power [-h] [-b DIR] [--dry-run] [--lab FILE] [--watch NAME]
          [--supply NAME] [--voltage MV] [--off-time S] [--seconds S]
          [--name NAME] [--save DIR] [--json]
          {on,off,cycle,status,measure,start,stop}
{on,off,cycle,status,measure,start,stop}

on, off, cycle; status; measure for –seconds, or start and stop a measurement around other work

--supply NAME

The lab’s supply to use (default: the watch’s)

--voltage MV

Voltage to supply, in millivolts (default: leave it as is)

--off-time S

How long cycle leaves the watch off (default: 1.0 s)

--seconds S

How long measure measures (default: 10.0 s)

--name NAME

Name of the measurement, and of its saved files

--save DIR

Save the measurement in DIR: a JSON summary and a CSV of 1 ms means

--json

Print JSON

Generated from PebbleOS 75673c495. This page is maintained in the pebbleos repository: docs/pbl/power.md.

Overview

  • Supplies
  • Options