UPDATE: Ok, so i have figured something out: The pins are correct,

UPDATE:

Ok, so i have figured something out: The pins are correct, it should be 14, and 16. I’ve used a different sketch to test if they go high and low like i expect, and they do. Then once i try to get FastLED going, the esp8266 locks up if call

FastLED.addLeds<WS2801, 16, 14, RGB>(leds, NUM_LEDS);

if i comment that out, the esp won’t freeze.

FREEZES:
#define FASTLED_ESP8266_RAW_PIN_ORDER
#include <FastLED.h>
//#include <SPI.h>
#define NUM_LEDS 3
#define DATA_PIN 14
#define CLOCK_PIN 16
CRGB leds[NUM_LEDS];

void setup() {
pinMode(14, OUTPUT);
pinMode(16, OUTPUT);
//digitalWrite(16, HIGH);
//delay(3000);
Serial.begin(9600);
//delay(3000);
FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
////yield();
}

void loop() {
for(int i = 0; i < NUM_LEDS; i++){
leds[i].setHSV(255,255,255);
}
FastLED.show();
delay(100);
Serial.println(“A”);
}

DONT FREEZES:

#define FASTLED_ESP8266_RAW_PIN_ORDER
#include <FastLED.h>
//#include <SPI.h>
#define NUM_LEDS 3
#define DATA_PIN 14
#define CLOCK_PIN 16
CRGB leds[NUM_LEDS];

void setup() {
pinMode(14, OUTPUT);
pinMode(16, OUTPUT);
//digitalWrite(16, HIGH);
//delay(3000);
Serial.begin(9600);
//delay(3000);
FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
////yield();
}

void loop() {
for(int i = 0; i < NUM_LEDS; i++){
leds[i].setHSV(255,255,255);
}
FastLED.show();
delay(100);
Serial.println(“A”);
}

I’ve never seen this used before:
leds[i] = 0;

Always thought it needed to be something along the lines of
leds[i] = CHSV(0,255,255); or
leds[i] = CRGB(255,0,0); or
leds[i] = CRGB::Red; or
leds[i] = 0xFF0000; //hex for color red

leds[i]=0 will set them black. But, I tried setting them red using your third option first.

Personally I would probably still do CRGB::Black to make the code more readable/obvious, but that’s a nice shortcut I didn’t know about.

any ideas for me Marc? I believe you are knowledgeable about this sort of thing :smiley:

Looks like you have the level shiftier wired correctly. (I’m assuming that GPIO14 is data, and GPIO16 is clock.)

I see you have set DATA_RATE_KHZ(200) and imagine you have tried other rates? I have not worked with the ESP8266 so have no idea what combination should be used with that and WS2801 strips, but my initial thought when I saw that was 200KHz sounds too fast.

In the code, Pin 4 (data) is GPIO2 and pin 5 (clock) is GPIO14 - but your schematic has GPIO16 going to clock and GPIO14 going to data.

Also WS2801 data rate is around 1Mhz - so 200khz is below that threshold. (On data sheet ws2801 can go up to 25mhz - but when I first started using it I had problems above 1mhz).

I’m only tested the APA102 LEDs - but there are really similar. So try to use default speed from the LED controller. I mean, just do not define the clock speed (200kHz) because I think it is too slow. Otherwise, as Daniel said - you switched the data/clock pins - so it will use software spi to do this.

I havd defined the clock speed at this rate for a large project and it works ok. What should k set the PIN number to, Daniel? I have it connected as on the schematic because it is a printed PCB.

I posted an update, still looking for soltuions

Unfortunately I’m going to be off this weekend on vacation - I’ll take a look when I get back. (Question - can you use other led types?)

For testing yes, but longer term, no.

My question was - is it only ws2801’s that are hanging on you? What happens with lpd8806 or apa102 or ws2812?

Go into chipsets.h and delete every line that mentions mWaitDelay.

The esp hangs if i try Dotstars or LPD8806 chips. It doens’t matter. I also tried to go into chipsets and comment out mWaitDelay, that doesn’t seem to work either.

pinMode(14, OUTPUT);
pinMode(16, OUTPUT);
//digitalWrite(16, HIGH);
//delay(3000);
Serial.begin(9600);
Serial.println(“X”);
delay(3000);
Serial.println(“X”);
delay(3000);
Serial.println(“X”);
delay(3000);
Serial.println(“X”);
delay(3000);
Serial.println(“X”);
//FastLED.addLeds<WS2801, 14, 16, RGB, DATA_RATE_KHZ(200)>(leds, NUM_LEDS);
FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
//FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

Results in the appropriate number of x’s in the serial monitor. However, my prints in the loop never fire.

here is the modified chipset.h

http://pastebin.com/uMtHzwMZ

Ok - I won’t be able to do any more with this until I get back home in Monday and can get my hands on esp8266’s and LEDs.

Sounds good. I appreciate your help. I just tried this with a different esp8266 -12 board and i get the same result.

One esp-12 is the huzzah breakout from adafruit, and the other esp-12 is a module soldered on to a custom PCB (also bought from adafruit).

Also what versions of Arduino and what version of the esp8266-Arduino core are you using? (One day people will follow the guidelines and put all this information in up front instead of making me have to ask for it individually).

Sorry,

I was using 1.6.6 of the arduino ide, but i also just tried 1.6.9

I am using version 2.0 of the esp core

I’ve only Tested with 2.1 and 2.2