GithubHelp home page GithubHelp logo

ws2813/ws2818 support about espixelstick HOT 7 CLOSED

Strontium avatar Strontium commented on May 26, 2024
ws2813/ws2818 support

from espixelstick.

Comments (7)

forkineye avatar forkineye commented on May 26, 2024 1

The ESPixelStick code uses a custom method I developed to generate the WS2811 pixel stream by offloading it to the UART. Both the NeoPixel libraries and FastLED bit-bang the stream which can lead to watchdog resets as it interrupts the wifi stack. If the only difference is the reset time as @Strontium noted, its a fairly quick and easy fix. I'll look into it when I get time, hoping to start working on some updates soon.

from espixelstick.

forkineye avatar forkineye commented on May 26, 2024 1

I had WS2801 on my "todo" list for last year, but never got around to it. Most implementations just use SPI, but unfortunately the SPI interface isn't exposed on the ESP-01 module, which means it has to be done in software. I have some WS2801 pixels to test with, just have to get around to writing a "SPI-ish" driver for them and figure out how to handle timing without disrupting the wifi stack.

from espixelstick.

rollercontainer avatar rollercontainer commented on May 26, 2024

The external lib Adafruit_NeoPixel does not support WS2813 yet.
Maybe the FastLED lib is a better choice as it already supports WS2813.

https://github.com/FastLED/FastLED

from espixelstick.

rollercontainer avatar rollercontainer commented on May 26, 2024

Compiles, but I can not test it.
`
#include <ESP8266WiFi.h>
#include <E131.h>
#include <FastLED.h>

#define NUM_LEDS 60 /* Number of pixels /
#define UNIVERSE 1 /
Universe to listen for /
#define CHANNEL_START 1 /
Channel to start listening at /
#define DATA_PIN 0 /
Pixel output - GPIO0 */

const char ssid[] = "........."; /* Replace with your SSID /
const char passphrase[] = "........"; /
Replace with your WPA2 passphrase */

E131 e131;

CRGB leds[NUM_LEDS];

void setup() {
// Uncomment/edit one of the following lines for your leds arrangement.
// FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<WS2813, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
//FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
// FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<P9813, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<APA102, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<DOTSTAR, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    
Serial.begin(115200);
delay(10);

/* Choose one to begin listening for E1.31 data */
//e131.begin(ssid, passphrase);                       /* via Unicast on the default port */
e131.beginMulticast(ssid, passphrase, UNIVERSE);  /* via Multicast for Universe 1 */

/* Initialize output */
FastLED.show();

}

void loop() {
/* Parse a packet and update pixels */
if(e131.parsePacket()) {
if (e131.universe == UNIVERSE) {
for (int i = 0; i < NUM_LEDS; i++) {
int j = i * 3 + (CHANNEL_START - 1);
leds[i].setRGB( e131.data[j], e131.data[j+1], e131.data[j+2]);
}
FastLED.show();
}
}
}`

from espixelstick.

bquesse avatar bquesse commented on May 26, 2024

To add to this, using FastLED would also enable support of WS2801 pixels as well as a whole host of other chipsets. It's been ported to the ESP, so there should be no problems slotting it in in place of Adafruit's library.

from espixelstick.

bquesse avatar bquesse commented on May 26, 2024

Makes sense! Any chance WS2801 pixels would ever be supported? I've got a bunch kicking around I'd love to get on a PixelStick. Thanks for all the hard work you've put into this!

from espixelstick.

forkineye avatar forkineye commented on May 26, 2024

Reset timing fixed as of 3.0-dev1

from espixelstick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.