# Hard coding segments

**URL:** <https://wled.discourse.group/t/hard-coding-segments/12355>\
**Category:** Projects\
**Created:** [July 31, 2024, 1:01pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355 "2024-07-31T13:01:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deeb1999](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/deeb1999/32/8132_2.png) [@Deeb1999](https://wled.discourse.group/u/Deeb1999)\
**Post date:** [July 31, 2024, 1:01pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/1 "2024-07-31T13:01:27Z")

</div>

I am trying to hardcore segments.  
I want to have predefined segments and can not be edited or deleted.

Can someone help with that?

---

<div class="post-metadata">

**Author:** ![divsys](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@divsys](https://wled.discourse.group/u/divsys)\
**Post date:** [August 1, 2024, 3:38am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/2 "2024-08-01T03:38:58Z")

</div>

Not sure if that is possible at all in WLED.

The closest I can think of would be to program WLED up the way you want it and then disable or set the WiFi to an unknown or “hidden” value.  
Essentially you would make it impossible to program and/or change anything in the setup.

Not sure how helpful that might be.  
What is your use case for this?

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [August 1, 2024, 5:18am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/3 "2024-08-01T05:18:35Z")

</div>

Not possible without heavy modifications.

---

<div class="post-metadata">

**Author:** ![Deeb1999](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/deeb1999/32/8132_2.png) [@Deeb1999](https://wled.discourse.group/u/Deeb1999)\
**Post date:** [August 1, 2024, 7:53am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/4 "2024-08-01T07:53:56Z")

</div>

Its gonna be a product with multiple parts or sections. So i still need the access to the wled for color changing and effects.  
The user will see the predefined parts. And can add more of their own

---

<div class="post-metadata">

**Author:** ![Deeb1999](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/deeb1999/32/8132_2.png) [@Deeb1999](https://wled.discourse.group/u/Deeb1999)\
**Post date:** [August 1, 2024, 7:55am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/5 "2024-08-01T07:55:36Z")

</div>

I am willing to do the heavy modifications. I just need to understand the logic of the code. I have reached to it. It is called makeSeg() in the jason.js file. I have tried to fiddle with it. But it seems there is another code somewhere thats blocking the new changes. As the html refreshes with the new adjustments and then removed it immediately.

---

<div class="post-metadata">

**Author:** ![Deeb1999](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/deeb1999/32/8132_2.png) [@Deeb1999](https://wled.discourse.group/u/Deeb1999)\
**Post date:** [August 1, 2024, 10:54pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/7 "2024-08-01T22:54:13Z")

</div>

Lets say i ran the wled on my eps32. I set the segments as i want.  
Is there a way to edit the html file that is already on the esp32?  
That way i can just disable the edit fields or remove them.

---

<div class="post-metadata">

**Author:** ![kilrah](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/kilrah/32/5927_2.png) [@kilrah](https://wled.discourse.group/u/kilrah)\
**Post date:** [August 2, 2024, 6:28am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/8 "2024-08-02T06:28:15Z")

</div>

Yes if you go to [http://ip/edit](http://ip/edit) you can edit the raw JSON

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [August 2, 2024, 6:32am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/9 "2024-08-02T06:32:06Z")

</div>

I am not providing help for commercial products. Sorry.

---

<div class="post-metadata">

**Author:** ![Deeb1999](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/deeb1999/32/8132_2.png) [@Deeb1999](https://wled.discourse.group/u/Deeb1999)\
**Post date:** [August 2, 2024, 8:22am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/10 "2024-08-02T08:22:00Z")

</div>

I appreciate your honesty. And i understand your concern.  
But I am not planning to remove the wled branding from it. And hopefully if the product saw success i will be donating.  
And of course the modified code will be uploaded.  
I am not planning to be taking without giving back

---

<div class="post-metadata">

**Author:** ![Deeb1999](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/deeb1999/32/8132_2.png) [@Deeb1999](https://wled.discourse.group/u/Deeb1999)\
**Post date:** [August 2, 2024, 8:31am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/11 "2024-08-02T08:31:37Z")

</div>

Sorry i have not noticed that you are one of the programmers.  
Maybe if you would like we can make a deal if you are willing to communicate

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [August 2, 2024, 10:18am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/12 "2024-08-02T10:18:27Z")

</div>

I have no issues with commercial use of WLED but if you intend to modify it (regardless of branding included or not) for your particular needs you will need to delve into the code yourself or find someone else as I don’t do paid work for WLED.

If your product succeeds (and I hope it does) I hope you’ll keep your word. 😉

Consider that I am donating every day (in the form of hours spent; for people like you to earn some money if they can) without expecting anything in return.

---

<div class="post-metadata">

**Author:** ![Lights](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/lights/32/9860_2.png) [@Lights](https://wled.discourse.group/u/Lights)\
**Post date:** [May 20, 2025, 8:43pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/13 "2025-05-20T20:43:54Z")

</div>

I’m running 99 Adafruit NeoPixel RGBW Mini Button PCB’s on a chandelier I’m designing and having difficulty getting WLED to work right. It is lighting, but uncontrollably, responding to input from my phone but not responding as expected (sometimes ‘organized colors’, other times ‘blinking’. I’m running them off an ESP32-WROOM-32. All grounds are connected. Steady 5.2 VDC. Data goes from GPIO5 through a 74LV245A level shifter to the 99 NeoPixels. Any ideas why they’re not behaving?

---

<div class="post-metadata">

**Author:** ![dedehai](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/dedehai/32/7265_2.png) [@dedehai](https://wled.discourse.group/u/dedehai)\
**Post date:** [May 21, 2025, 5:44am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/14 "2025-05-21T05:44:33Z")

</div>

> [@Lights](#):
>
> 74LV245A

incorrect shifter. it may work if you lower the shifter supply to 4.7V.  
also: why post in a random thread?

---

<div class="post-metadata">

**Author:** ![Lights](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/lights/32/9860_2.png) [@Lights](https://wled.discourse.group/u/Lights)\
**Post date:** [May 21, 2025, 1:57pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/15 "2025-05-21T13:57:18Z")

</div>

Hello, and thank you for responding. I am a retired K-12 special education teacher and long-time wood sculptor who ‘branched out’ into design & development after realizing my body was not going to be able to continue the physical requirements of wood carving. I learned how to use Blender and designed a 3 1/2’ x 3’ (dia.), chandelier that I want to light with 99 Adafruit NeoPixel Mini Button PCB’s (NeoPixels). It is turning out great but I’m having problems controlling the pixels.  
I just signed up for the community forum yesterday so I probably don’t know how to find the correct forum to post my question to. I will try to do better.

---

<div class="post-metadata">

**Author:** ![dedehai](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/dedehai/32/7265_2.png) [@dedehai](https://wled.discourse.group/u/dedehai)\
**Post date:** [May 21, 2025, 2:34pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/16 "2025-05-21T14:34:50Z")

</div>

no worries, it was just odd to pick a completely unrelated topic and ask a question (as you can see the topic here is: “Hard codeing segments” which is completely unrelated to your issue)

---

<div class="post-metadata">

**Author:** ![Lights](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/lights/32/9860_2.png) [@Lights](https://wled.discourse.group/u/Lights)\
**Post date:** [May 21, 2025, 3:38pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/17 "2025-05-21T15:38:03Z")

</div>

The chandelier I designed is a hexagon, six sides (segments). The first thing I try to do is make the six segments, with hopes of coordinating them. Unfortunately, I don’t know how to correctly fill out the information on the Wifi Settings portion of WLED , so it connects to my home router, and can only log onto WLED-AP, and therefore, when I make my segments, they disappear the next time I log on. //Just noticed that my home network, Cherry12-2.4G, is showing up twice on a WiFi scanner. This may be my problem!//

Once WLED works, and I can make/save segments, I will be using them.

 ![20250223_121401.jpg](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/4/45d4cb0d7a34d8ec8a24236bb29118ee835d5127.jpeg)

---

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://wled.discourse.group/u/Jinx)\
**Post date:** [May 21, 2025, 5:47pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/18 "2025-05-21T17:47:46Z")

</div>

As far as a level shifter I would have a look here: [Other Hardware - WLED Project](https://kno.wled.ge/basics/compatible-hardware/#levelshifters) There is also loads of other info there.

If you are looking to use 6 different GPIO pins on your Esp I would have a look at using the 74AHCT245 chip or the 74HCT245. They both offer 8 i/o’s and there is a wiring diagram on the linked page above as well. For convenience here is said diagram:

 ![](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/3/32c59f763bbaf0464758819e1816be6d7ff625d0.jpeg)

EDIT: If you are just using 1 GPIO then the standard 4 port chip would be plenty: SN74AHCT125 Wiring diagram is also on the page linked above.

Segments, Fx, Palette (colors) and Brightness are all saved by way of creating ‘presets’. So if you want more than 1 segment saved you need to create a preset of your settings. If you want said preset to load when the system boots you need to set that saved preset as the ‘Boot Preset’ in Led Preferences settings.

To configure your Wifi, all you need to do is enter/select your routers ssid from the list and enter it’s password. If done correctly and if you are in decent range of the router/access point it will connect to your network. Keep in mind that only 2.4ghz wifi is supported. If you have 2 listed as that maybe you somehow named your 5g and 2.4g in the router the same? I would login to your routers admin panel and see what your wifi networks are named. \*it is also a good idea to setup a static/reserved IP from within your routers config so that your Esp will always have the same IP.

-As an observation of your pic if you don’t already have a lot invested you may want to look at using addressable LED strips or seed pixels as they would provide a much better density vs all of those little led modules. Depending on what covering you will be putting over them what you have there may create bright spots vs a smooth look.

---

<div class="post-metadata">

**Author:** ![Lights](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/lights/32/9860_2.png) [@Lights](https://wled.discourse.group/u/Lights)\
**Post date:** [May 25, 2025, 7:19pm UTC](https://wled.discourse.group/t/hard-coding-segments/12355/19 "2025-05-25T19:19:20Z")

</div>

Jinx,  
Thank you so much for the tips. I really appreciate it!  
My internet provider came over yesterday and said that my signal is as strong as it can be without putting in more hardware (no). The chandelier I’ve designed isn’t huge, but is intended to be installed in a large(ish) home/building. My shop is about 100’ away from the modem/router. I’m thinking this would be a typical installation problem (poor chip communication with router), now, in the development phase, there will likely be a problem down the road, so I decided to order an ESP32-WROOM-32U (the same chip with an antenna), hopefully boosting the signal enough to provide for clean transmission.  
Right now the WLED home page loads and appears exactly like it’s supposed to. I am able to access all of its functions. Symptoms: When I click on a program, like ‘Fireworks’, ‘Meteor’, ‘Chase’, if I slow it down a little, turn the intensity down a little, the pixels clearly respond to my command, but not cleanly, with intermittent color changes and flashes of white. Could this be a level shifter issue and benefit from the changes you suggested?  
I don’t want to use a NeoPixel ‘strip’ and have designed a ‘Pixel Plug’, that will hold the ‘face’ of the NeoPixel to the surface of the chandelier, hiding the PCB and wires.  
Thank you again for your input!  
George Rickert  
Full Moon Sculptures  
[https://www.fullmoonsculptures.com/](https://www.fullmoonsculptures.com/) (there are some ‘Videos’ of the development of this project)

---

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://wled.discourse.group/u/Jinx)\
**Post date:** [May 26, 2025, 12:15am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/20 "2025-05-26T00:15:08Z")

</div>

> [@Lights](#):
>
> Symptoms: When I click on a program, like ‘Fireworks’, ‘Meteor’, ‘Chase’, if I slow it down a little, turn the intensity down a little, the pixels clearly respond to my command, but not cleanly, with intermittent color changes and flashes of white. Could this be a level shifter issue and benefit from the changes you suggested?

The level shifter would likely help with that problem. How far from the first pixel is the Esp32? If you want less work in the level shifter department this already has the 4 port shifter on a pcb: [Level Shifters - SN74AHCT125 (Pack of 4) – RGB 2 Go](https://rgb2go.com/collections/controllers/products/level-shifters-sn74ahct125-pack-of-4)

100ft away from your router would for sure be better with an antenna version. I would suggest adding an 8 or 10dbi antenna. I have used these 8 dbi’s, but often times switched them out to 10dbi ones I got off ali express: [Amazon.com](https://www.amazon.com/dp/B082SHBWTK)

Another option to extend your wifi network would be to add a wifi extender about 1/2 way between the router and the device(s) you want connected. Suggested option at a reasonable price: [Amazon.com](https://www.amazon.com/Wifi-Extender-Booster-Wireless-Repeater/dp/B08RHD97QY)

> [@Lights](#):
>
> I decided to order an ESP32-WROOM-32U (the same chip with an antenna), hopefully boosting the signal enough to provide for clean transmission.

If you are looking for a smaller form factor Esp you could use an Esp32-Cam board.  
It has the option of using an external antenna \*\*\*But you need to remove the 0ohm onboard antenna resistor and then bridge the 1 pad to another pad that enables the external antenna jack. \>This requires VERY fine/small detail soldering skills\< Here is a link to an Esp32-Cam board that also includes the serial adapter for flashing, if that is something of interest. [Amazon.com](https://www.amazon.com/YEJMKJ-Development-ESP32-CAM-Bluetooth-ESP32-CAM-MB/dp/B0CDRNJKSF)

---

<div class="post-metadata">

**Author:** ![Lights](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/lights/32/9860_2.png) [@Lights](https://wled.discourse.group/u/Lights)\
**Post date:** [May 29, 2025, 12:10am UTC](https://wled.discourse.group/t/hard-coding-segments/12355/21 "2025-05-29T00:10:21Z")

</div>

Thanks again Jinx. I ordered a couple of the level shifters you recommended. They should be here any day. Thanks for your input!  
George  
Full Moon Sculptures
