PHP on Arduino Uno + Ethernet Shield

Hi everybody!!!

I got one question for you all guys. I am relatively experienced with HTML and PHP what makes me to think in these 2 languages while programming web sites. But this time I wanted to create web server using an Arduino Uno + Ethernet Shield. The point is that Arduino isn't Windows = )

Does anyone know how to be able to install PHP onto Arduino UNO + Ethernet Shield?

Thank you very much !!!

Greetings everybody !!!

How much disk space does your PHP install need on windows?
How much memory does it need to run?

Compare this to the resources available on the Uno and you will have your answer....

Thank you very much rw950431,

The current packs have a size about 25 MB and the ethernet shield has a slot for a SD card which may contain more than 1 GB. Then... Where is the limit?

Greetings and Thanks!

there is something i don't get, most of folks in this sub forum run for ethernet/wifi module for IoT, instead of gsm module

@KASSIMSAMJI What do you mean? does it have any relevance for the topic?

Thank you

Where is the limit?

The limit is that you must compile and link the PHP engine, so that php scripts can run on the Arduino. Have you figured out how to to that?

RamiDuino:
Thank you very much rw950431,

The current packs have a size about 25 MB and the ethernet shield has a slot for a SD card which may contain more than 1 GB. Then... Where is the limit?

Greetings and Thanks!

And the system RAM required to run on windows is ?

rw950431:
And the system RAM required to run on windows is ?

Irrelevant if you can't even compile and link the code.

But instructional for those coming from a web-dev background who haven't quite grasped the differences in scale.

PaulS:
Irrelevant if you can't even compile and link the code.

So guys, I didn't find how much RAM is necessary for PHP to be run, but it is supposed to be that the Arduino Yun can run PHP and it has 64MB in the Atheros Processor and 2.5 KB in the Atmega.

So I really would like to understand how to get the arduino UNO to be able to do the same.

In fact your RAM is just necessary to run your computer faster, but it isn't necessary to run your computer.

What is the influence of the RAM on this matter?

Thank you all guys!


PS: Perhaps is a deviation from the current topic, but, if it is really impossible does anyone know how to get the data from the HTML forms and process them with Arduino?


For those who are interested in having the answer to my PS, I give you an answer a posteriori here, so, there is no need to miss your time by reading bulking messages.

I found an alternative to PHP with Arduino

for more details you may check the Pindari's comment:

https://forum.arduino.cc/index.php?topic=80053.0

it is basically to pay attention to this part of the code in the Arduino web server example and to gather the char c into a string.

…
void setup(){
 …

 string data="";

}

void loop(){

data = "";
...
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        data = data + c;
        …
      }
      ...
   }
  ...  
}

and you take what you need from this data variable I hope I might help some who have the same problem I have ; )

Nevertheless I still want to know how could it be done to get the Arduino UNO to work with PHP or that anyone of you tell a good alternative.

Thank you all guys!

RamiDuino:
So guys, I didn't find how much RAM is necessary for PHP to be run, but it is supposed to be that the Arduino Yun can run PHP and it has 64MB in the Atheros Processor and 2.5 KB in the Atmega.

So I really would like to understand how to get the arduino UNO to be able to do the same.

In fact your RAM is just necessary to run your computer faster, but it isn't necessary to run your computer.

What is the influence of the RAM on this matter?

Thank you all guys!


PS: Perhaps is a deviation from the current topic, but, if it is really impossible does anyone know how to get the data from the HTML forms and process them with Arduino?

Is there some reason you are unwilling to do the work yourself to find the answer to this question ? ? ?

I have no personal interest in the subject so it behooves the person who does to actually do the work!

RAM is not necessary to run my computer? ? ?
That is news to me and my PC
Completely idiotic statement by you. LOL.

.

ieee488:
Is there some reason you are unwilling to do the work yourself to find the answer to this question ? ? ?

I have no personal interest in the subject so it behooves the person who does to actually do the work!

RAM is not necessary to run my computer? ? ?
That is news to me and my PC
Completely idiotic statement by you. LOL.

The Von Neumann machine didn't have RAM and it isn't so new. =) it had just Memory do you remember? =)

I just have the interest about sharing information and to have fun in my little free time.

I guess that i work more than you because i don't have time to write unproductive comments, which bulk the forums.

If you may not continue to find the answer i beg you, don't fill over this post.

Thank you very much.

RamiDuino:
The Von Neumann machine didn't have RAM and it isn't so new. =) it had just Memory do you remember? =)

I just have the interest about sharing information and to have fun in my little free time.

I guess that i work more than you because i don't have time to write unproductive comments, which bulk the forums.

If you may not continue to find the answer i beg you, don't fill over this post.

Thank you very much.

Your statements are idiotic.

No wonder you get no help from others here.

.

In fact your RAM is just necessary to run your computer faster, but it isn't necessary to run your computer.

Whilst it is common to lock-down the cache (which is just RAM after all) to provide scratchpad during the early boot phase, I don't suggest you try running your PC on the processor/peripheral registers alone.

AWOL:
Whilst it is common to lock-down the cache (which is just RAM after all) to provide scratchpad during the early boot phase, I don't suggest you try running your PC on the processor/peripheral registers alone.

AWOL thank you very much, you are right. ; )

I meant for computing and to process the information shouldn't be necessary the RAM, a computer, not your PC, needs just memory to be able to process the information to exchange data. what RAM makes is to let the processor to keep information in a fast access location. And usually this information is on the EPROM or Hard Drive and it is stored into the RAM to have a fast location. That's why it is random access memory, it takes whatever and puts it wherever into the RAM and when it processes it is also stores it into the RAM. And then if it is something to be permanently stored is stored onto your Hard Drive. The same might do PHP, information on the SD card and process this information with Arduino. But I just don't understand what is the limit for executing the PHP code. because one PHP function shouldn't take as much space as a big Arduino program, but I see that the programs that Arduino UNO may execute aren't also so big.

Thank you very much for telling things with sense ; )

Just for all you guys, if you know that it is impossible and why it is impossible, to let everybody know it, explain it.

Thank you very much!

RamiDuino:
Hi everybody!!!

I got one question for you all guys. I am relatively experienced with HTML and PHP what makes me to think in these 2 languages while programming web sites. But this time I wanted to create web server using an Arduino Uno + Ethernet Shield. The point is that Arduino isn't Windows = )

Does anyone know how to be able to install PHP onto Arduino UNO + Ethernet Shield?

Thank you very much !!!

Greetings everybody !!!

I will save you the trouble. Just get a Raspberry PI, and use your Arduino in conjunction with it. Forget about using PHP in Arduino, it's not gonna happen, I wouldn't even recommend Arduino for with heavy web processing tasks.

I was running a room automation sketch with the Arduino Mega. Despite having only 8KB of ram, it is actually quite capable, and I was surprised how much I was able to get it to do. But it's just an accident waiting to happen, especially when you plan on expanding the code.

I managed to get it to serve a html with java script interface webpage, with auto update status of the switches, including login screen with cookie support. It also had to process http get and post requests. In addition, it was also processing a lot of other info from my rain, light, temp, motion sensors, motor controllers, relays, pwm outputs, analog inputs, logging sensor/switch to SD card and more. Of course it finally crashed one day as I was pushing my luck by adding new code, the ram simply wasn't built to handle this.

I finally decided to move the bulk of the web server code to a Raspberry PI, and I didn't look back since. I have had no crashes since then, running my PI, Mega and a bunch of ESP8266s 24/7. They communicate via LAN. I had to almost start from scratch to re-code everything, but the results were worth it. I also learnt a lot through the process. Using PHP and mySQL has also made my web code much easier to maintain.

I have also learnt a lot trying to fit so much into the Mega, so it wasn't in vain. I learnt how to use progmem, using the proper data type for your needs, and so much more although it wasn't all a walk in a park. If you really want to use PHP with Arduino, like I said, go with the Raspberry PI and Arduino combo, can't go wrong.

So I really would like to understand how to get the arduino UNO to be able to do the same.

Simple, really. Just find a UNO with 64MB of SRAM, instead of 2KB.

Byork:
I will save you the trouble. Just get a Raspberry PI, and use your Arduino in conjunction with it. Forget about using PHP in Arduino, it's not gonna happen, I wouldn't even recommend Arduino for with heavy web processing tasks.

Thank you Byork! all what you told sounds really reasonable ; )

Byork:
I was running a room automation sketch with the Arduino Mega. Despite having only 8KB of ram, it is actually quite capable, and I was surprised how much I was able to get it to do. But it's just an accident waiting to happen, especially when you plan on expanding the code.

I managed to get it to serve a html with java script interface webpage, with auto update status of the switches, including login screen with cookie support. It also had to process http get and post requests. In addition, it was also processing a lot of other info from my rain, light, temp, motion sensors, motor controllers, relays, pwm outputs, analog inputs, logging sensor/switch to SD card and more. Of course it finally crashed one day as I was pushing my luck by adding new code, the ram simply wasn't built to handle this.

I am doing it with An Arduino Mega right now, and it seems to be enough for the moment, I also noticed that if you set a lot of CSS it consumes a lot of dynamic memory. But, for the moment, just to turn on and off the lights of my place with a beautiful web interface, is enough.

Thank you very much for your help and advice dude ; )

I am thinking about something like this and came to the mind that it could be possible, but if somebody could make a library for this ... and probably it would not be an original php but some fitted for arduino processing capabilities remake of php. Slow may be but I believe it could be reasonable for many not sensitive to speed applications. From what I know from the history of Python, - this language was developed by enthusiast trying to do something which was not very convenient or even possible on some specific machines. Here Arduino could take all requests process them and find algorithms of special provcessing operations from sd card for example, I think it is possible and very fun to have such a tiny php-compatible processor. I am not a pro, so may be I sound a bit of a dreamy writer. Just wanted to ask if you had a movement in that search)