Jump to content

[SOLVED] PHP to interact with networked sensors


russell_newton

Recommended Posts

I'm interested in trying to use PHP through a browser and webserver in a domestic house to get information from networked sensors (a thermometer for example) and to turn networked switches on and off.

I can't see anything on the net yet, so I thought I would ask in a forum of experts on PHP!  :D

 

I thought that the control functions (WHILE, IF, DO WHILE, FOREACH &c) and logic functions (OR, AND, XOR &c) would allow me to write a script which could collect or send data to say a switch when certain criteria are met &c.  Presumably a database on the webserver could store status information about a switch or sensor which could be used as part of the control. 

I don't know if this is far-fetched or not.  Any thoughts?  ???

Link to comment
Share on other sites

Actually I did something similar in the past,  but the sensor data was written on the filesystem by the sensor itself .

I used a perl daemon  to parse it and to send it to a mysql db . Then the data was extracted from the db via PHP and showed as a web page by an Apache web server ...

Link to comment
Share on other sites

Actually I did something similar in the past,  but the sensor data was written on the filesystem by the sensor itself .

I used a perl daemon  to parse it and to send it to a mysql db . Then the data was extracted from the db via PHP and showed as a web page by an Apache web server ...

 

well yeah...but that's the point.  Some other program is interacting with the sensor, writing the data to a file.  PHP can parse data in a file and display it or put it into a db just fine.  The point though is that it's not designed to directly interact with hardware.

Link to comment
Share on other sites

well i make extra money by doing exotic dancing for their parties sometimes.  i know it's a little bit degrading, but hell we all know that coding doesn't pay the bills anymore...with the economy crashing and all the smart poor people out there in the 3rd world willing to code  just for rice and stringbeans.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.