mariusmotea / diyHue

Philips Hue emulator that is able to control multiple types of lights
Other
627 stars 107 forks source link

WS2811 looks like it's working but doesn't light up #454

Closed barretpj closed 5 years ago

barretpj commented 5 years ago

I've got a 300-pixel WS2811 strip connected via a Wemos D1 mini, using NeoEsp8266Uart800KbpsMethod. It all looks like it's working - I get the initial run of white and green up the pixels, and it responds to the app via the hub, including bidirectionally. But it never lights up any pixels except during startup.

The Neopixelbus example code works, which suggests the hardware and library code is working.

Any ideas?

mariusmotea commented 5 years ago

Please set a default scene in webgui. The problem is the lack of color to ve aplied when you perform on and play with the brightness. To verify what i said here you can simply add the light in a room and apply a scene yo that room. Scenes contain full state details.

barretpj commented 5 years ago

Thanks - I've already done that, it's in a room and (with some serial debug) I can see the set messages coming from the hub.

mariusmotea commented 5 years ago

If you set a scene from webui and play with on/off nothing is happening?

barretpj commented 5 years ago

Correct - the webui works correctly but nothing lights up. I've tried reducing the pixel count but that makes no difference.

mariusmotea commented 5 years ago

You my try second service that controll the lights, it is the hue entertainment. You can create one entertainment area and while you setup this the lights are controlled via udp service. When you compile the code did you use latest libraries, including esp8266?

barretpj commented 5 years ago

Thanks. I've just tried Hue Entertainment, but Hue Sync (on Windows) won't find the bridge emulator on the local network, and I can't see a way to enter an IP directly. Yes, latest libraries and board, as far as I can see.

mariusmotea commented 5 years ago

Will not find because entertianment mode is advertized as running. Old hue app show this and let you power off, new one not. I can told you how to fix it but is useless if the lights did not show the colors while you perform the wizard.

barretpj commented 5 years ago

I got Hue Entertainment setup from my phone but still not seeing anything on the lights. Very odd. I'll try again from scratch later. Thanks.

mariusmotea commented 5 years ago

Paste here the header of your sketch, maybe i can identify something wired in variables.

barretpj commented 5 years ago
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WebServer.h>
#include <NeoPixelBus.h>
#include <WiFiManager.h>
#include <EEPROM.h>

#define light_name "WS2812 Hue Strip" //default light name
#define lightsCount 3
#define pixelCount 20
#define transitionLeds 6 // must be even number

#define button1_pin 4 // on and bri up
#define button2_pin 5 // off and bri down
#define use_hardware_switch false // on/off state and brightness can be controlled with above gpio pins. Is mandatory to connect them to ground with 10K resistors

//#define USE_STATIC_IP //! uncomment to enable Static IP Adress
#ifdef USE_STATIC_IP
IPAddress strip_ip ( 192,  168,   0,  95); // choose an unique IP Adress
IPAddress gateway_ip ( 192,  168,   0,   1); // Router IP
IPAddress subnet_mask(255, 255, 255,   0);
#endif

int lightLedsCount = pixelCount / lightsCount;
uint8_t rgb[lightsCount][3], bri[lightsCount], sat[lightsCount], color_mode[lightsCount], scene;
bool light_state[lightsCount], in_transition, entertainment_run;
int ct[lightsCount], hue[lightsCount];
float step_level[lightsCount][3], current_rgb[lightsCount][3], x[lightsCount], y[lightsCount];
byte mac[6];
byte packetBuffer[64];

ESP8266WebServer server(80);
WiFiUDP Udp;

RgbColor red = RgbColor(255, 0, 0);
RgbColor green = RgbColor(0, 255, 0);
RgbColor white = RgbColor(255);
RgbColor black = RgbColor(0);

NeoPixelBus<NeoGrbFeature, NeoEsp8266Uart800KbpsMethod> strip(pixelCount, 2);
mariusmotea commented 5 years ago

pixelCount must divide lightsCount, so put it 21 instead of 20. Also because the number is small reduce the transitionLeds from 6 to 4.

#define light_name "WS2812 Hue Strip" //default light name
#define lightsCount 3
#define pixelCount 21
#define transitionLeds 4 // must be even number
barretpj commented 5 years ago

It was 3,300,6 but I took it down to 20 for testing. Sadly none of those options work :-(

mariusmotea commented 5 years ago

I never face this issue. I faced wired issues with one strip working fine another 3 were working with issues. The issue was the esp8266, i believe thr logic HI voltage on rx pin was too small. Replacing the board fix the issue.

barretpj commented 5 years ago

I've got it working now - rewired to connect the lights to Wemos D1 RX pin (GPIO3) which has the drawback that it gives out smoke if I program over USB while it's connected :-( Thanks for the help.