Chat freely about anything...

User avatar
By mflmartin
#35165 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,
User avatar
By dannybackx
#35241 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
User avatar
By bbx10node
#35278 > 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.
User avatar
By mflmartin
#35652 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.