Skip to content

Commit ba88560

Browse files
committed
Clarify board-agnostic network support
1 parent 95f7519 commit ba88560

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
CircuitPython_DataDog is a small CircuitPython 9.x library for sending custom
44
metrics to the Datadog HTTP API at `POST /api/v2/series`.
55

6-
The library is designed for ESP32-class CircuitPython boards. It has no runtime
7-
dependencies beyond `time` and the `adafruit_requests.Session` object supplied
8-
by your own WiFi setup code.
6+
The library is designed for network-capable CircuitPython boards, including
7+
boards with built-in WiFi, Ethernet, or a supported network coprocessor. It has
8+
no runtime dependencies beyond `time` and the `adafruit_requests.Session` object
9+
supplied by your own network setup code.
910

1011
## Installation
1112

@@ -30,7 +31,7 @@ CircuitPython_DataDog/
3031
```
3132

3233
You are responsible for installing `adafruit_requests` and its required support
33-
files on the device, and for connecting WiFi before creating the client.
34+
files on the device, and for connecting the network before creating the client.
3435

3536
## Usage
3637

@@ -41,6 +42,8 @@ import wifi
4142
import adafruit_requests
4243
from datadog import DatadogClient
4344

45+
# This setup is for boards with built-in WiFi. If your board uses Ethernet
46+
# or an external coprocessor, create the session for that network interface.
4447
wifi.radio.connect("ssid", "password")
4548
pool = socketpool.SocketPool(wifi.radio)
4649
session = adafruit_requests.Session(pool, ssl.create_default_context())
@@ -49,7 +52,7 @@ client = DatadogClient(
4952
session,
5053
"DATADOG_API_KEY",
5154
site="datadoghq.com",
52-
default_tags=["runtime:circuitpython", "board:esp32"],
55+
default_tags=["runtime:circuitpython", "board:my-board"],
5356
)
5457

5558
client.gauge("circuitpython.temperature", 24.5, tags=["room:lab"])
@@ -121,8 +124,8 @@ The client prepends `api.` when needed, so `us3.datadoghq.com` becomes
121124

122125
## Notes
123126

124-
- WiFi setup, TLS setup, NTP/RTC time setup, and the requests session are caller
125-
responsibilities.
127+
- Network setup, TLS setup, NTP/RTC time setup, and the requests session are
128+
caller responsibilities.
126129
- Datadog expects metric timestamps to be close to current Unix time. If your
127130
board does not have correct time after boot, set the RTC before sending
128131
metrics.

examples/basic_metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2026 Corey Bertram
22
# SPDX-License-Identifier: MIT
33

4-
"""code.py style example for CircuitPython ESP32 boards.
4+
"""code.py style example for CircuitPython boards with built-in WiFi.
55
66
Create a secrets.py file on CIRCUITPY with:
77
@@ -58,7 +58,7 @@
5858
client.gauge(
5959
"circuitpython.cpu.temperature",
6060
microcontroller.cpu.temperature,
61-
tags=["source:esp32"],
61+
tags=["source:wifi"],
6262
)
6363
client.gauge("circuitpython.uptime", now)
6464

0 commit comments

Comments
 (0)