diff --git a/Arduino/McLighting/McLighting.ino b/Arduino/McLighting/McLighting.ino index 89a63ae..ee76179 100644 --- a/Arduino/McLighting/McLighting.ino +++ b/Arduino/McLighting/McLighting.ino @@ -99,16 +99,16 @@ WS2812FX* strip; #endif #ifdef USE_WS2812FX_UART1 // Uses UART1: GPIO1/TXD0/TX, more info: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods #ifndef LED_TYPE_WS2811 - NeoEsp8266Uart0800KbpsMethod* dma; //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) + NeoEsp8266Uart1800KbpsMethod* dma; //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) #else - NeoEsp8266Uart0400KbpsMethod* dma; //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) + NeoEsp8266Uart1400KbpsMethod* dma; //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) #endif #endif #ifdef USE_WS2812FX_UART2 // Uses UART2: GPIO2/TXD1/D4, more info: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods #ifndef LED_TYPE_WS2811 - NeoEsp8266Uart1800KbpsMethod* dma; //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) + NeoEsp8266Uart0800KbpsMethod* dma; //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) #else - NeoEsp8266Uart1400KbpsMethod* dma; //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) + NeoEsp8266Uart0400KbpsMethod* dma; //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) #endif #endif @@ -123,16 +123,16 @@ void initDMA(uint16_t stripSize = NUMLEDS){ #endif #ifdef USE_WS2812FX_UART1 // Uses UART1: GPIO1/TXD0/TX, more info: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods #ifndef LED_TYPE_WS2811 - dma = new NeoEsp8266Uart0800KbpsMethod(stripSize, 3); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) + dma = new NeoEsp8266Uart1800KbpsMethod(stripSize, 3); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) #else - dma = new NeoEsp8266Uart0400KbpsMethod(stripSize, 3); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) + dma = new NeoEsp8266Uart1400KbpsMethod(stripSize, 3); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) #endif #endif #ifdef USE_WS2812FX_UART2 // Uses UART2: GPIO2/TXD1/D4, more info: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods #ifndef LED_TYPE_WS2811 - dma = new NeoEsp8266Uart1800KbpsMethod(stripSize, 3); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) + dma = new NeoEsp8266Uart0800KbpsMethod(stripSize, 3); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) #else - dma = new NeoEsp8266Uart1400KbpsMethod(stripSize, 3); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) + dma = new NeoEsp8266Uart0400KbpsMethod(stripSize, 3); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) #endif #endif dma->Initialize(); @@ -293,7 +293,7 @@ void initStrip(uint16_t stripSize = WS2812FXStripSettings.stripSize, neoPixelTyp strip->setColor(main_color.red, main_color.green, main_color.blue); strip->setOptions(0, GAMMA); // We only have one WS2812FX segment, set color to human readable GAMMA correction #ifdef CUSTOM_WS2812FX_ANIMATIONS - strip->setCustomMode(F("Fire 2012"), myCustomEffect); + strip->setCustomMode(0, F("Fire 2012"), myCustomEffect); #endif strip->start(); if(mode != HOLD) mode = SET_MODE; diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index db66022..d3878e6 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -999,7 +999,7 @@ void checkForRequests() { if (mqtt_client.connect(mqtt_clientid, mqtt_user, mqtt_pass, mqtt_will_topic, 2, true, mqtt_will_payload, true)) { DBG_OUTPUT_PORT.println("MQTT connected!"); // Once connected, publish an announcement... - char * message = new char[18 + strlen(HOSTNAME) + 1]; + char message[18 + strlen(HOSTNAME) + 1]; strcpy(message, "McLighting ready: "); strcat(message, HOSTNAME); mqtt_client.publish(mqtt_outtopic, message); @@ -1008,7 +1008,7 @@ void checkForRequests() { if(mqtt_lwt_boot_flag) { mqtt_client.publish(mqtt_will_topic, "ONLINE"); - mqtt_lwt_boot_flag = false; + //mqtt_lwt_boot_flag = false; } #ifdef ENABLE_HOMEASSISTANT ha_send_data.detach(); @@ -1102,12 +1102,12 @@ void checkForRequests() { DBG_OUTPUT_PORT.println("Connected to MQTT."); DBG_OUTPUT_PORT.print("Session present: "); DBG_OUTPUT_PORT.println(sessionPresent); - char * message = new char[18 + strlen(HOSTNAME) + 1]; + char message[18 + strlen(HOSTNAME) + 1]; strcpy(message, "McLighting ready: "); strcat(message, HOSTNAME); amqttClient.publish(mqtt_outtopic, qospub, false, message); //Subscribe - uint16_t packetIdSub1 = amqttClient.subscribe((char *)mqtt_intopic, qossub); + uint16_t packetIdSub1 = amqttClient.subscribe(mqtt_intopic, qossub); DBG_OUTPUT_PORT.printf("Subscribing at QoS %d, packetId: ", qossub); DBG_OUTPUT_PORT.println(packetIdSub1); if(mqtt_lwt_boot_flag) {