Go Down

Topic: Php or python (Read 744 times) previous topic - next topic

playagood

Mar 01, 2013, 03:29 am Last Edit: Mar 01, 2013, 03:33 am by playagood Reason: 1
Hi,
   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


robtillaart

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 ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview