@vicdilou Can you please start a new thread in Troubleshooting section of the forum? You will get more responses that way and it will avoid highjacking this thread.
Thank you.
@vicdilou Can you please start a new thread in Troubleshooting section of the forum? You will get more responses that way and it will avoid highjacking this thread.
Thank you.
Here is a snippet from Module Development documentation. Full details are here: https://github.com/MichMich/MagicMirror/tree/master/modules#getscripts
getScripts: function() {
return [
'script.js', // will try to load it from the vendor folder, otherwise it will load is from the module folder.
'moment.js', // this file is available in the vendor folder, so it doesn't need to be available in the module folder.
this.file('anotherfile.js'), // this file will be loaded straight from the module folder.
'https://code.jquery.com/jquery-2.2.3.min.js', // this file will be loaded from the jquery servers.
]
}
I would recommend saving it locally in your module directory and loading it from there, because mirror will stall if it can’t access externally hosted file.
Hope this helps.
Great idea to setup test suite. Thanks for getting it started @roramirez. I’ve made some minor cleanup changes on top of your initial work, PR is sitting on GitHub. I will try to contribute to tests as much as I can.
@LincolnClay I’m not really sure why MM code is not picking up your /home/pi/MagicMirror/config/config.js
after restart.
By the way config.js.sample
is just a sample config that can be copied into config.js
and it comes along with MM code and doesn’t really play any role when MM starts up, so there is no need to modify that file in any way.
If your /home/pi/MagicMirror/config/config.js
keeps your desired changes, I wonder if you somehow have 2 different locations where MM is installed and configured. (I noticed that you have node_modules
directory in /home/pi
which seems a bit odd.)
I’m assuming you are starting MM with pm2 on a startup. Can you please show post contents of your /home/pi/mm.sh
file (you can run cat /home/pi/mm.sh
and copy/paste contents of the output) and also run pm2 list
and pm2 show mm
and copy/paste output here?
Sorry I’m kind of running out of ideas without knowing more information.
Thanks.
P.S. I’ve forked our conversation into a separate topic, this way we will not highjack original topic.
@paviro & @MichMich thank you for warm welcome. I’m looking forward to contributing more and helping this amazing community thrive.
@LincolnClay before reinstalling did you delete MagicMirror directory from /home/pi
directory? I just want to make sure that your pi
user has full access to files inside of MagicMirror directory. You can check who owns MagicMirror directory by running following command in the terminal:
ls -l /home/$USER
which will give you output similar to this:
drwxr-xr-x 2 pi 4.0K Jan 21 14:30 foo/
drwxr-xr-x 2 root 4.0K Jan 21 14:31 foo1/
drwxr-xr-x 14 pi 4.0K Jan 8 14:52 MagicMirror/
as you can see in the example above directory foo
and MagicMirror
are owned by pi
user and foo1
is owned by root
. To change ownership from root
to pi
this command needs to be executed (in the example below it will change ownership of foo1
directory from root
to currently logged in user):
sudo chown -R $USER /home/$USER/foo1/
basically it does translates to this: Running as root user (one who currently owns foo1
directory and has write permissions) change owner (‘chown’) recursively (-R
) to currently logged in user ($USER
which is pi
in our case) for directory foo1
. After running this command foo1
will belong to pi
and running ls -l /home/$USER
should produce results similar to this:
drwxr-xr-x 2 pi 4.0K Jan 21 14:30 foo/
drwxr-xr-x 2 pi 4.0K Jan 21 14:31 foo1/
drwxr-xr-x 14 pi 4.0K Jan 8 14:52 MagicMirror/
QUESTION: When you changed /home/pi/MagicMirror/config/config.js
did you actually save that file? I’m trying to understand what you mean by “I get the standard info displayed on MM” Does it show default settings? Did it ever show info with your local weather?
I also see some Xlib: errors or warnings in your logs and I have no idea where that coming from.
P.S. It maybe worth opening your own thread with exact steps that you already did for easier troubleshooting and not to highjack another thread.
@fox If you know of a source for daily horoscope in German (preferably in API form, but RSS feed may also work) I’m happy to look into adding it to the module.
@LincolnClay I’m glad it all worked out for you. But I would be careful adding sudo
command to everything. You may run into permissions issues. The reason why you need to use sudo
when installing packages with apt-get
is because you need to have elevated privileges as you are making system wide changes. Cloning MM repository in your home directory shouldn’t require sudo
, if you use sudo
to clone all files will belong to root
user and your user (usually pi
) will not have permissions to create or modify files in MagicMirror directory (which opens a whole different can of worms).
TL;DR version: try to use sudo
only when necessary.
@cowboysdude Do you have only one monitor (your TV through HDMI) to your Ubuntu box? Also you may want to attempt to run https://github.com/electron/electron-quick-start just to see electron app running on your rig completely outside of MM codebase.
@cianoo45 are you still having problems starting the MM? That writeup was specifically for @cowboysdude who was trying to get MM setup on his Ubuntu system. You should be fine with npm v4.0.0 (on my RasPi I’m running node v6.9.2 and npm v3.10.9 if that matters)
I’m replying from my phone at the moment and will post full reply to all later when I’m in front of my computer.
When I said “but npm start
worked just fine” I meant I was running it from terminal on Ubuntu box and not through SSH from my MacBook.