GrovePi PHP library

Hi

I hope I’m not the only one looking for this, but I’m trying to write GrovePi scripts to work with Grove sensors in PHP. I have a PHP TCP server running on another computer, and I want to write a TCP client on the Raspberry Pi to send sensor data to the server. I’d prefer the client be written in PHP as well due to my own expertise level and for easy code maintenance. Any help/suggestion is greatly appreciated, thanks!

From what I can tell, you are not the first, but the first in some time.

I found this thread where someone was calling a Python script from PHP, but no “native PHP GrovePi interface”:

And this one (for GoPiGo but same principle applies):

and this stackoverflow q/a:

I could possibly help you with the Python, although I don’t have a GrovePi, but did write a few lines of PHP long ago - actually long enough that I don’t remember PHP except that I had a lot of dollar signs, ampersands, and breaking lists up constantly, I think.