background preloader

Webserver

Facebook Twitter

HTML node? · Issue #38 · node-red/node-red. ESP8266 Community Forum View topic - Introducing esp-httpd: webserver on an ESP8266. - Tue Oct 14, 2014 4:11 pm#1629 Hi all, One of the things the ESP8266 is ideal for is the whole IoT thing.

ESP8266 Community Forum View topic - Introducing esp-httpd: webserver on an ESP8266.

For that, you do need to be able to connect it to a WiFi network and configure it. If your device doesn't have an user interface, this can be quite hard. The device has an AP mode though. Couldn't you just use that and run a webserver to configure it? Introducing esphttpd, a http server for the ESP8266. The git source codebase above is for an example project using the http server. The Good (aka: what's awesome) - Supports multiple connections, for eg simultaneous html/css/js/images downloading - Static files stored in flash, in an (optionally compressed) RO filesystem - Pluggable using external cgi routines - Simple template engine for mixed c and html things The Bad (aka: what can be improved) - Not built for speediness, although it's reasonable fast. - Built according to what I remember of the HTTP protocol, not according to the RFCs.

Now, build the code:make. Prasertsakd's Gists. ESP8266 and Arduino Webserver Code and Sketch. Video Tutorial: How The Code Works The video below shows you how the ESP8266 works as a webserver with the Arduino using the code below.

ESP8266 and Arduino Webserver Code and Sketch

Arduino Webserver Code/Sketch For ESP8266 The code handles the ESP8266’s initialization in the setup() function: it resets the module, configures it as an access point, prints out the module’s ip address, configures for multiple connections, configures as a server on port 80. When there is data available if the string +IPD is in the serial data then the HTTP response is sent to the browser or device requesting it. PlanetArduino. Despite a wealth of tutorials for setting up and writing code for the ESP8266 WiFi module, there has not been much of anything on programming this cheap wireless module with the Arduino IDE.

PlanetArduino

Finally, this has changed. After many months of coding, the Arduino IDE supports the ESP8266 module. The Arduino IDE support was announced on the ESP8266 community forum. Setup is fairly simple with downloads for Linux, OS X, and Windows. This isn’t an ESP8266 shield, either: you can write code for the ESP module, connect the serial pins, and hit the program button. The basic functions of the Arduino IDE – pinMode, digitalRead, digitalWrite, and analogRead – are available. There are a few things that aren’t written yet; PWM doesn’t work, as the ESP8266 only has one hardware PWM source. Webserver for Arduino ESP8266. Esp8266. It isn't often that a new chip on the block causes a stir like the ESP8266 has!

esp8266

What is it? It's a WiFi interface. To be more precise it's a WiFi interface suited to microcontroller applications, IoT etc & it has an integrated TCP/IP stack. There are plenty of alternative devices around so what's so special about this one? In a word, the price! So what's the catch? Apart from mere curiosity, I was interested to discover whether these devices might be suitable for students to use in projects. There are a few examples of use floating around on the interweb, I've probably tried them all, with limited success. I chose to use a Teensy 3.1 to work with the ESP8266 for a few reasons: as well as having USB serial it also has 3 real serial ports which eases interfacing.

My early dabblings with the ESP & downloaded examples were tortuous to say the least. The general consensus is that the ESP needs its own power supply, it typically requires 200mA which is twice what the Teensy can provide. Arduino & ESP8266 Webserver. Here is my first attempt at a web server using the ESP8266.

Arduino & ESP8266 Webserver

It includes a request count and also a text input field. Enter your name and hit submit The code is not very elegant and it can be made far more efficient. Esp8266 arduino server.