Chain detection

Hi all,

I need some help with the setup of my project. I'm trying to make my own nanoleaf LED panels. Since a couple of days I'm working on the mechanical and electrical parts of this project and now continuing with the programming of it. To give some more information about the project I have made a simple picture of a possible setup of the panels in the project, shown below:

Each panel has the shape of a triangle, which will consist of a microcontroller and a WS2812B LED strip (for now, maybe later on using other type of LEDs). The panels (nodes) will be chainable as shown in the picture below:

The red node will be the master which will be controlled by an ESP32 connected to WiFi to adjust settings and set color schemes (the microcontroller for the slaves is not chosen yet!). The way I see it is that the ESP32 will get a start and end color, calculates all colors in between for each node from start to end and send that color the the microcontroller for that specific node. This is easily done when the project consists of a default layout and number of nodes. But now I'm trying to create it that the master will count the number of chains, the amount of nodes and to give each node a unique ID which is easily mapped to the physical layout (such that it is possible to set each chain individually). The problem is that I can't think of anything to get this working, so I thought maybe someone here can help me further with this problem.

Thanks,

Bennie

Is this a mesh network where each node can only communicate with its 3 closest neighbours? If so what is a ‘chain’ in this context? With a large number of nodes you could have circles within circles and overlapping circles. Would each of these be a chain?

If it isn’t a mesh network, is it a message bus where every node can talk directly to every other node? Again, what is a ‘chain’ in this context.

If your goal is to build a map then it’ll need to be mesh so that each node can report back the IDs of the neighbours in the NE, SW and S directions.

If the triangles are one color each you might consider finding WS2811/12 led strings instead of led strip. Led strings have appx 3" (75mm) wire between the bulbs.

I bought 12mm diffused bulbs but clear bulbs are an option to illuminate your diffusers. They were $14 for 50 wired bulbs, could put 3 per triangle though 1 at 40mA bright (2 junctions at full 20mA ea) -is- really bright! I run them at half or less as Christmas tree lights in a lit room.

They don't do 3-way connects but the software that drives the string should be able to simulate that.

If each triangle is controlled from the RED/Prev link, each triangle has an address based on the sequence of BLUE/YELLOW junctions starting at the controller. The controller tells the first triangle that its address is "" (the empty string). That triangle then tells the one on its Blue side that its address is "B" and the triangle on it's Yellow side that its address is "L". Then "B" talks to BB and BL and L talks to LB and LL... Very quickly all of the triangles will know where they are relative to the controller.

Or you could use binary. The first triangle would be 1, then 10 and 11. Then 100, 101, 110, and 111. With an 'unsigned long' address you could have triangles as far as 32 steps from the controller.

All of the addresses can be mapped on a regular grid of triangles and roughly mapped onto a 2D array.