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.

    Unknown Error after initializing buttons

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    9 Posts 2 Posters 516 Views 2 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.
    • S Do not disturb
      sdetweil @changaud
      last edited by

      @changaud the error is that the gpio pin is in input only mode not output

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @sdetweil
        last edited by sdetweil

        @changaud looking at the code there is a field used for a button that is not defined

        activeLow

        can you add this to your button definitions

        after pin:
        activeLow: true or false depending on how you have it wired
        if the signal is high when pressed, then false.
        if it has a pull up resistor then true, it will be pulled down when pressed

        you said your python is reporting high sll the time

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          changaud @sdetweil
          last edited by

          @sdetweil
          I tried

          {
          		    	module: 'MMM-Buttons',
          			//position: "middle_center",
          		    	config: {
          				buttons: [
          			    	{
          					pin: 5,
          					activeLow = false,
          					name: "test_button",
          					longPress: {
          					notification: "PAUSE_STOPWATCHTIMER",
          				    	payload: {action: "PAUSE_STOPWATCHTIMER"}
          				},
          					shortPress: {
          				    	notification: "START_STOPWATCH",
          				    	payload: {action: "START_STOPWATCH"}
          					}
          			    	}
          				]
          		    	}
          		}
          and I get this error: 
          
          

          [ERROR] WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/group6/MagicMirror/config/config.js:117
          activeLow = false,
          ^^^^^^^^^^^^^^^^^

          SyntaxError: Invalid shorthand property initializer
          at internalCompileFunction (node:internal/vm:73:18)
          at wrapSafe (node:internal/modules/cjs/loader:1160:20)
          at Module._compile (node:internal/modules/cjs/loader:1212:27)
          at Module._extensions…js (node:internal/modules/cjs/loader:1311:10)
          at Module.load (node:internal/modules/cjs/loader:1098:32)
          at Module._load (node:internal/modules/cjs/loader:945:12)
          at c._load (node:electron/js2c/node_init:2:13672)
          at Module.require (node:internal/modules/cjs/loader:1122:19)
          at require (node:internal/modules/helpers:130:18)
          at loadConfig (/home/group6/MagicMirror/js/app.js:117:14)
          at App.start (/home/group6/MagicMirror/js/app.js:250:18)
          at Object. (/home/group6/MagicMirror/js/electron.js:193:7)
          at Module._compile (node:internal/modules/cjs/loader:1256:14)
          at Module._extensions…js (node:internal/modules/cjs/loader:1311:10)
          at Module.load (node:internal/modules/cjs/loader:1098:32)
          at Module._load (node:internal/modules/cjs/loader:945:12)

          ``t

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @changaud
            last edited by

            @changaud said in Unknown Error after initializing buttons:

            activeLow = false,

            not =

            activeLow : false

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            C 1 Reply Last reply Reply Quote 0
            • C Offline
              changaud @sdetweil
              last edited by

              @sdetweil That did not fix the error :(

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @changaud
                last edited by

                @changaud

                come on…

                when U add a line, you have a trailing comma

                activeLow : false, 
                

                right?

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                C 1 Reply Last reply Reply Quote 0
                • C Offline
                  changaud @sdetweil
                  last edited by

                  @sdetweil Yes I do. I think I will just implement it with TouchButtons. But thank you so much for all your help.

                  S 1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @changaud
                    last edited by

                    @changaud which same error are we talking about? the syntax error or the einval write error

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • 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