Wemos and addressable led strips



  • ey people!

    I wanted to ask if there is anybody experimenting with Wemos and addressable led strips.

    I would really like to use a Wemos D1 (https://www.wemos.cc/product/d1.html) to run a program based on neopixels library or fastled library, and instead of writing a pin, sending the information of this pin via wifi to several Wemos D1 mini (https://www.wemos.cc/product/d1-mini.html)

    I havent yet done anything via wifi, so before getting into it wanted to ask if there is somebody with some knowledge from which I can grab myself.

    :)



  • Hi @camilozk ,

    sorry, but I do not yet understand your system setup.

    Do you want to connect led strips to each of the several D1 mini and control these from a kind of central D1?
    Or do you want the D1 mini act like leds on the led strip, running a neopixel library on the D1?

    What I have done so far is connect a neopixel ( juwel ) to the D1 mini. But this is kind of trivial if you have the right libraries.
    7th Dwarf



  • There's a great project here: https://youtu.be/7Dv70ci-MOw



  • I've used the Wemos as well as other arduino boards to control LED strips. I have the boards setup to subscribe to MQTT broker and change color or pattern based off the message received. you could do the same thing with multiple D1s all subscribed to the same topics.



  • ey!

    I would like to run a program in a D1, but instead of writing a pinout to send the information to the led strip, I would like to send this information via wifi to several D1 mini.

    So, for example, the D1 can run a program like the one copied below (a simplified version of strandtest) and instead of sending the information to pin 23 for the led strip, sending the information via wiki to several other D1 mini.

    Did somebody do this kind of approach?

    --
    #include <Adafruit_NeoPixel.h>

    #define PIN 23

    Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

    void setup() {
    strip.begin();
    strip.show(); // Initialize all pixels to 'off'
    }

    void loop() {
    rainbow(20);
    }

    void rainbow(uint8_t wait) {
    uint16_t i, j;

    for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
    }
    }

    // Input a value 0 to 255 to get a color value.
    // The colours are a transition r - g - b - back to r.
    uint32_t Wheel(byte WheelPos) {
    WheelPos = 255 - WheelPos;
    if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
    }
    if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
    }
    WheelPos -= 170;
    return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
    }



  • Hello @camilozk ,

    I think I got your point now, but I believe, even it might be possible technically, it makes no sense this way.

    The neopixel libraries deals with the hardware, e.g. pins directly. You have no access to the bitstream send to the led strip from within your design. One possibility could be to use one microcontroller as "generator". This one will use the neopixel library and generates the bitstream. Instead of connecting a led strip to pin 23, you connect a Wemos D1 mini to it as "listener and master". This micro listens to the bitstream and distributes it via wifi to the other D1 mini, which are configured as "slave and generator". These slaves will take the wifi stream and convert it back to a bitstream for the led strip connected to the slaves. I don't know if this works and, as said I would not recommend it.

    Instead I would use one device as "master" to use a simple command/answer protocal over wifi with the slaves. The slaves itself, connected to a led strip each, will take the commands and use the neopixel library running on them to generate the appropriate bitstream.
    The only work you have to do is to implement the protocol. Probably another term for "master" and "slave" could be "client" and "server".
    7th Dwarf



  • Ey 7th Dwarf! thank you very much for your feedback.

    I am actually using a software that reads a bmp file from a sd card, and does an interpretation of this to drive the led strips. There is a very good reason why I want this software to run in a central master board, and it is that I can easily have access to this board and modify its content, while the led strips that would be connected to the several D1 mini would be placed rather inaccessible, like for example hanging from trees.

    I actually have the feeling that the first thing you proposed, that you also wouldnt recommend, could be a solution for my problem.

    Since this is my first approach to use wemos and wifi, I have no idea where to start. if you have some experience and you can support me on my first steps, I really appreciate it!

    :)

    btw. I can post only every 10 hours, until I get 3 "reputation" points. I would appreciate some!!!


Log in to reply
 

Looks like your connection to WEMOS Forum was lost, please wait while we try to reconnect.