ESP8266 Access Point for DemoReel 100 Create your own WLAN access point anywere and

I’m happy to report that this code works on a WeMos D1 Mini, however, I am confused about two things.

  1. You said that you made two versions (webserver and access point). I did not see two versions or a line in the code to change to switch between them. It works for me in access point mode. How do I get the webserver version to work?
  2. The only thing I changed in your code was the data pin and the pixel type (I changed Pin 13 to D7 for the WeMos D1 Mini). Previously, I had been experimenting with tzapu’s WiFiManager library (https://github.com/tzapu/WiFiManager) for the ESP. Now every time I create an access point with my WeMos D1 Mini (and not just with your code) the SSID shows up on my phone as “AutoConnectAP”. With your code, I was expecting to see “ESP-Accesspoint” as the SSID. With AutoConnectAP, there is no password, it’s identified as an open network and I’m able to connect to it fine without one. Then I point my browser to 192.168.4.1 and it runs “like a bell” as you said.

At first, I was having issues with noise (?) on the data pin. After I added a 470 ohm resistor between the WeMos and the ring of 16 WS2812s, noise issues are solved.
I’m using Arduino IDE version 1.6.5 on Windoze 10. I’m using Arduino Core 2.1.0-rc2 for the ESP Board. My FastLed 3.1 version is about 2 weeks old.

@Juergen_Bruegl
I forgot to say THANK YOU for creating such a useful front end for the DemoReel sketch on the ESP8266. I’m impressed with the hard work you’ve done stitching both the webserver and access point options together with FastLed. This opens up a lot of possibilities for others to improve on the HTML part of code to make something even greater!

@Garrett_Durland - regarding 2 versions: from my observation, the WiFiStart() function is used to start up in WIFI_STA station mode. I used the following code in setup() function, then can just comment out #define USE_AP line to use station mode.

// Comment out to use STA/station mode
#define USE_AP

#ifdef USE_AP
// AP mode
WiFi.mode(WIFI_AP);
WiFi.softAP(server_ssid, server_password);
#else
// STA mode
WiFi.mode(WIFI_STA);
WiFiStart();
#endif

Then make sure to set up your local wifi SSID and password for call to WiFiStart();

@Tim_Field @Garrett_Durland @Scottie_D369 @dougal
Just posted a brand new version WITH slider.

@Tim_Field
Thanks for the sample code. Looking at Gyro Gearloose’s new version with the slider, he has made it easier to comment out or uncomment the section in setup() which chooses the modes. I’m continuing to track down my issue with AutoConnectAP which lingers from using the WifiManager library. I have a feeling that I’ve got an SSID and password in the ESP’s EEPROM and if I could clear it, then it would stop overriding the SSID that I put into the code.

@Tim_Field I tried your method with #define USE_AP but it is not working.
When I comment it out it starts as WebServer and works; but when I leave it in then I can find the AccessPoint but the URL response is ERR_CONNECTION_REFUSED. Could you please have a look what I’m doing wrong here?

@Juergen_Bruegl Not sure - maybe something accidentally changed inside. I just took your recent code posting and applied the #define code and quick test seems to connect fine - see if works for you:

Hi @Juergen_Bruegl , a fantastic job!

A couple of things: Firstly, why do you need a voltage shifter? Most RGB leds will happily trigger at 3.3V and after the first one has been initialised, it passes control at ‘native’ voltages. I haven’t had a problem either with a NodeMCU or a WeMos Mini.

Secondly, I also based my initial ‘webserver’ iteration on @Jason_Coon 's code (I hadn’t found yours at that stage), but found it didn’t fit my needs as I wanted to be able to join a network or run as an AP, depending on the situation, and didn’t want to have to change/rewrite code every time I moved the device around, then I came across WiFiManager - a library that allows dynamic AP, joining an existing network, changing networks on the fly and includes a captive portal, so you don’t need to fumble for the IP address. I also use mDNS, and use the last two bytes of the MAC as both the AP and hostname, so it’s really easy to find the device once you connect to an existing network as I use the format LEDThingxxxx - but it could be even simpler. I wanted diversity as I might put a couple or three devices on the same network.

Here is the library: https://github.com/tzapu/WiFiManager

It’s beautifully simple and complete and you will never want to write your own network handling code again.

Once I’ve debugged my latest iteration of a wifi string controller I will post it, but I’m no programmer and it’s proving to be a slow process :frowning:

@Garrett_Durland I am also using the WifiManager library and have nothing like the problems you are having - you have used the ‘reset’ function? It completely clears the EEPROM storage used by WifiManager. I changed the library to give an AP and Hostname using the last two bytes of the MAC address and to give it a default password - its easy enough, the password is the same as the AP. I’ve got three WeMos Mini-based units on the go in the house and under constant development, both as APs and as members of my local wifi LAN and never have a lick of problem with them. I found it was just one of those ‘works perfectly out of the box’ solutions and I can’t see me changing.

I wonder what your problem is caused by - maybe you have a really long DHCP lease period?