ESP8266 Control, now with SLIDER ! Webserver or Access Point version ! Had to

@dave_windsor @Robert_Wozniak @Mark_Kriegsman I’m maxing out …
added additional sliders for RGB and a total of 32 light effects. Everything works fine BUT suddenly the Website is cut off in the lower third. Found out that the String object I define with the HTML output is using dynamic memory. When the limit is reached it simply does not print out the remaining characters.
I don’t want to use additional options like href (relative and absolute links) or SD-Card but keep the HTML code within the sketch.
Saving some space with less characters on the page is certainly one option, but I like to explore the String resize and String reserve options.
Has anyone experience on that?
What is better? resize or reserve?
Where to put String resize/reserve (in the definitions, in setup or in the HTML-output loop?
Help is highly appreciated :slight_smile: :slight_smile: :slight_smile:
Thanks to all!

@Juergen_Bruegl wow 32 effects do you have code to share please this is for adding to my disabled daughters mobility scooter just waiting for more neopixels to come in post and ill add pictures

@dave_windsor I’m hesitating cos it’s work related. But to make a less fortunate little girl smile… gimme your email

@Juergen_Bruegl hi thanks she will be happy its raveruk1@hotmail.com

@Juergen_Bruegl hi would it be possable to change the effects which are red to pink cant see where to do it thanks

CRGB gives you solid colors, CHSV is for hue saturation and brightness.
Go here and pick your color http://www.color-hex.com/
and then put it in the right spots e.g. CHSV(thishue, thissat, ibright)

@Juergen_Bruegl thanks for help iam lost sorry still learning so do i change this bit of code

for(int i = 0; i < LED_COUNT; i++ ) {
if (i == idex) {leds[i] = CHSV(thishue, thissat, 255);}
else {leds[i] = CHSV(0, 0, 0);}

to this

for(int i = 0; i < LED_COUNT; i++ ) {
if (i == idex) {leds[i] = CHSV(238,48,167);}
else {leds[i] = CHSV(0, 0, 0);}

for this colour here
http://www.color-hex.com/color/ee30a7

@Juergen_Bruegl hi on the sketch you sent me i need help is it possible to set it up for access point connection so i dont have to connect to a wifi connection just connect to the unit i have tryed to sort it but cant seem to get it right thanks again for all your help pictures will follow just getting number of leds and wiring figured out to fit the scooter

@Juergen_Bruegl i’ve finally found 10 minutes to sit down an look at this.
I think this html needs to be re written into a simple html5 & websockets app. It will reduce the amount of string parsing you are having to do on the esp8266, and you wont need submit buttons everywhere. e.g Move a slider, it will change instantly.

I’ll start a simple on/off switch using websockets then expand to a colour picker, etc. I’ll see if i can get some the colouring-in chaps at my work, to knit some CSS for us. There’s plenty of space on the esp8266 to accommodate it.

I’ll post my code in github, and i start another thread rather than pollute this.

finally i wanted to say, thank you for giving me an excuse to dig the esp8266 out of the drawer :wink:

@Stuart_Taylor thank you man! I already started to reduce characters in the String objects because I ran into overflow. The lastest and greatest code is here:
http://pastebin.com/58R4PRrz
General question: If websockets are used they refer to a relative link on the webserver. In other words: there must be files like formats and pngs.
How to wrap those into the code?
Does this also works in AccessPoint mode?
Looking really forward !

@Juergen_Bruegl ​ the good news is websockets lib is well developed and full featured, and additional assets required (images or js) can be stored on flash and accessed via FS.
Now the bad news. Last night i completely broke the toolchain.
Websockets wants esp8266 core 2.1.0 but fastled doesnt seem to work with core > 1.6.5 because of a collision - see github issue #266. However rolling back has broken esptools. So i’m now needing a manual clean out and reinstall. It all feels a little bit brittle. But 6 months ago, it would have been impossible.

cool…
After I move all function above loop and move addGlitter above rainbowWithGlitter and set password for wifi and comment lines 246 to 263 FastLED.cpp
(/*extern “C” int __cxa_guard_acquire (__guard *);
extern “C” void __cxa_guard_release (__guard *);
extern “C” void __cxa_guard_abort (__guard *);

extern "C" int __cxa_guard_acquire (__guard *g)
{
	return !*(char *)(g);
}

extern "C" void __cxa_guard_release (__guard *g)
{
	*(char *)g = 1;
}

extern "C" void __cxa_guard_abort (__guard *)
{

}*/)

project work correctly.
Thanks

Here’s my sketch that uses WebSockets to change colors on the module in real time: https://gist.github.com/msurguy/69a1ede04a09e49f2c1f . I use Platform IO (http://platformio.org) to compile this code and highly suggest you try it out as I had tons of problem compiling this in Arduino IDE. Enjoy!

This looks like a promising possible way of externalizing the html and any other files (js, css, images, etc): http://www.esp8266.com/viewtopic.php?f=32&t=3780

I finally picked up an ESP8266 (an Adafruit Huzzah) and hope to try this soon. I’ll report back if/when I do try it out. :slight_smile:

I have the HTML and js (i’m using jquery) css and images stored on the ESP8266 in SPIFFS, and i can serve from them. The websockets is working very well, and because its html even my smart tv can control the leds. I need to tidy up the code a bit, and i’ll publish on github soon.

hi everyone was just thinking is it possable to control 2 wemos d1 minis at the same time thanks for any help

Hi @Juergen_Bruegl , well after about 6 weeks of waiting, I got my ESP-01 in the mail and and a 3.3V USB- FTDI converter module !
I installed (I hope correctly) the ESP8266 library on the Arduino 1.6.7 IDE and tried to load your sketch on the ESP-01 and no joy :frowning:
Here’s the compiler error I get…
In file included from C:\Users\JPRoy\Documents\Arduino\libraries\FastLED/led_sysdefs.h:21:0,
from C:\Users\JPRoy\Documents\Arduino\libraries\FastLED/FastLED.h:34,
from C:\Users\JPRoy\Documents\Arduino\ESP8266\JuergenESPsketch\JuergenESPsketch.ino:65:
C:\Users\JPRoy\Documents\Arduino\libraries\FastLED/platforms/avr/led_sysdefs_avr.h:10:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
exit status 1
Error compiling.
I used the generic ESP module and that brought up a long sub-menu of options that I initially left in their default states but played with a bit without success
Any hints ? Thanks,JP

@JP_Roy ​ I use 1.6.4, 1.6.8 should work as well. ESP 2.0.0 in boards manager, not 2.1.0, settings generic ESP, 512k - but you need to build an own programmer to set flash pin and a short reset, check the web :wink: I’m on the road right now

@Stuart_Taylor ​​ any progress on the socket implementation? Looking forward for your work…

@Juergen_Bruegl Just checked and I have ESP 2.1.0 installed !
Is there something wrong with that version ?
Must I have ESP 2.0.0 ?