-->
Page 1 of 1

New to ESP8266 - some basic questions

PostPosted: Fri Nov 27, 2015 8:57 pm
by mflmartin
Hello,

I am a complete newbie when it comes to this chip (and probably a lot of hardcore hardware). I know a bunch programming languages like Java, PHP, HTML, JS, and some C, and C++, though.

I just ordered the ESP8266-01, and my first goal is to try to install it, and run a very basic web-server. I know that there is a project here that does that specifically and I will look into it.

But I have a couple of very broad questions:

1. Given the fact that that the chip is so basic, when it comes to it's RAM, how is it possible for it to run a webserver at all?

2. The project that is listed in this forum for a webserver, when you install it, does that mean that you can run PHP on it?

3. My objective, to learn, is to program the chip, connect an LCD (if possible a nokia 3310, or 3110 - I have some at home-) and also connect some sensors to it, like a motion sensor (that I have), and have it report the data to an external URL api that I will make. Do you think that all that is possible?


And again, sorry for my super basic and broad questions :). I have still a lot to read ahead in the forums to learn.

Thanks!

Martin,

Re: New to ESP8266 - some basic questions

PostPosted: Sun Nov 29, 2015 7:57 am
by dannybackx
Connecting sensors to it, and querying them via a web server running on the ESP8266, is certainly possible.

I'm trying to build just that, see https://github.com/dannybackx/arduino-upnp .

This is work in progress on a little framework to query the sensors via UPnP, which is an XML protocol based on HTTP.
My device currently replies :
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:body>
<u:GetStateResponse xmlns="urn:danny-backx-info:service:sensor:1">
<State>0</State>
</u:GetStateResponse>
</s:body>
</s:Envelope>

and the RAM still free when running this app is about 28K.

Danny

Re: New to ESP8266 - some basic questions

PostPosted: Sun Nov 29, 2015 2:05 pm
by bbx10node
> 1. Given the fact that that the chip is so basic, when it comes to
> it's RAM, how is it possible for it to run a webserver at all?

A web server at its lowest level is simply sending data over a TCP socket to a browser. The data consists of HTML, CSS, JPG, GIF, etc. which can be stored in Flash, not RAM. ESP-12 dev boards usually have 4 MB of Flash and 3 RM available as a Flash file system so a lot of web data can be stored in Flash files.

> 2. The project that is listed in this forum for a webserver, when you
> install it, does that mean that you can run PHP on it?

I have never seen a project using PHP on an ESP board. I use the Arudino IDE so perhaps other languages such as Lua, Javascript, or BASIC handle web servers in a different way. You might want to take a look at Kolban's book to get an overview of ESP development options.

http://neilkolban.com/tech/esp8266/

> 3. My objective, to learn, is to program the chip, connect an LCD (if
> possible a nokia 3310, or 3110

If the Nokia 3310 uses the PCD8544 controller with SPI interface, you can take a look at my demo project which uses a modified Arduino PCD8544 driver. A lot of Arduino code works in the ESP Arduino IDE. In some cases, modifications are necessary. An ESP-12 board is required to use hardware SPI.

http://x10linux.blogspot.com/2015/09/display-weather-on-small-lcd-using.html

> I have some at home-) and also connect some sensors to it, like a
> motion sensor (that I have), and have it report the data to an
> external URL api that I will make.

Search the forums for projects that read from sensors (for example, temp and humidity) then HTTP PUT the values to a cloud IOT service such as thingspeak.com or data.sparkfun.com. They can be modified to use your own server instead.

Re: New to ESP8266 - some basic questions

PostPosted: Fri Dec 04, 2015 11:33 am
by mflmartin
Thanks Everyone for the replies. Everything is a bit clearer :).

It took me sometime to see them... because I was not subscribed to my own topic. Does anyone know how to activate automatic subscription on topics that you create or comment in the forum?

Thanks.