I added a script to this topic that should see you covered:
https://forum.magicmirror.builders/topic/361/how-to-update/12?page=2
I added a script to this topic that should see you covered:
https://forum.magicmirror.builders/topic/361/how-to-update/12?page=2
@dam4 It is likely that two things are wrong.
First the script needs to be executable so please run:
$ chmod u+x update.sh
this will add execute permissions for the file owner to the file. Have a look at man chmod
for more detail.
The next thing is to make sure that Linux knows where to look for it. This can be quite a complicated subject involving descriptions of the $PATH
environment variable and all sorts. But the easy way to do it is to add a relative or absolute path to the start of the command. So from the command prompt in the folder where the script exists try:
$ ./update.sh
where the .
means “this folder”. For the cron tab through you might want to use the full path something like:
0 2 * * * /full/path/to/file/update.sh
Hope at least some of that is meaningful for you.
@mortenbirkelund just a note if you put a console.log() in the node_helper, then it apears on the command line output (or PM2 out.log if you are using PM2)
@mortenbirkelund these console.log() statements are not crated in the node application, but in the browser. Open the mirror in a main stream browser (IE or chrome or something) and hit F12 which will bring up the dev tools look in the console there for your message.
I use this script, which comes with no guarantee:
#!/usr/bin/env bash
cd /home/pi/MagicMirror
echo "######### CHECKING MAGIC MIRROR ##########"
git fetch
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]
then
echo "######### UPGRADING MAGIC MIRROR #########"
git pull
npm install
else
echo "######## NO UPGRADE REQUIRED #########"
fi
echo ""
cd modules
for directory in *; do
if [[ -d ${directory} && ${directory} != "node_modules" && ${directory} != "default" ]]; then
echo "######### CHECKING ${directory} ##########"
cd ${directory}
git fetch
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
echo "######### UPGRADING ${directory} #########"
git pull
if [[ -e "package.json" && -f "package.json" ]]; then
npm install
fi
else
echo "######## NO UPGRADE REQUIRED #########"
fi
echo ""
cd ..
fi
done
The simple answer is no not really.
I have done some experimentation and if I run the mirror in chrome from the server machine and then cast that page then a still snapshot of the mirror appears on my cast device.
Have emailed you with some instructions, but check:
[card:izanbard/MMM-MyTemps]
for the full source
@izanbard Of course if you already have a webpage with exactly the right stuff on it, then you could use the iframe module.
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.