Raspberry Pi, PHP and I2C
What is the best way of doing this? If it's even possible...
I want RPI to "talk" with Arduino somehow via PHP. The goal is to make a
web page to control the Arduino. So the page must be able to talk with the
Arduino. I2C is a good solution (using 3 wires), but I can't make it work.
I managed to install Apache, PHP, etc. The page works when I enter the IP
of the RPI. I found a class that uses shell_exec to call i2cset, to send
data to the Arduino. But it seems that shell_exec does not work.
If I copy the string and paste it in theterminal, it works: I see stuff in
the Arduino's serial monitor; but when it's called with shell_exec,
nothing happens.
My questions are, if someone did something like this:
Is this the "right" way of doing it? A web page, communication between RPI
and Arduino
Whether there's a "better" way of doing it.
No comments:
Post a Comment