Pages: [1]   Go Down
Author Topic: Arduino + PHP  (Read 2417 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone, I would like to know if there is some place where I can get some help on how to use arduino with php.
thanks smiley
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 207
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino with PHP?

This could mean a number of things:

1) Running PHP on an Arduino, like you would on a webserver.

2) Comiling PHP so it runs on the Arduino in a similar way to C/C++ in the IDE.

3) Running some code on the Arduino which calls a php script on a web server.

Can you elaborate on what you are trying to do?

Regards,

Mike
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, sorry, I will try to be more clear this time.

I'm trying to learn how to use arduino to communicate with software. I know some C and PHP. I would like to be able to build a email checker, that would, for example, use PHP to get the information from the EMAIL, and if there is a new email, get a program in C that would send some serial information to arduino to turn a led on. I found something like that on the web, but using python, and I couldn't get how it works. If anyone could give me some advices, it would be nice. smiley

Another thing would be to send some information from arduino to a program in C, for example, the number of an variable of somethings.

Thanks smiley
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 207
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK - I understand now.

This is most easily done using serial ports.

The arduino communicate to the PC using the serial port. You need an application running on the PC which can read and write to the serial port. This app can be written in C, but maybe easier in Visual Basic, Delphi or Processing.

That application will be able to poll an email server directly or it can call a PHP script running on a server somewhere.

HTH,

Mike
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, I know C can be quite complicate to communicate with serial. Do you know where I can get some information on how to communicate arduino with VB or Delphi? Or maybe even with processing (can I build some executable program for example *.exe on windows, that would communicate with arduino)?

Thanks mate
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 207
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have no experience with Processing, but with VB and Delphi there are several libraries "out there" that will do serial comms.

For Delphi, I know more Delphi than VB, this one look scompetent:

http://www.domis.de/cms/index.php?module=ContentExpress&func=display&ceid=7

Regards,

MIke
Logged

Montréal, Québec, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Alexandre Quessy
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi !
Socket (network) communication is pretty easy in PHP. You might need to be root, or something, though.  ;D
See http://php.net/fsockopen

a
Logged

Alexandre Quessy

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's not well known, but "php_serial.class.php" is what your wanting.

http://www.communitymx.com/content/article.cfm?page=2&cid=8658A

I've got it, tried it, tested it, it works flawlessly. No need for sockets or intermediary's like processing, or even C for that matter, except the ++ you'll be coding the Arduino with.

A Lamp stack is all you need, connect you arduino to the computer via USB, then your in business smiley

Logged

Pages: [1]   Go Up
Jump to: