Read the statement by Michael Teeuw here.
Add data from another Pi
-
I have another Pi, in an out-building, collecting data and serving it up via Apache/MySQL/PHP.
How can I get this data integrated in to MM2?
Thank you.
-
If you use Apache and PHP you could create a php script which delivers JSON (or XML) data based on the query and is called by the other raspberry. I would avoid saving data into a text file on the Apache PI and having the MM² PI opening this text file. That could cause trouble when the file is in use (data is currently being written into the file).
-
@yawns said in Add data from another Pi:
…you could create a php script which delivers JSON (or XML) data…
Beyond my capabilities, I’ll keep looking though. Thank you.
-
Okay, one step back …
Your data is stored in your mysql database, right? How is this data stored there? Did you program a script? Or are you using a script/system from the internet? Maybe there already is some kind of a backend you could use? -
@yawns said in Add data from another Pi:
Okay, one step back …
Your data is stored in your mysql database, right?Yes, correct
@yawns said in Add data from another Pi:
How is this data stored there? Did you program a script?
It’s a couple of temperature sensors which are written to the MySQL DB via a .py script.
-
serving it up via Apache/MySQL/PHP.
I can help modify the scrip that servers up the data for viewing and instead of returning HTML it could easily return JSON. That would be step one. To help I would need to see your php files and know what url you are using to access the PHP page. either PM them to me, or point me at a repo.
Step two would be writing a MM module that gets the JSON and displays it right. I may be able help here too.
-
-
Have emailed you with some instructions, but check:
[card:izanbard/MMM-MyTemps]
for the full source -
Thanks for all your work on this, it’s working great!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login