Chat freely about anything...

User avatar
By xpirt
#23345 Hello everyone,

I recently bought 2 esp8266 modules and wondered how much I can do with them.
I've come across onto a doubt though, if I want to use it as a web server and make an admin control panel to control my arduino uno, where I have to upload my files? I assume it has an internal storage that contains the firmware and if so how much space can I use for my html/php pages?

Thanks in advance for replying,
xpirt
User avatar
By bjpirt
#23394 It all depends on how much else you want to do. The nice thing about the ESP is that you're free to put things wherever you want. If you don't want to do OtA updates then there's about half of the flash available for files, otherwise things get a bit tighter. It's worth looking at https://github.com/Spritetm/libesphttpd because it uses a compressed filesystem so you can squeeze even more in. I've been using this for https://github.com/mirobot/mirobot-wifi and have 24kB for UI files after doing OtA updates and OtA Arduino flashing. Doesn't sound like much but that's a lot of Javascript if it's minified well. You won't be using PHP on this little guy though - just some simple templating at best, that's why I'd recommend doing as much as possible with client-side javascript.

Hope this helps,
Ben
User avatar
By xpirt
#23405 Thank you very much for replying.

So basically, as I never used this module, if I want to write my custom html pages, can I upload them inside it? And is there a sort of / root folder where I can add more folders inside it?
For example, if I write my html page, then I add an image for the logo, some .css files and some .js files, can it handle them?
And as they should come within some days, in a very simplified way, can you explain the steps to make it a web server and where to store files?

Thanks again for these clarifications,
xpirt
User avatar
By bjpirt
#23407 You might be as well basing your project on either my code at:

https://github.com/mirobot/mirobot-wifi

or the similar project esp-link at:

https://github.com/jeelabs/esp-link

Either way you'll be compiling your own firmware. Both will let you send data over a socket and repeat it over serial to the Arduino. This is exactly what I do with Mirobot; the ESP runs a websocket server (which can also handle non-websocket connections) and any messages sent over that socket get sent to the Arduino as JSON. It then interprets them and acts accordingly.

Cheers,
Ben