Lab method

RF loss through 3D-printed enclosures

How we measure the change in RSSI and Wi-Fi throughput when an ESP32-C5 board goes into a printed enclosure, by material and wall thickness, and how we show whether the change is larger than the test's own scatter.

InstrumentESP-IDF iperf example, RF test jig, access point with one SSID per band (see ops/BENCH.md)
Updated28 November 2026

A printed enclosure sits a few millimetres from the board’s antenna. Whether it costs signal, and how much, depends on the material, the wall thickness and the band. Makers usually find out by trial in the field. This method measures it on the bench, for 2.4 and 5 GHz on an ESP32-C5-DevKitC-1, and states how small a change the test can resolve. For the theory of how radio waves pass through and around materials, see the Wireless Field Guide.

What we measure

For each enclosure sample and band, we compare the board inside the enclosure with the same board in the open, both held in the same position:

  • RSSI delta: the median RSSI with the enclosure minus the median RSSI in the open, in dB
  • Throughput delta: the same for the mean TCP throughput of each trial, in Mbit/s, board transmitting

The open-board trials also give the repeatability of the setup: the spread of RSSI and throughput when nothing has changed except refitting the board.

Setup

The radio side is the throughput-and-range method: the stock ESP-IDF v6.1.1 iperf example, one access point with one SSID per band on fixed channels, an iperf 2 host wired to it, and the same metadata recorded with every trial.

The board is held in the RF test jig, which fixes its position, height and orientation relative to the access point. The jig stays in place for the whole session. Its own material is near the antenna in every trial, open or enclosed, so its effect is common to both sides of the delta. The method cannot run until the jig has been printed and fitted to the board revision under test.

Two positions are used:

  • Position A: line of sight, at a distance where the board associates on both bands with a comfortable margin. RSSI deltas are read here.
  • Position B: further away, where the open board’s 5 GHz throughput in the throughput-and-range method is below its value at 1 m. A throughput delta only shows where throughput is limited by the signal, so throughput deltas are read here.

Both positions are recorded by distance and obstruction, as in the throughput method.

Samples

Each enclosure sample is printed from a Build design (for example the vented ESP32-C5-DevKitC-1 enclosure) with only the wall thickness changed. For each sample we record:

  • material, the filament product name and colour (pigments and fillers vary between products)
  • wall thickness in mm, measured with calipers next to the antenna
  • printer, nozzle, layer height, perimeters and infill
  • whether the enclosure is closed or vented near the antenna

We print at least two wall thicknesses per material. A result covers only the samples tested. It does not extend to other filament products, colours or designs.

Order: bracketed baselines

Conditions drift during a session: people move, neighbouring networks change, the room warms up. To keep drift out of the delta, every enclosure block sits between two open-board blocks. The delta compares each enclosure block with the two open blocks either side of it.

OpenSample AOpenSample BOpendelta A: A against both neighboursdelta B: B against both neighbourstime
Order of trials in one session. Each enclosure sample is measured between two open-board blocks, and its delta is taken against those two neighbours, so slow drift affects both sides of the comparison.

Within each block, every trial is a refit: the board (or the enclosure) is taken out of the jig and put back before the trial. Five refits per block and per band is the minimum. Bands alternate within a block (2.4, 5, 2.4, 5, …).

Procedure

Run from the repository root with the iotfieldguide Python environment, with the keys in tools/bench/env.example set in .env. The firmware is the stock example, flashed once:

python tools/bench/bench.py flash --port <port> --idf-example wifi/iperf --target esp32c5

Start iperf -s -i 1 on the wired host. Then, for every trial, run one capture with the send file for the band and the metadata of the block. All trials of one session at one position go into one folder:

python tools/bench/bench.py capture --port <port> --seconds 60 --reset \
  --send tools/bench/send/iperf-tx-5g.txt --expect tools/bench/expect/idf-wifi-iperf.txt \
  --board-rev "ESP32-C5-DevKitC-1 v1.2" --test rf-loss-through-enclosures --example idf-wifi-iperf \
  --unit u1 --run-id rf-loss-through-enclosures-u1-a-s1 --append \
  --meta position=a --meta band=5 --meta block=2 --meta condition=sample-a --meta material=PETG \
  --meta filament="<product, colour>" --meta wall_mm=2.0 --meta refit=3 --meta ap_model="<model>" \
  --meta channel=<n> --meta width_mhz=20

For open-board blocks use --meta condition=open and leave out the material fields. After the session:

python tools/bench/iperf_summary.py content-data/measurements/rf-loss-through-enclosures-u1-a-s1
python tools/bench/bench.py record --run rf-loss-through-enclosures-u1-a-s1 --test rf-loss-through-enclosures \
  --device esp32-c5-devkitc-1 --units 1 --instrument "ESP-IDF iperf example, RF test jig" \
  --settings "position A; 20 MHz; <channels>; samples <list>" --summary "<see summary.csv>"

How the deltas are computed

From summary.csv, for each enclosure block and band:

  1. Take the median RSSI of the block’s trials, and the median RSSI of the trials in the two open blocks either side.
  2. The RSSI delta is the first minus the second. A negative value means less signal with the enclosure.
  3. The throughput delta is computed the same way from the per-trial mean throughput, at position B.
  4. The repeatability is the range (maximum minus minimum) of the open-board trials over the whole session, per band.

A delta smaller than the open-board range is reported as “not resolved by this test”, with its value, and is not described as a loss. RSSI arrives as a whole number of dBm, one value per connection, so small differences need many refits before they mean anything.

Raw data

The files are those of the throughput-and-range method: serial-NN.log, run-NN.json with the block, condition, material, filament, wall thickness and refit number in meta, and summary.csv. A samples.md file lists each enclosure sample with its print settings. A photo of each sample may be added after it has been checked for anything that identifies the bench (see the site’s anonymity rules).

Known sources of error

  • Refit repeatability. Small changes in how the board sits in the jig or in the enclosure move RSSI. The open-board range measures this, and the bracketing design limits drift.
  • Fit inside the enclosure. The board’s position relative to the wall changes the result. We record the design and print the samples on one printer.
  • Body and cable. The person refitting the board must leave the path before each trial starts. The USB cable routing stays fixed.
  • RSSI resolution and calibration. Integer dBm, one value per connection, from the chip’s own estimate. We compare deltas on one board, not absolute values across boards.
  • Throughput saturation. Near the access point, throughput may not change even when the signal does. That is why throughput deltas are read at position B only.
  • The environment. As in the throughput method, another room, access point or building will give different absolute numbers. The deltas are less sensitive to this, but they are not immune.

How results are reported

For each sample and band: the RSSI delta and throughput delta, each with the minimum and maximum over the sample’s refits, the open-board repeatability for the same session, the number of refits and units, and whether the delta is resolved. Each result lists the materials, filament products, colours, wall thicknesses and print settings, the jig and its print status, the positions, the access point model and firmware, channel and width, the firmware commit and the ESP-IDF version. No result is presented as a property of a material in general.

For makers

If the board in your enclosure drops off the network, test before you redesign. Run five open trials, five enclosed and five open again on the band you use. If the enclosed median is inside the open range, the enclosure is not your problem. Look at the position and the access point first.

For product teams

Read the module maker’s antenna integration guidance before you choose a material or a wall thickness. Use this method to compare candidate materials early, on both bands, and keep the raw data with the enclosure revision so a later change of filament supplier can be checked against it.

Results

No results are published yet. The first bench runs are queued; results appear here with raw data once they are done.

What this page adds: A repeatable in-versus-out enclosure test for printed cases on 2.4 and 5 GHz: fixed jig, bracketed open-board baselines, a stated resolution limit and exact runner commands.

Sources

  1. ESP-IDF v6.1.1 iperf example README — Espressif Systems, v6.1.1
  2. ESP-IDF v6.1.1: esp_wifi.h — Espressif Systems, v6.1.1
  3. ESP32-C5 Series Datasheet — Espressif Systems, v1.5, 3 September 2026

Last verified 28 November 2026.