Skip to content

Commit f186c8f

Browse files
committed
fix(examples/hello_esp32): connect to the CI server only after downloading firmware files
1 parent 6cad029 commit f186c8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/hello_esp32/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ async def main() -> None:
2525
f"Set WOKWI_CLI_TOKEN in your environment. You can get it from {GET_TOKEN_URL}."
2626
)
2727

28-
client = WokwiClient(token)
29-
print(f"Wokwi client library version: {client.version}")
30-
31-
hello = await client.connect()
32-
print("Connected to Wokwi Simulator, server version:", hello["version"])
33-
3428
for filename, url in FIRMWARE_FILES.items():
3529
if (EXAMPLE_DIR / filename).exists():
3630
continue
@@ -40,6 +34,12 @@ async def main() -> None:
4034
with open(EXAMPLE_DIR / filename, "wb") as f:
4135
f.write(response.content)
4236

37+
client = WokwiClient(token)
38+
print(f"Wokwi client library version: {client.version}")
39+
40+
hello = await client.connect()
41+
print("Connected to Wokwi Simulator, server version:", hello["version"])
42+
4343
# Upload the diagram and firmware files
4444
await client.upload_file("diagram.json", EXAMPLE_DIR / "diagram.json")
4545
await client.upload_file("hello_world.bin", EXAMPLE_DIR / "hello_world.bin")

0 commit comments

Comments
 (0)