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

Unknown Error after initializing buttons

Scheduled Pinned Locked Moved Unsolved Troubleshooting
9 Posts 2 Posters 440 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.
  • C Offline
    changaud
    last edited by Apr 10, 2024, 3:01 AM

    Hello all,

    I am trying to implement a way to start a timer with an external device and am using StopwatchTimer and Buttons to do this. Recently, I kept getting this error which leads me to believe that is why my button is not working as expected.

    C7E9F29B-EBF1-4A3C-86C2-205D499A72E8-transformed.jpeg
    Thank you!

    S 1 Reply Last reply Apr 10, 2024, 11:52 AM Reply Quote 0
    • S Away
      sdetweil @changaud
      last edited by Apr 10, 2024, 11:52 AM

      @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 Apr 10, 2024, 12:48 PM Reply Quote 0
      • S Away
        sdetweil @sdetweil
        last edited by sdetweil Apr 10, 2024, 12:48 PM Apr 10, 2024, 12:48 PM

        @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 Apr 10, 2024, 7:58 PM Reply Quote 0
        • C Offline
          changaud @sdetweil
          last edited by Apr 10, 2024, 7:58 PM

          @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 Apr 10, 2024, 8:02 PM Reply Quote 0
          • S Away
            sdetweil @changaud
            last edited by Apr 10, 2024, 8:02 PM

            @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 Apr 10, 2024, 8:19 PM Reply Quote 0
            • C Offline
              changaud @sdetweil
              last edited by Apr 10, 2024, 8:19 PM

              @sdetweil That did not fix the error :(

              S 1 Reply Last reply Apr 10, 2024, 8:35 PM Reply Quote 0
              • S Away
                sdetweil @changaud
                last edited by Apr 10, 2024, 8:35 PM

                @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 Apr 11, 2024, 12:16 AM Reply Quote 0
                • C Offline
                  changaud @sdetweil
                  last edited by Apr 11, 2024, 12:16 AM

                  @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 Apr 11, 2024, 1:42 AM Reply Quote 0
                  • S Away
                    sdetweil @changaud
                    last edited by Apr 11, 2024, 1:42 AM

                    @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
                    1 / 1
                    • First post
                      1/9
                      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