-->
Page 1 of 2

Local webserver using Arduino and ESP8266

PostPosted: Wed Jul 15, 2020 9:56 pm
by Harini Chandran
Hi,

Am looking to create a local Arduino webserver using ESP8266. I want to host HTML and Javascript application in the webserver. The project will allow user to connect with Arduino using WiFi via ESP866 module and interact with the form. Upon interaction the input from user will be processed by Arduino and output will be sent back to users device.

I have found this useful tutorial on internet Arduino Webserver using ESP8266. However this tutorial uses only HTML webpage to display to user and allows it to interact with it.

What are the things I should modify to host a Javascript-HTML application instead of just HTML and how do I process the incoming data resulted from user interaction when comes to Javascript.

Any advice or lead is highly appreciated. Thanks in advance

Re: Local webserver using Arduino and ESP8266

PostPosted: Fri Jul 17, 2020 1:58 am
by pangolin
The only piece of advice you need here is: Throw away the Arduino - ESP8266 on its own does everything you need.

Re: Local webserver using Arduino and ESP8266

PostPosted: Fri Jul 17, 2020 3:15 am
by quackmore
whatever platform you will be using, you'll have to build some REST API on your server
meaning that it will have to serve
+ files (statically, cause they don't change) such as HTML docs and js scripts (there is really no differences, they are just files)
+ ajax requests (dynamically, cause this is the information that need to be processed by code, such as reading sensors data or whatever)

google some of the key words above and you'll find plenty of examples

Re: Local webserver using Arduino and ESP8266

PostPosted: Fri Jul 17, 2020 3:20 am
by pangolin
quackmore wrote:whatever platform you will be using, you'll have to build some REST API on your server
meaning that it will have to serve
+ files (statically, cause they don't change) such as HTML docs and js scripts (there is really no differences, they are just files)
+ ajax requests (dynamically, cause this is the information that need to be processed by code, such as reading sensors data or whatever)

google some of the key words above and you'll find plenty of examples


Excellent point: ESPAsyncWebserver library will do all of those for you with very little code