• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Modules assistance for MM newbie! Help!

Scheduled Pinned Locked Moved Troubleshooting
21 Posts 4 Posters 9.0k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    Fookes
    last edited by Mar 9, 2018, 9:14 AM

    @ninjabreadman - thanks for the info. As explained throughout the thread I’m the exact definition of a ‘newbie’. When detailing text editors such as TextEdit, Atom etc, what role do they play in what I am trying to achieve?

    As an example:

    I want to install a TP module I’ve found (as this Pushbullet one is). There is a ‘using this module’ section which tells us to add the following configuration block to the ‘modules’. I have simply been copy and pasting this configuration in to the config.js section and tweaking the parts I can/want to. How and why would I use Atom to do this? Genuine question - I simply have no idea. I’m eager to learn but clearly need basic guidance on this.

    Appreciate it.

    N 1 Reply Last reply Mar 9, 2018, 1:12 PM Reply Quote 0
    • N Offline
      ninjabreadman @Fookes
      last edited by Mar 9, 2018, 1:12 PM

      @Fookes No problem. You need to use a program (app) to open any file. Right now, you’re using what came with your Mac (called TextEdit). But it’s much more of a note taking or word processing program than a text editor for code. It doesn’t understand code, and does things that break it. Once you’ve downloaded and installed Atom (by moving it to your ~/Applications folder on your Mac) you can run it then open the file, or right-click a file and select “Open with…” and choose Atom. Not only will it not break your code, it will colour-code (called “syntax-highlighting”) your code, show you where brackets/braces match, and can help to make your code legible (called “Beautify” in Atom).

      For adding modules, check out this walkthrough for tips: https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners

      Problem with config or JavaScript? Copy/paste it into JSHint.
      Check out the detailed walkthroughs on install, config, modules, etc.

      1 Reply Last reply Reply Quote 1
      • F Offline
        Fookes
        last edited by Fookes Mar 9, 2018, 5:25 PM Mar 9, 2018, 2:30 PM

        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?

        N 1 Reply Last reply Mar 9, 2018, 10:32 PM Reply Quote 0
        • N Offline
          ninjabreadman @Fookes
          last edited by Mar 9, 2018, 10:32 PM

          @Fookes Yes, but how are you opening your config.js to 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.

          Problem with config or JavaScript? Copy/paste it into JSHint.
          Check out the detailed walkthroughs on install, config, modules, etc.

          1 Reply Last reply Reply Quote 1
          • F Offline
            Fookes
            last edited by Mar 10, 2018, 8:48 AM

            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?

            N 1 Reply Last reply Mar 10, 2018, 12:02 PM Reply Quote 0
            • N Offline
              ninjabreadman @Fookes
              last edited by Mar 10, 2018, 12:02 PM

              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 ssh)?

              As a command-line text editor, nano respects quotes and should not cause a problem, although I typically avoid pasting code blocks – I find over ssh that the paste buffers and encodings can get weird.

              Problem with config or JavaScript? Copy/paste it into JSHint.
              Check out the detailed walkthroughs on install, config, modules, etc.

              1 Reply Last reply Reply Quote 1
              • F Offline
                Fookes
                last edited by Mar 10, 2018, 12:17 PM

                @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.

                Regards

                N 1 Reply Last reply Mar 10, 2018, 3:00 PM Reply Quote 0
                • N Offline
                  ninjabreadman @Fookes
                  last edited by Mar 10, 2018, 3:00 PM

                  @Fookes Oh, understood. You can use the little art/photo icon to upload a photo in the forum.

                  Are you pasting via VNC? I suggest using an SFTP client like FileZilla or CyberDuck.

                  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 (ex. ssh 192.168.0.100) to run commands remotely.

                  Problem with config or JavaScript? Copy/paste it into JSHint.
                  Check out the detailed walkthroughs on install, config, modules, etc.

                  1 Reply Last reply Reply Quote 0
                  • F Offline
                    Fookes
                    last edited by Mar 10, 2018, 4:04 PM

                    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…

                    N 1 Reply Last reply Mar 10, 2018, 10:15 PM Reply Quote 0
                    • N Offline
                      ninjabreadman @Fookes
                      last edited by Mar 10, 2018, 10:15 PM

                      Hi @Fookes,

                      I’ll try. This is what I use for adding modules:

                      Ingredients

                      • 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)
                      • Terminal
                      • VNC Client (optional)

                      Directions

                      1. Connect to your MM via ssh in Terminal (e.g. ssh 192.168.0.101), and in your ssh session do the following:
                        a. Change directories to ~/MagicMirror/modules
                        b. Download your module with git clone (e.g. git clone https://github.com/matteodanelli/MMM-cryptocurrency.git)
                        c. This will create the folder for your module

                      2. Connect with your SFTP Client to your MM
                        a. Navigate to your ~/MagicMirror/config directory
                        b. Tell the SFTP Client to open/edit your config.js with 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.js that is open in your Text Editor
                        e. Save the file, and the SFTP Client will upload the file back to your MM

                      3. In Terminal (still in ssh) run pm2 restart mm or npm start dev in ~/MagicMirror/.
                        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.

                      Problem with config or JavaScript? Copy/paste it into JSHint.
                      Check out the detailed walkthroughs on install, config, modules, etc.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      2 / 3
                      • First post
                        12/21
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy