This repository was archived by the owner on Jan 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
packages/jumpstarter-driver-esp32 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,3 +34,44 @@ export:
3434| boot_pin | GPIO pin number for boot mode control (if connected) | int | no | null |
3535
3636## API Reference
37+
38+ ` ` ` {autoclass} jumpstarter_driver_esp32.driver.ESP32
39+ :members :
40+ ` ` `
41+
42+ # Examples
43+
44+ ` ` ` {testcode}
45+ from jumpstarter.common.utils import env
46+ from jumpstarter.config.client import ClientConfigV1Alpha1
47+
48+ def main() :
49+ try :
50+ # Try to use existing JUMPSTARTER_HOST environment variable
51+ with env() as client :
52+ run_esp32_example(client)
53+ except RuntimeError :
54+ # Fallback to creating a lease (requires jumpstarter configuration)
55+ config = ClientConfigV1Alpha1.load("default")
56+ with config.lease(selector="driver=esp32") as lease :
57+ with lease.connect() as client :
58+ run_esp32_example(client)
59+
60+ def run_esp32_example(client) :
61+ esp32 = client.esp32
62+
63+ # Get chip information
64+ info = esp32.chip_info()
65+ print(f"Connected to {info['chip_revision']}")
66+ print(f"MAC Address : {info['mac_address']}")
67+
68+ # Flash firmware
69+ result = esp32.flash_firmware_file("firmware.bin", address=0x10000)
70+ print(result)
71+
72+ # Reset device to run new firmware
73+ esp32.reset()
74+
75+ if __name__ == "__main__" :
76+ main()
77+ ` ` `
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ import os
3+ from jumpstarter .common .utils import env
4+ from jumpstarter .config .client import ClientConfigV1Alpha1
5+
6+ def main ():
7+ with env () as client :
8+ esp32 = client .esp32
9+
10+ info = esp32 .chip_info ()
11+ print (f"Connected to { info ['chip_revision' ]} " )
12+ print (f"MAC Address: { info ['mac_address' ]} " )
13+
14+
15+ if __name__ == "__main__" :
16+ main ()
You can’t perform that action at this time.
0 commit comments