Read the statement by Michael Teeuw here.
Displaying data from MySQL database
-
@Henrik said in Displaying data from MySQL database:
@wolkenaj You could just display the charts from the website with the iFrame module.
https://github.com/alberttwong/MMM-iFrameBINGO…that’s the easiest way :) I have a few ‘modules’ running that way on my mirror.
-
@cirdan Thank you for this tidbit. I was aware that I would need a node helper. I think my preferred course would be to call the php file from the node helper. I will eventually need to also call a bash script from my node helper if possible as well. Do you know of a module that does a similar call that I could look at for reference?
-
@wolkenaj MMM-PIR-Sensor uses shell scripting in node_helper.js to turn the screen on and off with
tvservice
. -
@ninjabreadman This was very helpful to get a node helper function up and running. I am able to receive a socket notification and run a function based on the notification. My program in the node helper currently looks like
activateShell: function(){ console.log("Activating shell"); exec("/Test -s"); }
I receive the activating shell in the console but the script (a simple echo “Hello World”) does not execute. I’ve tried placing it in my module folder, the Magic Mirror folder, and as a path in the desktop, all to no avail. Would you have any ideas on what is wrong?
-
@wolkenaj
/Test
will tell the shell to look in the root of the filesystem (/
) forTest
. Instead,./
will tell it to look in the current working directory (cwd
), which I suspect is~/MagicMirror
. So./Test
is likely what you want.Worst case, you could use the complete path (
~/MagicMirror/Test
or/home/pi/MagicMirror/Test
) which should also work. I also suggest renamingTest
totest.sh
, just so it’s always immediately apparent that it’s a shell script. -
Don’t know if it helps and i am trying to keep it short…
I build an Oiltank measurement system with another raspberry pi.
The results will be written to a mysql database and to a JSON file, which will be uploaded to my NAS.
On the NAS i run the database and a web server.
To Display the results on a webpage i used this php script: https://github.com/cruunnerr/OilTank-Graph-WebPageTo display the results on my MM i got some very much help from our user @doubleT
He wrote this module for me: https://github.com/cruunnerr/MMM-Oiltank
The module grabs the data from a JSON file and shows it on the MM.Maybe this could help :/
MagicMirror:
Web Page: