Go Down

Topic: Arduino PHP Communication (Read 5611 times) previous topic - next topic

linusb

I'd suggest Python.  THe syntax for the code is pretty forgiving for the most part.  You can use the same IDE that you use for PHP.

You'll have to download the Python files and configure Eclipse slightly to configure it.  It's not too hard.  I was able to figure it out and I'm a newb at all this too.

Though before you do all that, I'd suggest you download Processing.  It pretty much has the same exact interface as the ARduino so it will be very famililar and it has some ready-to-go sketches in which you can test to see if you are correctly transferring serial data from or to the ARduino.  Once you know you are properly receiving or transmitting, then I suggest going to Python.

If you need interactivity through the web, you'll probably have to do like I did and use Python as a go-between with the ARuino and php becuase php's serial capabilities are limited in Windows.  

If you are trying to read data from the Arduino, you'll create a python script to read the serial data and write it to a file and then your php script can read the data from a file easily enough and display it on web page.

If you're sending data to the arduino, you do the opposite: use php to write whatever data/code is needed to a file, have Python running in the background which will read the file and then send whatever contents to the aRduino via serial.  

By my novice perspective, other than Processing, Python is the easiest way to communicate with the Arduino's serial port.

Just start with very basic stuff so you know whether or not you are reading/sending serial data as intended and then troubleshoot as you get more sophisticated.  

zoomkat

Post up just what strings or bytes you are trying to send to the arduino including line feeds and carrage returns if used (don't include any PHP stuff) and I'll see if I can show you how I would do it.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Go Up