Modules assistance for MM newbie! Help!
Have I actually been using TextEdit though? I simply ‘right click’ over what I want to copy from the modules section of the 3rd party modules page on MagicMirror2, before copying and then pasting in the config.js section. Where does TextEdit come in to my procedure?
I have downloaded and installed Atom as suggested. You suggest I 'open the file or right-click and select “open with…” ’ - What file am I opening or selecting to open with?
@Fookes Yes, but how are you opening your
config.jsto paste in your options/configuration? There is an app/program that opens and interprets the file, then saves it again. Whatever you’re using, it is permitting MacOS to change your quotes, thereby breaking the file.
I’m simply (from the MagicMirror folder in terminal on Raspberry Pi - ‘pi@raspberrypi:~/MagicMirror $’ keying in ‘nano config/config.js’. I then paste and amend module stuff in there. I presume I’m doing this all wrong?
Sorry @Fookes, when @yawns mentioned MacOS and you didn’t say you weren’t using a Mac, I assumed that to be the case (given the quotes problem). Did you install Atom on your own computer or the RPi? Are you editing your files on the RPi itself (via a keyboard, in Terminal) or are you connecting remotely from other computer (typically
As a command-line text editor,
nanorespects quotes and should not cause a problem, although I typically avoid pasting code blocks – I find over
sshthat the paste buffers and encodings can get weird.
@ninjabreadman - Hi.
I AM using a Mac! I’m simply VNC-ing into the Raspberry Pi. How can I easily attach images to my communications on this forum? Images of my procedure may help in explaining my situation clearly and concisely.
@Fookes Oh, understood. You can use the little art/photo icon to upload a photo in the forum.
You can then connect to the RPi and edit files remotely (not download, edit, upload; both programs have an “edit” option that will let you edit and save remotely in an editor … change it to Atom for js/css/html files in the preferences).
You can also use Terminal (in Applications > Utilities) to connect to your RPi via
ssh 192.168.0.100) to run commands remotely.
Hi @ninjabreadman - Yes, I paste in to the config.js via VNC. I really appreciate your input and guidance on this. Would it be a request too far to ask you to breakdown the steps you take from start to finish to add a module? You suggest using an SFTP client but I have no knowledge of what this is, how it works, how I incorporate this in to what I’m doing and at what point. I’m happy to install whatever is recommended - I just need guidance on the process. I think you linked to a ‘newbie’s guide to installing a module’ which seemed to suggest the ‘cut and paste’ approach I have been doing - albeit probably on a PC rather than a Mac.
I’d be very grateful but I appreciate it if my request is a request too far…
I’ll try. This is what I use for adding modules:
- Text Editor (e.g. Atom) ‑ that supports syntax highlighting, code formatting, and won’t break your code (i.e. not MacOS’ TextEdit)
- SFTP Client (e.g. FileZilla)
- VNC Client (optional)
Connect to your MM via
sshin Terminal (e.g.
ssh 192.168.0.101), and in your
sshsession do the following:
a. Change directories to
b. Download your module with
git clone https://github.com/matteodanelli/MMM-cryptocurrency.git)
c. This will create the folder for your module
Connect with your SFTP Client to your MM
a. Navigate to your
b. Tell the SFTP Client to open/edit your
config.jswith your Text Editor (this can sometimes be configured in File > Preferences) or by right-clicking the file (to select “Open with…”)
c. Copy the config options from the module’s Git
Readme.md, website, etc. that you want to use
d. Paste the config options into
config.jsthat is open in your Text Editor
e. Save the file, and the SFTP Client will upload the file back to your MM
In Terminal (still in
pm2 restart mmor
npm start devin
a. Have a look at your mirror to see that the changes took, or use a VNC Client to connect to and view your mirror
Hope that helps. Let me know if you have any questions.
@ninjabreadman - Thanks, appreciate you doing this for me. In step one, I’m presuming you’re doing all of this on the Pi - not from a Mac or PC?
@Fookes No problem. No, all of the above will be done from your separate Mac/PC. The directions explain how to use Terminal and SFTP Client to make changes as through you were in front of the machine. All of the apps (Text Editor, SFTP Client, and VNC Viewer) should be installed on your Mac/PC (read: not MM) remote machine.
Otherwise, you can just follow the excellent How to add modules for absolute beginners thread which covers everything as done on the RPi.