Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensor data acquisition thru API push #25

Open
infrafast opened this issue Aug 31, 2016 · 1 comment
Open

sensor data acquisition thru API push #25

infrafast opened this issue Aug 31, 2016 · 1 comment

Comments

@infrafast
Copy link
Owner

currently, the sensors data are acquired thru the getXXX() function from function.php
ex. getTemperature()
if one want to change the hardware, he needs to rewrite the related code

would be good to imèplement in this function a code that return the value red inside database.
The database values would be themselves fed by a call to a URL thru an API.
ex: http://action.php?setTemperature=30
hence, this API would made the webapp generci so data acquisition could be done by a third party system (like domoticz) to push the data

the current code from function.php getTemperature() etc... would be moved into the crontab.php file that would regularly read sensors and update the value in database

ps: as crontab is currently called every hour by the "piwebpoolhourly.sh" script, this means we would loose the feature to get real time value by clicking the sensor in "measures" section of the GUI.
So probably, it should be put in a different schedule script or a line added in crontab calling the acquisition code every 5 minutes.

@infrafast
Copy link
Owner Author

to be noticed: the table measures already exist, it can be the one collecting all the timestamped-data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant