Hello,
I wonder if I can do put on esp website (all files js, css, php)?? I know you can run out of memory (maybe a module with an SD card as a storage device on which to page)??
Regards ;]
Hello,
I wonder if I can do put on esp website (all files js, css, php)?? I know you can run out of memory (maybe a module with an SD card as a storage device on which to page)??
Regards ;]
HTML, CSS and JavaScript files will work just fine, since they are 'executed' on the client side (in the webbrowser of the device that connects to the ESP). However, as far as I know, you can't execute PHP scripts on an ESP8266, it doesn't have a PHP interpreter.
You could transcribe your PHP code to ESP8266-Arduino C++ code, but it might be easier to just use something like a Raspberry Pi: Installing a LAMP stack is extremely easy, so you can just copy your whole site onto it, and even run an SQL server if you wanted to. It has a lot more memory as well, and it will be many times faster than an ESP8266, for obvious reasons.
gegege:
I know you can run out of memory (maybe a module with an SD card as a storage device on which to page)??
You have a couple of megabytes of flash available on the ESP (0.5MB - 3MB, depending on the model) which can be accessed using SPIFFS. This will be plenty for a simple website like an IOT control panel, temperature monitor etc., but if you want a lot of images on your site, this will probably not be enough.
Expanding the ESP's memory by using an SD card is a simple solution (you can just use the Arduino SD library), but it is extremely slow: last time I tried hosting a 1MB image from an SD card, it took over a minute to download.
So in conclusion: get yourself a Raspberry Pi and install Apache & PHP, or if you really want to use the ESP8266, you can try to transcribe your PHP code to C++.
Pieter
php works just fine, it's really just up to the client to parse the text that is sent.
INTP:
php works just fine, it's really just up to the client to parse the text that is sent.
You can certainly issue URLs from an ESP8266 in Web client mode which call PHP code which executes elsewhere. But the ESP8266 is not (yet) so advanced that it can provide all the full web hosting services that non-basic users require: PHP execution engine, MySQL etc.etc. At least, that is how I understand it.