Pages: [1]   Go Down
Author Topic: Php or python  (Read 727 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

    I want to be able to send/receive from the web. I also want to store data to a database. Since I am new to programming, I deciced to go with the most documented method: Apache, mySQL and Python. I had problem connecting the Arduino with the php (I use the php_serial.class.php) so I tried with Python and It works right away. I was finally able to work with the Php code, but Python seems more fitted for serial communication .

Here is an example of what I want to accomplish:  

Temperature sensor connected to the Arduino that send data to a database, which I can display on a web page.

First scenario: Arduino to Php to mySQL to Php to Webpage.

Second scenario:Arduino to Python to mySQL to Php to Webpage.

Os: Linux
Pc: Raspberry Pi

Should I do it another way?  Bypassing python is probably a good idea ?  I know a lot of people use lightpd as the web server(lightweight) but will it make that much of a difference?

To start up , I want to go with a easy method in order to learn the main thinking.

So far, I am able to light on and off an led from my localhost using Python, Apache2, php_serial_class.php and html .

Thank you

« Last Edit: February 28, 2013, 09:33:52 pm by playagood » Logged

Global Moderator
Offline Offline
Shannon Member
Karma: 227
Posts: 14048
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first scenario uses less different technologies and that is always considered good design. During the lifetime of a project you need to track less updates. Furthermore the footprint of the installed SW is probably smaller.

There are many people that have made a working PHP-serial-Arduino connection.
If you search the forum (upper right) you should be able to find some code.
(I have no code sorry)

I like your remark calling the Raspberry PI a PC smiley-wink

Rob Tillaart

Nederlandse sectie -,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: