fablab-luenen / McLighting

The ESP8266 based multi-client lighting gadget
MIT License
215 stars 30 forks source link

McLighting does't work in AP Mode #114

Closed atomroflman closed 3 years ago

atomroflman commented 3 years ago

Describe the bug I have flashed my Wemos D1 mini like described in the installation guide. I'd have expected the AP Web UI to offer settings to change the lights settings or a setting to enable the AP Mode in definitions.h.

To Reproduce

Expected behavior See description.

Desktop (please complete the following information):

Additional context definitions.h settings:

#define USE_WS2812FX_DMA 0      // 0 = Used PIN is ignored & set to RX/GPIO3; 1 = Used PIN is ignored & set to TX/GPIO1; 2 = Used PIN is ignored & set to D4/GPIO2;  Uses WS2812FX, see: https://github.com/kitesurfer1404/WS2812FX
                                // or comment it out
#if defined(USE_WS2812FX_DMA)
  #define MAXLEDS 384           // due to memory limit of esp8266 at the moment only 384 leds are supported in DMA Mode. More can crash if mqtt is used.
#else
  #define MAXLEDS 4096
#endif
// Neopixel
#define LED_PIN 3          // PIN (15 / D8) where neopixel / WS2811 strip is attached; is configurable, if USE_WS2812FX_DMA is not defined. Just for the start
#define NUMLEDS 300         // Number of leds in the; is configurable just for the start
#define RGBORDER "RGB"    // RGBOrder; is configurable just for the start
#define FX_OPTIONS 48      // ws2812fx Options 48 = SIZE_SMALL + FADE_MEDIUM  is configurable just for the start; for WS2812FX setSegment OPTIONS, see: https://github.com/kitesurfer1404/WS2812FX/blob/master/extras/WS2812FX%20Users%20Guide.md
//#define LED_TYPE_WS2811    // Uncomment, if LED type uses 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
#define LED_BUILTIN 2      // ESP-12F has the built in LED on GPIO2, see https://github.com/esp8266/Arduino/issues/2192
char HOSTNAME[65] = "McLightingRGBW"; // Friedly hostname  is configurable just for the start. Hostname should not contain spaces as this can break Home Assistant discovery if used.

#define ENABLE_OTA 1                  // If defined, enable Arduino OTA code. If set to 0 enable Arduino OTA code, if set to 1 enable ESP8266HTTPUpdateServer OTA code.
//#define ENABLE_MQTT 1                 // If defined use MQTT OR AMQTT, if set to 0 enable MQTT client code, see: https://github.com/toblum/McLighting/wiki/MQTT-API, if set to 1, enable Async MQTT code, see: https://github.com/marvinroger/async-mqtt-client
//#define ENABLE_MQTT_HOSTNAME_CHIPID   // Uncomment/comment to add ESPChipID to end of MQTT hostname
//#define ENABLE_MQTT_INCLUDE_IP        // uncomment/comment to add the IP-adress to the MQTT message
//#define ENABLE_HOMEASSISTANT          // If defined, enable Homeassistant integration, ENABLE_MQTT must be active
//#define MQTT_HOMEASSISTANT_SUPPORT   // If defined, use AMQTT and select Tools -> IwIP Variant -> Higher Bandwidth
//#define DELAY_MQTT_HA_MESSAGE 5       // HA Status is send after DELAY_MQTT_HA_MESSAGE seconds, to save bandwith

//#define ENABLE_BUTTON 14              // If defined, enable button handling code, see: https://github.com/toblum/McLighting/wiki/Button-control, the value defines the input pin (14 / D5) for switching the LED strip on / off, connect this PIN to ground to trigger button.
//#define ENABLE_BUTTON_GY33 12         // If defined, enable button handling code for GY-33 color sensor to scan color. The value defines the input pin (12 / D6) for read color data with RGB sensor, connect this PIN to ground to trigger button.
//#define POWER_SUPPLY 12               // PIN (12 / D6) If defined, enable output to control external power supply
#if defined(POWER_SUPPLY)
  #define POWER_ON   HIGH           // Define the output state to turn on the power supply, either HIGH or LOW.  Opposite will be uses for power off.
#endif
//#define ENABLE_REMOTE 13              // If defined, enable Remote Control via TSOP31238. The value defines the input pin (13 / D7) for TSOP31238 Out

#if defined(ENABLE_BUTTON_GY33)
  #define GAMMA 2.5                   // Gamma correction for GY-33 sensor
#endif

#define ENABLE_STATE_SAVE             // If defined, load saved state on reboot and save state on SPIFFS

#define CUSTOM_WS2812FX_ANIMATIONS    // uncomment and put animations in "custom_ws2812fx_animations.h"
#define USE_HTML_MIN_GZ               // uncomment for using index.htm & edit.htm from PROGMEM instead of SPIFFS

#define TRANS_COLOR_DELAY 5            // Delay for color transition
#define TRANS_DELAY 10                 // Delay for brightness and speed transition
ryancasler commented 3 years ago

AP mode is used to define your wifi credentials to get the device onto your wifi. Not to provide an access point for you to log into in order to control the lights. That wouldn't be very useful if you have to log into the lights every time you wanted to change them.

atomroflman commented 3 years ago

I'd have expected it to work because in the done todos is written: 'Also enable McLighting in Wifi AP mode.' I have a light solution where no network access point is available. My mobile connects to the controller in the AP Mode by itself and I'd like to control the lights with my mobile.

bpohvoodoo commented 3 years ago

Yes, it shoud leave the config mode after 120 seconds of inactivity and is usable then as you expected.

atomroflman commented 3 years ago

Okay it worked after a fresh upload of the software. Thanks.