FilamentFilament

WLED 2D mapping

How to 2D map your WLED: ledmap.json from your real layout

WLED's 2D effects play on a rectangle, and the strips you built probably aren't one. A WLED LED map (ledmap.json) tells WLED where each LED really sits, but by hand it's a long list of LED numbers, one for every cell of the grid. In Filament you draw the strips over a photo of the rig instead, and File → Export to WLED makes the map and sends it to the board. Exporting is free in the trial.

What a WLED LED map does

WLED draws its 2D effects on a grid of cells, so many columns wide and so many rows high. ledmap.json tells it which cell each of your LEDs sits in, and a cell with no LED stays empty. With the map on the board, WLED's own 2D effects play across the shape you built, curves, gaps and all, instead of a rectangle.

Writing that file is the hard part. Filament works it out from your drawing.

2D map your WLED in four steps

  1. Draw your strips on the Canvas in the order they're wired, with their LED counts. A photo of the installation as the Canvas backdrop lets you trace them where they really are.
  2. Choose File → Export to WLED… and pick the Surface. The preview shows WLED's grid with a dot for each LED.
  3. Set Detail, the number of grid cells along the longer side, or leave it on Auto, which picks the smallest grid where no LED has to move more than one cell. With a board chosen, the slider ends at the largest grid that board has memory for.
  4. Pick the board in Send to and click Send. Filament uploads the map, switches the board to it and resets its segments to the new grid. Then choose a 2D effect in WLED as usual.

Reading the preview

Each grid cell holds one LED. Where LEDs sit closer together than a cell, one moves to a free neighbouring cell, shown in amber, or, with no free cell nearby, is left out, shown with a red cross. The line under the slider counts it up: in the screenshot above, a 30 × 34 grid holds 339 LEDs in 1,020 cells, and 13 LEDs moved.

A finer grid places LEDs more precisely but uses more of the board's memory and makes effects slower, because WLED draws every cell, empty or not. Filament won't send a grid the board has no memory for.

LEDs are numbered in wiring order, the same way Filament addresses them when it plays live. Disabled curves and LEDs are left out.

Send it, or save ledmap.json

Send replaces the LED map on the chosen board and resets its segments, and the dialog says so under Send to before you click. Save File… writes ledmap.json instead: upload it on the board's /edit page and restart the board.

Export to WLED needs WLED 16 or later on the board.

When the map doesn't take

  • Filament asks you to update WLED to 16 or later: update the firmware from WLED's own page, or use Save File… with a board that runs 16.
  • The map was uploaded but WLED didn't switch to it: restart the WLED.
  • The map needed more cells than the board now has memory for: its free memory dropped since Filament read it. The dialog has already refitted the grid, so click Send again.
  • WLED can't address an LED past index 65,535, and the dialog says so when a map has one.

Or play live from Filament

The same WLED can take Filament's live output: video, animations and effects mapped onto the same drawing. Add the WLED, tick its outputs, and Filament sets the board up for Filament in one step, LED chip included. It shows every change before it writes anything, reads the board back to check it took them, and Revert puts back what a setup changed.

After sending a map, choose Play live from Filament or run Set Up for Filament. It turns off WLED's Respect LED Maps, which would otherwise send Filament's live output through the map.

Questions

What is ledmap.json in WLED?
It's the file WLED reads its LED map from. For a 2D map it holds the grid's width and height and a list of LED numbers laid out over the grid, with -1 where a cell has no LED. Filament writes it for you from your drawing.
Can WLED play 2D effects on a layout that isn't a rectangle?
Yes, with an LED map. Draw the layout in Filament, and Export to WLED puts each LED in the grid cell where it really sits. Cells with no LED stay empty, so WLED's 2D effects follow the shape you built.
Which WLED version do I need?
Export to WLED needs WLED 16 or later. Setting a board up for live playback from Filament works from WLED 0.15.
Does Filament have to keep running after the export?
No. The map is stored on the board, and WLED plays its own 2D effects with it.
Is exporting a WLED LED map free?
Yes. Export to WLED is free in Filament's trial.
How do I use Filament's live output after sending a map?
Choose Play live from Filament after sending, or run Set Up for Filament. Either one turns off WLED's Respect LED Maps, so Filament's live output isn't sent through the map.