ESP-8266 Art-Net NeoPixel module

As explained in a previous post, for the EEGsynth we want to use a neopixel array that can be controlled wirelessly using the DMX512 protocol. I purchased a number of Adafruit neopixel rings with 12, 16 and 24 elements respectively. Each RGBW pixel contains a red, green, blue and white LED. For the 24-pixel ring that means that there are in total 4*24=96 LEDs of which the intensity can be set.

The ESP-8266 module is a versatile WiFi module that comes in many versions. During development I especially like the NodeMCU version, which mounts the ESP-12 module on a development board with USB connection, and the even smaller Wemos D1 mini board. The Wemos D1 mini is hardly more expensive on Ebay than the simpler bare-bone ESP-8266 modules.

The hardware connection is simple: I connected Vcc and GND directly to the Wemos D1 mini board, and connected pin D2 to the data-in of the first pixel. Although the Neopixels are specified for 5V, in my experience the Adafruit rings also work fine at 3.3V, both for power and for the serial control signal. Each LED can take up to 20 mA when fully bright, which means that all LEDs of the 24-pixel RGBW ring can take up to 24*4*20 = 1920 mA, or close to 2 A. However, not all LEDs will be at full intensity at the same time, and driving them with 3.3V rather than 5V further reduces the current. I encountered no issues powering them over the USB port of my MacBook.

For the EEGsynth we want to map a small number of control signals to aesthetically pleasing light effects. E.g. it can control the hue, the frequency with which the array flashes, or the speed with which a bright bar rotates along the ring.

I implemented the firmware as an Arduino sketch that combines a number of features. It incorporates ConfigManager for the OTA (over-the-air) configuration of the WiFi network to which it should connect. Once connected to the local wifi network, he ConfigManager also allows updating specific settings in EEPROM over a POST call to a specific URL. Settings include the number of pixels of the attached Neopixel array, whether they are RGB or RGBW, and most importantly: the mode with which the controller maps the control signals onto the LED behaviour.

The firmware listens to the Artnet protocol messages that it receives as UDP packets. The Artnet packets can be sent by the EEGsynth outputartnet module, but also by general purpose Artnet software, such as JV Lightning DmxControl, LightKey or QLC+.

The first mode that I implemented allows for full control of all LEDs. It maps the DMX512 channels like this

mode 0: individual pixel control
channel 1 = pixel 1 red
channel 2 = pixel 1 green
channel 3 = pixel 1 blue
channel 4 = pixel 1 white
channel 5 = pixel 2 red
etc.

The simplest overall uniform color mode is implemented like this:

mode 1: single uniform color
channel 1 = red
channel 2 = green
channel 3 = blue
channel 4 = white
channel 5 = intensity

This allows 3 channels (for RGB) or 4 channels (for RGBW) to control the color, and one channel to control the intensity. The intensity channel is in principle redundant, but makes the control much easier.

I implemented many more modes, including blinking/flashing of one or two colors, segments that can be moved over the ring (of which the color and position can be controlled), segments that automatically move around the ring (of which the color and speed can be controlled). The modes are all documented in code and in the README document included with the Arduino sketch in my Github repository.

The video below demonstrates one of the modes, controlled by the launchcontrolXL module of the EEGsynth. This shows the ESP-8266 Artnet neopixel module connected both to a 24-pixel Neopixel ring, and to a 144-pixel LED strip. I will document the hardware details of the LED strip in a follow up post.

On my YouTube channel you can find more examples, including a special Christmas tree mode 😉

45 thoughts on “ESP-8266 Art-Net NeoPixel module

  1. Kgreene

    This is great..
    Were is the actually code for the project. I’m just getting used to github…… Are there any libraries I need?

    Reply
    1. Robert Post author

      The specific code is included in a larger repository with Arduino code which is here, where the specific code is here. There are indeed a number of libraries that you need, which you can install using the “manage libraries” option in the Arduino IDE. Look at the includes at the top of the sketch (i.e. in the *.ino file). You also need to install the ESP-8266 board using the “additional boards manager” in the Arduino preferences.

      Reply
    2. Kevin Greene

      Hey Rob..

      How many pixels can this run?

      Also can I change the Universe Number or the DMX start address

      Reply
      1. Robert Post author

        I have used it with a 5 meter strip with 300 pixels, i.e. 900 LEDs. But that was with a pre-defined pattern, i.e. scrolling or sliding a certain color, hence the number of ArtNet values to be transmitted is limited to 10 or so. The individual pixel control “mode 0” is restricted to 500/3=166 pixels.

        The universe number is one of the configurable parameters.

        Reply
        1. Kevin Greene

          Hey Rob,

          Thanks for the quick response.

          I can access the web interface. But when I press send….

          192.168.1.76 didn’t send any data.

          ERR_EMPTY_RESPONSE

          Reply
          1. Kevin Greene

            Serial monitor says

            23:22:45.504 -> loadConfig
            23:22:45.878 -> Failed to open config file
            23:22:46.891 -> *wm:[1] AutoConnect
            23:22:46.891 -> *wm:[1] AutoConnect: ESP Already Connected
            23:22:46.891 -> *wm:[2] setSTAConfig static ip not set, skipping
            23:22:46.891 -> *wm:[1] AutoConnect: SUCCESS
            23:22:46.891 -> *wm:[1] STA IP Address: 192.168.1.76
            23:22:46.891 -> connected
            23:22:46.891 -> setup done

            and when trying to change settings,,

            23:22:46.891 -> connected
            23:22:46.891 -> setup done
            23:23:16.335 -> handleRedirect
            23:23:16.371 -> handleStaticFile
            23:23:16.445 -> handleNotFound
            23:23:16.445 -> handleStaticFile
            23:23:18.207 -> handleStaticFile
            23:23:18.313 -> handleNotFound
            23:23:18.658 -> handleStaticFile
            23:23:18.692 -> handleNotFound
            23:23:18.692 -> handleStaticFile
            23:23:19.964 -> handleNotFound
            23:23:19.964 -> handleStaticFile
            23:23:29.282 -> handleJSON
            23:23:29.282 -> HTTP Request
            23:23:29.282 ->
            23:23:29.282 -> URI: /json
            23:23:29.282 -> Method: POST
            23:23:29.282 -> Arguments: 12
            23:23:29.282 -> universe: 1
            23:23:29.315 -> offset: 0
            23:23:29.315 -> pixels: 12
            23:23:29.315 -> leds: 3
            23:23:29.315 -> white: 0
            23:23:29.315 -> brightness: 255
            23:23:29.315 -> hsv: 0
            23:23:29.315 -> mode: 0
            23:23:29.315 -> reverse: 0
            23:23:29.315 -> speed: 8
            23:23:29.315 -> split: 1
            23:23:29.315 -> plain: universe=1&offset=0&pixels=12&leds=3&white=0&brightness=255&hsv=0&mode=0&reverse=0&speed=8&split=1
            23:23:29.315 ->
            23:23:29.315 -> handleStaticFile
            23:23:29.695 -> File Not Found

  2. Sean

    Feeling kind of stupid here. I got the code loaded, even connected to my wifi. However when I attempted to CURL the config. curl -X PUT -d ‘{“universe”:1,”offset”:0,”pixels”:13,”leds”:3,”white”:0,”brightness”:100,”hsv”:0,”mode”:1,”speed”:8,”position”:1,”reverse”:0}’ 192.168.1.254/json
    I got an error in the serial monitor. I re-flashed the Wemo and now I get
    loadConfig
    Failed to open config file
    *WM:
    *WM: AutoConnect
    *WM: Connecting as wifi client…
    *WM: Using last saved values, should be faster
    I am unable to return to AP mode, no longer see the Wemo on the network and cannot update it on the fly. When I reflashed I included the data folder in the upload, missed that the first time. What am I missing?

    Reply
    1. Robert Post author

      If you have a Neopixel LED strip attached and if it were decently configured, the color of the first LED indicates the status (connecting, connected, http-access). But more robust is to look in the serial monitor. After the “*WM” messages there should be more printed in the monitor (such as the IP address). Please have a look at that. If it does not get further than the “Using last saved values” message, something is wrong. I recommend you refresh the firmware and the SPIFSS data.

      Reply
  3. Sebastian

    loadConfig
    Failed to open config file
    *WM:
    *WM: AutoConnect
    *WM: Connecting as wifi client…
    *WM: Using last saved values, should be faster
    *WM: Connection result:
    *WM: 3
    *WM: IP Address:
    *WM: 192.168.1.13
    connected
    setup done
    But I cannot get to the config page…I uploaded data to spiffs what I done wrong ??

    Reply
    1. Robert Post author

      there will be something appearing on screen when you connect to http://192.168.1.13. If it is “cannot connect” then there is something wrong with your network settings. If it is “file not found” then there is something wrong with the SPIFFS upload.

      Reply
  4. Thomas

    Hi Robert, you did a nice job which will helped me to start with these types of LED stripes.
    I have modified your code to use E1.31 re sACN i/o ArtNet as this is the protocol I used in my other projects.
    In addition I am using APA102 i/o NeoPixel.
    As I am not able to add this to your project on GitHub, I have created project in my account. If you would like to intergate this into your project , I will delete this: https://github.com/ThomasH-W/esp8266_e131_DotStar

    Other than that I had to create the file config.json in the data directory to overcome “file not found” issue.

    Reply
    1. Robert Post author

      Hi Thomas,
      Thanks for the feedback, glad you like it! I don’t think it is likely that I will soon integrate the changes you made for E1.31 and for APA102. Both would require some studying and testing. I appreciate that you are sharing your version of the code on github, please keep it there. I do hope that in the future I’ll find the time and opportunity to look at it in detail.
      Best regards, Robert

      Reply
  5. Pingback: APA102 LED Stripe controlled by ESP8266 using E1.31 – Thomas Höser

  6. Horst

    Hi Robert!
    Great work, this exactly what i need.
    But i am a totally newbee with esp8266 and not able to compile your code. It always ends with exit code 1.
    Can you please tell me the versions of the libraries you used?

    best regards
    Horst

    Reply
    1. Robert Post author

      Thanks for the compliments. I am using the latest versions of all libraries, which I install and regularly update using “Sketch -> Include Library -> Manage Libraries”. Specifically, I am using

      Using library ESP8266WiFi at version 1.0 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi
      Using library ESP8266WebServer at version 1.0 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WebServer
      Using library ESP8266mDNS in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS (legacy)
      Using library WiFiManager at version 0.14 in folder: /Users/roboos/Documents/Arduino/libraries/WiFiManager
      Using library DNSServer at version 1.1.0 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/DNSServer
      Using library ArtnetWifi at version 1.1.0 in folder: /Users/roboos/Documents/Arduino/libraries/ArtnetWifi
      Using library Adafruit_NeoPixel at version 1.1.7 in folder: /Users/roboos/Documents/Arduino/libraries/Adafruit_NeoPixel
      Using library ArduinoJson at version 5.13.2 in folder: /Users/roboos/Documents/Arduino/libraries/ArduinoJson

      Oh, there is one library that is not the latest: for ArduinoJson I am using 5.13.2, whereas the latest version is 6.7.0-beta. I tried the 6.x branch once for another project, but had problems and reverted. According to the ArduinoJson documentation here, it is also recommended to use the 5.x version over the 6.x-beta version.

      Reply
  7. Peter Leibold

    This is fantastic, Robert. Thank you for sharing.
    I’ve had good luck with most of it, but I have a couple of questions if you don’t mind! I will admit that I’m not an expert programmer, so I hope this isn’t too basic. I’m a theatrical lighting designer, running 16 pixels of RGB on a WeMos D1 Mini Clone, and sometimes it works beautifully.

    For some reason I am unable to update over the air. When I get to the Change Settings page, I put in new information and then click save, but receive an error that the unit sent no data back. If I go to the [IP address]/json, I see that the updates have not happened and that it’s still running the settings I loaded in on the initial firmware flash. Do you have any thoughts as to why this could be?

    Secondly, at times the pixels appear choppy as though it’s having trouble processing the information. It doesn’t seem to be related to distance from the router. Do you have any thoughts as to changes I could make to help speed it up?

    And finally, what does the Offset setting do in the code? I thought it might start the addressing at universe 1 address 101 when I put 100 in there, but that doesn’t seem to be the case.

    Thanks again, you’ve created something fantastic here.

    Reply
    1. Robert Post author

      Hi Peter, thanks for the feedback!

      With “update over the air” you mean “change settings” (2nd option) or “update firmware” (last option)? The code underneath “update firmware” is copied from somewhere, but it never reliably worked for me. That still needs to be debugged. The “change settings” however should work… I cannot check it myself right now, but perhaps you can give more details.

      The choppy behavior of the pixels surprises me; I used it with LED strips of up to 300 pixels and that runs smooth, i.e., the moving and blinking patterns are smooth. See e.g. https://www.youtube.com/watch?v=zGxAIAKqi04. I could imagine that a generally busy WiFi environment taxes the ESP chip, which constantly has to switch between the Arduino code that drives the neopixels and the wifi handling. Or is it that the updates you send for mode 0 (individual pixel control) are not immediately processed? I don’t have much experience with that, but could give it a try with a 12 pixel LED ring.

      Offset (minus one) should behave as you describe, i.e., the first 99 items of the received DMX packet should be ignored so that DMX packet value 100 ends up on pixel 1. But I see on line https://github.com/robertoostenveld/arduino/blob/080945494c4f9903c10332dbad0eda696e98cef7/esp8266_artnet_neopixel/esp8266_artnet_neopixel.ino#L73 that it is ignored. I’ll file this as issue, you can follow it at https://github.com/robertoostenveld/arduino/issues/13.

      best regards,
      Robert

      Reply
  8. Sam Chez

    Hi Robert,
    First of all, this project is awesome! Thankyou for sharing, I’ve been looking for something like this for a long time and only just happened across this by chance.
    I’m currently experiencing an issue when trying to change settings, similar to what another user recently described. When I make changes on the ‘change settings’ page, and hit save, it takes me to a blank page with ‘ERR_EMPTY_RESPONSE’
    In serial monitor I can see the update trying to push through, but I receive an error of file not found.
    This is the log I’m getting from serial monitor.

    handleJSON
    04:28:56.488 -> HTTP Request
    04:28:56.488 ->
    04:28:56.488 -> URI: /json
    04:28:56.488 -> Method: POST
    04:28:56.488 -> Arguments: 12
    04:28:56.488 -> universe: 1
    04:28:56.488 -> offset: 0
    04:28:56.488 -> pixels: 16
    04:28:56.488 -> leds: 4
    04:28:56.488 -> white: 0
    04:28:56.488 -> brightness: 255
    04:28:56.488 -> hsv: 0
    04:28:56.488 -> mode: 1
    04:28:56.488 -> reverse: 0
    04:28:56.488 -> speed: 8
    04:28:56.488 -> split: 1
    04:28:56.488 -> plain: universe=1&offset=0&pixels=16&leds=4&white=0&brightness=255&hsv=0&mode=1&reverse=0&speed=8&split=1
    04:28:56.488 ->
    04:28:56.488 -> handleStaticFile
    04:28:56.562 -> File Not Found

    If possible are you able to assist?

    Reply
  9. Paul

    There are some other issues.
    first one reload_failure.html should be reload_failed.html

    second
    JsonObject& root = jsonBuffer.parseObject(server.arg(“plain”));

    is not working, parsing fails, because or the “=” in the data. Like universe=0

    so I wrote a boring function to do the stuff:

    void serverToConfig(String x, String y) {
    if (x == “universe”) {
    config.universe = y.toInt();
    }
    if (x == “offset”) {
    config.offset = y.toInt();
    }
    if (x == “pixels”) {
    config.pixels = y.toInt();
    }
    if (x == “leds”) {
    config.leds = y.toInt();
    }
    if (x == “white”) {
    config.white = y.toInt();
    }
    if (x == “brightness”) {
    config.brightness = y.toInt();
    }
    if (x == “hsv”) {
    config.hsv = y.toInt();
    }
    if (x == “mode”) {
    config.mode = y.toInt();
    }
    if (x == “reverse”) {
    config.reverse = y.toInt();
    }
    if (x == “speed”) {
    config.speed = y.toInt();
    }
    if (x == “split”) {
    config.split = y.toInt();
    }
    }

    and add in handleJSON() the function in for loop:

    for (uint8_t i = 0; i < server.args(); i++) {
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
    serverToConfig(server.argName(i), server.arg(i));
    }

    Reply
  10. Gianluca

    Hello Robert,

    And thanks a lot for this nice piece of software!!

    I am really happy with it, but there is a small issue that I cannot seem to overcome.

    Basically, as some other guys around, I cannot manage to update the settings in the .json file unless I directly load them from the arduino ide.

    There are a couple of things that sound strange to me, the most relevant is probably the fact the the “position” attribute is always shown in /json with no value, a question mark is shown instead. By looking around in the code I see sometimes “position” is called and some others “split” is used, but I cannot by myself tell if this is causing the issue.

    What is even more strange is that the file is properly red at startup (even if with the original parameters) and that looking at the com port, when the value is sent to the esp8266, the command line reports the new settings instead. So basically it appears there is no way to overwrite the original file.

    By checking here and there I found that in one of the 3.js files a part of the code is commented out, I uncommented it but still no changes since the old file is used.

    Of course I cannot exclude to be using the wrong arduino json library, but I tried 4 or 5 differ t versions. Do you think you may check which one you were using at the time, so that we have a consistent version?

    I am sorry if this request is a bit confused but it reflects my state of mind today 🙂

    Thanks a lot in advance!

    Reply
    1. Robert Post author

      Hi Gianluca,

      These are confusing times, so don’t worry 😉

      I recall the “position” parameter at a certain moment in time being renamed in “split”. It allows splitting a long (say 300 pixel, 5 m) strip into separate pieces that all behave the same. Looking at the code, however, I don’t see where it might be going wrong.

      Can you head over to https://github.com/robertoostenveld/arduino/tree/master/esp8266_artnet_neopixel and point out in the code (i.e., as an issue, with the line numbers) where you think that “position” might be used incorrectly? I also don’t see it in the json or the config struct. Might it be that you have an older version of the code?

      Split should be a small integer number (say 1, 2, 3) and the variable “position” as it is now used in the code is only in https://github.com/robertoostenveld/arduino/blob/master/esp8266_artnet_neopixel/neopixel_mode.cpp and reflects the controllable feature, e.g. the position of the segment that moves back and forth, like https://youtu.be/oNyXYPhnUIs?t=10.

      Reply
      1. Gianluca

        Robert,

        Thanks a lot for the swift reply!

        I probably didn’t explain myself correctly and I hope you didn’t spent too much time (or time at all) checking that… I couldn’t find anything specific but having noticed that I thought it may play a role in my problem 🙁

        The strange this is that it is showing a ? even if I upload the config file directly from the ide, and also the fact it reads correctly but fails to write made me think it could deal with it.

        I know this is now a fairly old piece of code, but if you could think about anything that may cause a successful reading but failed writing it would be great…

        Funnily enough, months ago I managed to write a firmware myself that reads correctly from eeprom but lags with 100+ leds, now I am experiencing the opposite problem

        Reply
        1. Robert Post author

          Hi Gianluca,

          I checked with an old esp8266 with a 24 neopixel ring attached that I had not used for some time.

          Initially it was slow to respond on the web interface, but using https://lightning-dmxcontrol.com the LED control worked as expected. The web interface on http://192.168.2.197/json returned the following:

          {"universe":1,"offset":0,"pixels":24,"leds":4,"white":0,"brightness":255,"hsv":1,"mode":5,"reverse":0,"speed":8,"position":1,"version":"Jan 15 2017 / 17:04:26","uptime":416,"packets":859,"fps":99.00}

          Note that this includes the “position” parameter, and also note that the firmware was compiled and flashed in Jan 2017. Subsequently I compiled and wrote the latest version of the firmware, and also did “ESP8266 sketch data upload” to ensure that the html and javascript files were up to date. After that http://192.168.2.197/json returned the following:

          {"universe":1,"offset":0,"pixels":24,"leds":4,"white":0,"brightness":255,"hsv":0,"mode":1,"reverse":0,"speed":8,"split":1,"version":"Apr 8 2020 / 21:06:04","uptime":237,"packets":530,"fps":89}

          Note that it now has “split” instead of “position”. Also, the web interface was much more responsive, and (as expected) the LED control was still working.

          So if you see “position” in the web interface, you must have an old version of the firmware and/or data on your device.

          Reply
          1. Gianluca

            Dear Robert,
            thanks again for taking the time to check this!

            I will thoroughly look into this.

            I appreciate your help, if there is a way to virtually offer you a beer or similar just let me know! You have my mail address

  11. Gianluca

    I ame really sorry for all this subsequent comments…

    ot of curiosity, were you able to change the parameters via webserver? Like universe 2 instead of 1

    Reply
    1. Robert Post author

      ????????????

      Yes. I did not try changing the universe, but did change the “mode” in the web interface; that worked fine.

      Again I wonder whether you have the latest firmware: one of the changes that I made to the code had to do with sending large files over http, which initially caused the esp8266 sometimes to reboot due to a memory overrun. That was around here https://github.com/robertoostenveld/arduino/commit/70d6ea2ce7f6e968469a3f5dc71ff2dee14f98ba and https://github.com/robertoostenveld/arduino/commit/6e4ae51bfb386610cdc20446111cf9918ebc42e7. This had to do with getting the javascript libraries either from the esp8266 or from a CDN, and behaved differently if you were on a private wifi network not connected to the internet (as the CDN would not work in that case). Now it always serves the local file (see e.g. the settings.html), since http transmission of large files is fixed.

      Reply
  12. Trym Øien

    Hello. i am wondering if i can make it battery powered with 9 pixels and make the battery to last about 7hours?
    and is it possible to control the pixels directly from the esp12?

    Reply
    1. Robert Post author

      Sure, that will work if you take a sufficiently large battery. Whether it is practical I don’t know. Driving the pixels directly from an ESP12 is not a problem.

      I have not computed the power that it would take, but if you have all 9 pixels RGB all at the full intensity, it would draw about 9*3*20=540 mA. You should multiply that with the expected duty cycle, e.g. if you only expect one color to be on at any given time (rather than all three RGB simultaneous), the current would be only one third. And if the LEDs would blink (e.g. 50% on, 50% off), it might even be half of that. So perhaps 150 mA is more realistic.

      Batteries are rated in mAh, i.e. milliamperes times hours. A LiPo battery has a voltage that is high enough, and a battery like the 18650 can pack 2000 mAh or more: it delivers 2000 mA for one hour, or 500 mA for 4 hours, or 150 mA for 13 hours.

      I think that https://learn.adafruit.com/adafruit-neopixel-uberguide might have some useful considerations on this. Or see https://www.youtube.com/watch?v=qeuOuhKDdnU or other examples of mounting neopixels under skateboards. I also made a skateboard like that (sorry, not documented on my website); it has 60 pixels powered by two 18650 batteries and lasts slightly less than an hour.

      Reply
  13. Hendrik Walther

    Hi Robert,
    this is a great piece of software. I uploaded your code to a NodeMCU via the Arduino IDE, i could connect to the ARTNET network and change the network preferences. I can now access it via my own WiFi-network and the LEDs react to Artnet Input! But I can’t change any of the settings… Not via terminal and not via the web interface, because only the page 192.168.178.141/json is available. Every other page takes a too long time to load and the browser gives up on it…. Any idea on what is going on?
    Thanks in advance!
    Grote groet!

    Reply
    1. Robert Post author

      Hi Hendrik,

      You are correct that you cannot change any of the parameters via the (serial) terminal: the sketch only uses that for debug output, not for receiving any input. If only the network settings and the json are available through the web interface, I wonder whether you have uploaded the content of the “data” directory to the SPIFFS file system on the EEProm.

      best,
      Robert

      Reply
  14. Kevin Greene

    Robert – sorry for all the messages.

    I created a config.json with

    {
    “universe” : 1,
    “offset” : 0,
    “pixels” : 12,
    “leds” : 4,
    “white” : 0,
    “brightness”: 255,
    “hsv” : 0,
    “mode” : 1,
    “reverse” : 0,
    “speed” : 8,
    “split” : 1,

    }

    have the upload tool and everything completes…

    Now I have noticed is not turning red in the code.. Tried this on both my mac and windows..

    Could this be the issue? FS.h is part of the core of Arduino ESP framework, but it won’t let me install it.

    https://github.com/esp8266/Arduino

    Help!

    Reply
    1. Robert Post author

      I cannot tell whether you have successfully uploaded the content of the data directory to the SPIFFS filesystem on the esp8266.

      Please read the code, see what it prints out when the web interface on the esp8266 is opened, and open the web interface while the esp8266 module is connected to the serial interface. That is for example here https://github.com/robertoostenveld/arduino/blob/1c4f1a4fc31d6a538edcc08b8c285e03c8da18c0/esp8266_artnet_neopixel/esp8266_artnet_neopixel.ino#L130. You can add some Serial.println() statements to the code so that you can track what is going on.

      Reply
  15. Kevin

    Rob,

    I seem to be having the same problem as a few people on here. You can not update the config.json via web page. I’ve tried it on 3 * wemos D1 mini pros, with Arduino on mac and windows.

    I download the project, extracted it, add config.json file to data… (Changed some numbers in there to proof it was being read).

    Upload Sketch, Upload data with esp8266 sketch data upload tool.

    192.1.x.x./json – loads info
    192.168.x.x/config.json – opens show my data

    192.168.x.x/settings – shows the data I inputted into the config.json

    Change the settings.. error page

    Serial Monitor says…

    HTTP Request

    URI: /json
    Method: POST
    Arguments: 12
    universe: 2
    offset: 0
    pixels: 8
    leds: 3
    white: 0
    brightness: 255
    hsv: 0
    mode: 1
    reverse: 0
    speed: 8
    split: 1
    plain: universe=2&offset=0&pixels=8&leds=3&white=0&brightness=255&hsv=0&mode=1&reverse=0&speed=8&split=1

    handleStaticFile
    File Not Found

    ——————————————————————————————————————————————————

    2 computers, 3 new wemos, one old wemos d1, files data can been seen in browser…

    json version 5.13.2
    esp8266 – board manager version 3.

    Hendrik Walther and Gianluca had the same problem – They never said they got it working.

    Reply
    1. Robert Post author

      I can confirm the problem.

      I am using a NodeMCU 1.0 without any neopixels attached, Arduino 1.8.13, my code as hosted on github. I updated WifiManager to 0.16, updated ESP8266 to 3.0.0, joined the wifi network “ARTNET”, waited for splash screen, configured my wifi network, connected to the regular wifi and looked up the new IP address of the eps8266 on my wifi router.

      Then I went to http://192.168.1.119/settings, where all settings were listed as expected. I changed one, pressed “send” and get the error “Cannot open the page because the server unexpectedly dropped the connection”. That error happens both in Safari and in Chrome.

      When I use curl on the command line

      curl -X POST -d ‘{“universe”:0,”offset”:0,”pixels”:0,”leds”:0,”white”:0,”brightness”:0,”hsv”:0,”mode”:0,”reverse”:0,”speed”:0,”split”:0}’ http://192.168.1.119/json

      I am able to make a successful post request to the /json URL, and in my browser I see that the settings are updated.

      Perhaps something changed (over the years) how modern browsers deal with timeouts, and perhaps https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer was not updated to reflect this.

      Right now I cannot spend time on solving this. Hopefully the CURL command will help you getting the configuration set up properly.

      Reply
  16. Kevin Greene

    Hey Rob,

    Thanks for checking this for me.

    I have found a workaround 🙂 It’s the board manager that is causing the problem.

    downgraded to esp8226 v2.4.2 – works like a charm again.

    Thanks for your great code.

    Reply
    1. Robert Post author

      I also found a bug myself: in setup_ota.cpp it tried to send “reload_failed.html”, but that should be “reload_failure.html”. Changing that solved the “server dropped connection” error in the browser.

      By adding some debugging information to the serial console, I can now also see that “jsonBuffer.parseObject” fails on “plain: universe=0&offset=0&pixels=0&leds=0&white=0&brightness=0&hsv=0&mode=0&reverse=0&speed=0&split=0”. It expects a JSON-formatted string from the server argument “plain”, but it is clearly not formatted like that. I suppose this is where the difference is between esp8266 core v2.4.2 and v.3.0.0.

      Reply
  17. Claudius

    Hello Robert,
    i found your sketch here on this site.
    It work great. Can controll my LED Ring with artnet. I can open the html site in web browser to see settings.
    But when i change settings under site “change” settings and i klick send… there comes an page with failer. no settings change.

    can you help me please?

    Reply
    1. Robert Post author

      Dear Claudius,

      I suspect that you run into a timeout, where the POST request from the settings form is not processed fast enough by the ESP8266. I suggest that you connect over micro-USB and use the serial interface to investigate. You may want to add some debugging statements to the handleJSON function, which processes the incoming data (which is formatted into JSON by the settings.js JavaScript).

      best regards,
      Robert

      Reply
  18. Robert Post author

    Let me post a comment here myself: If you came across this page and are interested in controlling a Neopixel-style LED strip with an ESP8266, I suggest you check out WLED which is a much more actively maintained, fast and feature-rich implementation.

    best regards,
    Robert

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *