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.8k 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.
    • yawnsY Offline
      yawns Moderator
      last edited by yawns

      The problem with your code is, as with several other people (mostly on macs) wrong quotation marks.

      {
      module: "PushBulletNotes",
      header: "iPhone Messages",
      disabled: false,
      position: "bottom_left", // Or any valid MagicMirror position.
      config: {
      	accessToken: "o.(middle bit left out)i",
      	numberOfNotifications: 5,
      	showNotificationIcon: true,
      	showMessage: true,
      	showCount: true,
      	fade: true,
      	maxMsgCharacters: 50,
      	maxHeaderCharacters: 32
      	}
      },
      

      Look at the quotation marks. Left is correct, right is using wrong ones. I think this is a problem with Mac keyboard or mac software.
      0_1520525361886_2018-03-08_17-08-50.png

      1 Reply Last reply Reply Quote 0
      • F Offline
        Fookes
        last edited by

        Thanks for the response.

        Not that I’m doubting you for a second but wouldn’t that stop other modules working? I have other modules using quotation marks (denoting screen position, header etc) which seem to run without issue.

        Secondly, how would I go about changing these to the correct format as I only have a Mac to use.

        Thank you.

        1 Reply Last reply Reply Quote 0
        • yawnsY Offline
          yawns Moderator
          last edited by

          That’s a bad question, as I cannot answer that. I don’t have any mac available, so I cannot test it.
          I don’t know if this is an unwanted feature - in this case - of the editor or of the entire operating system. On Windows I use “notepad++”, I’m sure there is something similar for Mac.

          N 1 Reply Last reply Reply Quote 0
          • N Offline
            ninjabreadman @yawns
            last edited by ninjabreadman

            @yawns It’s usually Macs because they do “smart quote” replacement, including in TextEdit, the default text editor. Straight double quotes (") are different characters from open and close quotes (“ or ”). Such smart replacement done at a program level on certain word processors, like Microsoft Word, but not in things like Notepad, the default text editor for Windows. This is why it’s more of a problem for Mac users.

            @Fookes The solution is to not use TextEdit (much more like WordPad) for any code. Use a true text editor like Atom, BBEdit, TextMate, etc. Download one, install it, and use that to open/edit/save your config and other code files.

            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

              @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 Reply Quote 0
              • N Offline
                ninjabreadman @Fookes
                last edited by

                @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

                  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 Reply Quote 0
                  • N Offline
                    ninjabreadman @Fookes
                    last edited by

                    @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

                      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 Reply Quote 0
                      • N Offline
                        ninjabreadman @Fookes
                        last edited by

                        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
                        • 1
                        • 2
                        • 3
                        • 3 / 3
                        • First post
                          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