-->
Page 1 of 2

RGB led control and button monitor - Need advice

PostPosted: Fri Jul 24, 2015 11:30 pm
by stevemeetswest
Hi, I am a couple of weeks into working with ESP8266 SP-1 + Arduino Uno for a project and it has been a frustrating experience to say the least getting everything working as I would like. I am a complete noob when it comes to electronics but I have been dutifully following these forums, diagrams and how-tos to the best of my ability.

My goal - I have 2 devices on a lan network. An ESP/Arduino setup with buttons and RGB leds and a second device that is more or less a PC running Ubuntu. There are two functions:

1) The Ubuntu device can issue a GET request toESP/Arduino and switch on an RGB color combo depending on the name/value pair on the request. This will be done at random times, with no less than 3-5 seconds in between requests.

2) The Ubuntu device will send a GET request at regular intervals to query if a button is being pressed at that very moment. My thought was a user would press and hold a button - and while Ubuntu is sending a GET request once per second, the ESP/Arduino would return a set of 1s and 0s to communicate if buttons are being pressed at that moment in time. Up to 4 digits, i.e. '0010'

My current setup:
- ESP 8266 ESP-1
- Arduino Uno
- Arduino boots and sends AT commands to ESP to set it up as a client for my router and then as a webserver
- To the best of my knowledge I have external power source going to an 'LM1117' voltage regulator for powering the ESP 8266 - and I have a resistors in place to 'split the voltage?' for TX of Arduino going to RX of the ESP.

Current results:
- Initial bootup and ESP setup works fine.
- First 1-2 GET requests to ESP/Arduino work well
- Subsequent requests are met with 'busy' response
- I typically have to do a hard reset to get the ESP module back to a working state - at which time I can do 1-2 requests and then it locks up again.

--

I need to find a reliable solution where I can do a GET request once per second as well as random get requests spaced anywhere from 5 to 50 seconds apart.

Questions:

- Is the ESP-01 capable of handling this volume of requests as a web server? Right now it seems not.
- Based on these forums, I have been looking at the ESP-12 as a standalone device to handle web server + RGB led control + button monitor - would this device be compatible with the volume of requests I am trying to do and act as a microcontroller without Arduino?
- If I do get the ESP-12 - it seems like I have an option to use the new Arduino IDE + C method to code it or NodeMCU + lua - does either one perform better than the other for a web server setup I have described?

Thanks in advance for any feedback -

Steve

Re: RGB led control and button monitor - Need advice

PostPosted: Wed Jul 29, 2015 11:09 pm
by dracken
Hello Steve,

I will not be of much help but I can tell you that using different tutorial and by trial and error, I succeded to control a RGB -LED strip with only an ESP-03.

I choose ESP-3 because it's cheap and it got 7 GPIO output.
Uploaded a custom init.lua (start the ESP on webserver mode and connect it to the WIFI network)
Uploaded an index.html (used to have a interface to control the LED - connect on ESP IP and load the index.html page)

Everything work fine but it is a bit laggy sometimes.

Hope that help you a bit.
If you're interested, I can link you the init.lua and index.html I use.

Dracken

Re: RGB led control and button monitor - Need advice

PostPosted: Wed Jul 29, 2015 11:24 pm
by kolban
Howdy Steve,
Can you post the sequence of AT commands that are sent to the ESP and their responses?

Neil

Re: RGB led control and button monitor - Need advice

PostPosted: Thu Aug 06, 2015 7:57 am
by emvee
You might be better off using WS2812B LEDS (aka Neopixels), they are RGB, cheaply priced, addressable, can daisy chain them together using only one pin and do not require PWM from the ESP or Arduino. You can also just use the ESP as it can handle the Neopixels and the button with its two pins if using a ESP-01. Not sure why you want the format of your responses to be in a binary like format but it can be done, just define if statements to respond with "server.send" within the "server.on" function for what directory is hit with a GET request. I have gotten the ESP web server to respond to GET requests within milliseconds.. In the Arduino IDE use the Hello Sketch as a template and import the Neopixel Library, that should get you going in the right direction.