fablab-luenen / McLighting

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

Make the AUTOPLAY by default. #30

Closed ACKET2009 closed 4 years ago

ACKET2009 commented 5 years ago

Hello! I'm trying to enable the autoplay the effects automaticaly when the Led stripe powered on, but can not do it. Can You make this option by default, or make a key in definitions file to on or off this feature when somebody need? Or may be You can say how to do it in the sketch, if it's possible?

ACKET2009 commented 5 years ago

Somebody know, how to use the autoplay by default?

bpohvoodoo commented 5 years ago

It is not possible at the moment, as this status is not saved, to neither spiffs nor eeprom. I will have to change code. I will have a look.

ACKET2009 commented 5 years ago

Many thanks! I will awaiting the result with a good news! :^)

viktor6 commented 4 years ago

I will also wait for the result

bpohvoodoo commented 4 years ago

It is in development. "By default" will mean that the status "auto" is beeing saved. On reboot it will restart in "auto" mode.

viktor6 commented 4 years ago

Is it possible to turn on auto mode by http request?

bpohvoodoo commented 4 years ago

Please read the API Doku before asking next time ;-) https://github.com/FabLab-Luenen/McLighting/wiki/HTTP-REST-API#get-lightmode-http10

https://ipofyourdevice/auto

viktor6 commented 4 years ago

I read it and ask http://192.168.0.120/auto File Not Found

URI: /auto Method: GET Arguments: 0

bpohvoodoo commented 4 years ago

Ok. This seems to bee a bug. Will have a look.

bpohvoodoo commented 4 years ago

I checked it here and it is working. Which version do you use? here is mine: http://ipofyourdevice/esp_status {"HOSTNAME":"McLightingRGBW", "version":"2.2.6.RU1.rgbw.3c", "heap":18528, "sketch_size":509040, "free_sketch_space":1585152, "flash_chip_size":4194304, "flash_chip_real_size":4194304, "flash_chip_speed":40000000, "sdk_version":"2.2.1(cfd48f3)", "core_version":"2_5_2", "cpu_freq":160, "chip_id":1458415, "animation_lib":"WS2812FX_DMA", "ws2812_pin":3, "led_count":194, "rgb_order":"GRBW", "rgbw_mode":"ON", "button_mode":"ON", "button_pin":14, "button_gy33":"ON", "gy33_pin":12, "ir_remote":"OFF", "mqtt":"AMQTT", "home_assistant":"ON", "legacy_animations":"ON", "tv_animation":"ON", "e131_animations":"ON", "ota":"HTTP", "state_save":"SPIFFS"}

viktor6 commented 4 years ago

I reloaded the sketch and everything became normal {"HOSTNAME":"McLighting", "version":"2.2.6.RU1.rgbw.3c", "heap":20024, "sketch_size":493920, "free_sketch_space":2650112, "flash_chip_size":4194304, "flash_chip_real_size":4194304, "flash_chip_speed":40000000, "sdk_version":"2.2.1(cfd48f3)", "core_version":"2_5_2", "cpu_freq":80, "chip_id":1458208, "animation_lib":"WS2812FX_DMA", "ws2812_pin":3, "led_count":179, "rgb_order":"GRB", "rgbw_mode":"OFF", "button_mode":"ON", "button_pin":14, "button_gy33":"OFF", "ir_remote":"OFF", "mqtt":"MQTT", "home_assistant":"ON", "legacy_animations":"ON", "tv_animation":"ON", "e131_animations":"ON", "ota":"HTTP", "state_save":"SPIFFS"}

Tell me how to understand this? I can not figure out the color // parameters for automatically cycling favorite patterns uint32_t autoParams[][6] = { // main_color, back_color, xtra_color, speed, mode, duration (seconds) {0x00ff0000, 0x0000ff00, 0x00000000, 200, 1, 5000}, // blink red/geen for 5 seconds

bpohvoodoo commented 4 years ago

0xwwrrggbb in HEX for ultra white on WRGB 0xFFFFFFFF for white on RGB 0x00FFFFFF for full red 0X00FF0000 for full green 0x0000FF00 for full blue 0x000000FF or any other

viktor6 commented 4 years ago

How can I set timings correctly? I want to make smooth transitions from one mode to another so that the modes are not interrupted in the middle. I have ws2812 for 180 lamps (3 meters x 60 led).

And in [GET] / status it does not show which mode is currently working in the car. To track the timing

uint32_t autoParams[][6] = {   // main_color, back_color, xtra_color, speed, mode, duration (seconds)
 // {0x00ff0000- red, 0x0000ff00- green, 0x000000ff- blue 
 //
  {0x00ff0000, 0x000000ff, 0x00000000, 50,  3, 10000},
  {0x0000ff00, 0x000000ff, 0x00000000, 50,  3, 10000},
  {0x00ff0000, 0x0000ff00, 0x00000000,  50, 4, 10000},
  {0x0000ff00, 0x000000ff, 0x00000000,  60, 6, 15000},
  {0x00ff0000, 0x0000ff00, 0x00000000,  60, 5, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  80, 7, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 8,  15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 11, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 12, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 32, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 33, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 38, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  100, 39, 15000},
  {0x00ff0000, 0x0000ff00, 0x000000ff,  50,  42, 15000}
};
bpohvoodoo commented 4 years ago

If you want you can try the development branch now. Autoplay is saved in this version.

viktor6 commented 4 years ago

exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module). https://pastebin.com/pBsgLwaa

bpohvoodoo commented 4 years ago

Hmm, that is weird, because I compiled on an NodeMCU, too.

viktor6 commented 4 years ago

Arduino IDE 1.8.10

bpohvoodoo commented 4 years ago

I use 1.8.10, too. Tried again. Compiled without errors. Please try reinstalling esp8266 2. 5.2 via board manger. First completly remove old files.

viktor6 commented 4 years ago

reinstalled Arduino IDE 1.8.10 and esp8266 2. 5.2 Error remained I tried on two computers From the branch, the master compiles normally

ACKET2009 commented 4 years ago

What adress do You paste for the esp resources? http, or https? I find the errors during compilation with the downloaded controller resources from https site - use the http.

viktor6 commented 4 years ago

Everything was fine, it was necessary to install the library //https://github.com/pasko-zh/brzo_i2c

viktor6 commented 4 years ago

And why not make the AUTOPLAY settings in the web config so that you can edit AUTOPLAY effects from the web page? Now http://192.168.0.120/auto will not work? Can leave?

bpohvoodoo commented 4 years ago

Everything was fine, it was necessary to install the library //https://github.com/pasko-zh/brzo_i2c

You have to comment out #define ENABLE_BUTTON_GY33 12 I left this enabled, because i use a color sensor

Now http://192.168.0.120/auto will not work? Can leave?

now autoplay is a normal animation http://192.168.0.120/auto is obsolete now it is http://192.168.0.120/set?m=56

bpohvoodoo commented 4 years ago

And why not make the AUTOPLAY settings in the web config so that you can edit AUTOPLAY effects from the web page?

So are may plans for future versions, but you are free to contribute code.

viktor6 commented 4 years ago

And now how to control speed and brightness? http://192.168.0.120/set_brightness?p=1 File Not Found URI: /set_brightness Method: GET Arguments: 1 p: 1

bpohvoodoo commented 4 years ago

Read the Rest-API docu V3 http://192.168.0.120/set?p=1 All set commands are replaced.

viktor6 commented 4 years ago

Check if it works for you in version V3.0.0.BETA1 auto?

ACKET2009 commented 4 years ago

Hello! The autoplay switch is excluded now from the web interface - only the ipadress/set?m=56 work? May be now I can to set the autoplay directly from a sketch? I want to send the lights to my systers and my mother on the christmass and want to make all presets before. Because it's difficult do describe them what to do after the powering the lights...

bpohvoodoo commented 4 years ago

Autoplay is now a "normal" animation (56). You can select it via GUI like all the other animations. Please use the development branch.

ACKET2009 commented 4 years ago

Thank You! I use the development brunch. The version is V3.1.0.BETA3. After the first booting and making the wi-fi settings, the lights boot into static red definition. The auto switch on the web page is not present. Only after the string: ipadress/set?m=56 lights begin to autoswitching... If then the custom setting will be checked, the procedure with this string needed to repeat...

bpohvoodoo commented 4 years ago

Beta Brach is 3.1.0.BETA3

ACKET2009 commented 4 years ago

development and beta branch - the same files? I has downloaded from the development and write about that archive...

bpohvoodoo commented 4 years ago

Yes beta and Development is the same (for the moment).