fablab-luenen / McLighting

The ESP8266 based multi-client lighting gadget

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the AUTOPLAY by default.

ACKET2009 opened this issue · comments

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?

Somebody know, how to use the autoplay by default?

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.

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

I will also wait for the result

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

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

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

URI: /auto
Method: GET
Arguments: 0

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

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"}

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

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

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}
};

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

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

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

Arduino IDE 1.8.10

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.

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

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.

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

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?

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

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.

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

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

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

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...

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

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...

Beta Brach is 3.1.0.BETA3

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

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