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.

    MMM-usonic Problems

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    24 Posts 2 Posters 7.5k 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 Offline
      sgarg15 @sdetweil
      last edited by

      @sdetweil
      so rn i did the install in the /home/pi/node_modules and i put this in my MMM-Swipe node_helper.js file. (var usonic = require('mmm-usonic'); )

      So then when i run the MagicMirror using npm start these errors show up

      home/pi/MagicMirror/node_modules/electron/dist/electron: symbol lookup error: /home/pi/node_modules/mmm-usonic/build/Release/usonic.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
      npm ERR! code ELIFECYCLE
      npm ERR! syscall spawn
      npm ERR! file sh
      npm ERR! errno ENOENT
      npm ERR! magicmirror@2.10.1 start: `./run-start.sh`
      npm ERR! spawn ENOENT
      npm ERR! 
      npm ERR! Failed at the magicmirror@2.10.1 start script.
      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
      
      npm ERR! A complete log of this run can be found in:
      npm ERR!     /root/.npm/_logs/2020-03-28T03_18_41_984Z-debug.log
      
      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @sgarg15
        last edited by

        @sgarg15 said in MMM-usonic Problems:

        so rn i did the install in the /home/pi/node_modules

        what install?

        MMM_Swipe (https://github.com/mochman/MMM-Swipe)

        already lists that dependency in package.json

          "dependencies": {
            "math-statistics": "latest",
            "mmm-usonic": "latest",
            "mmm-gpio": "latest"
          },
        

        and lists that file in node_helper.js

        const usonic = require('mmm-usonic');
        

        the install instructions say

        1. Navigate into your MagicMirror's modules folder and execute git clone https://github.com/mochman/MMM-Swipe.git. A new folder labeled MMM-Swipe will appear, cd into it.
        
        2 Execute npm install to install the dependencies
        

        if u are adding a library to a module, then in the module folder

        /home/pi/MagicMirror/modules/module_name   (MMM-Swipe in this case)
        

        you would do

        npm install --save mmm-usonic
        

        if all of that is ok, then sometimes a module ships a library that is built on a specific level of electron,
        and our is different…
        so do

        cd ~/MagicMirror
        npm install electron-rebuild
        node_modules/.bin/electron-rebuild
        

        to rebuild the used libraries to match the installed electron version

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sgarg15 @sdetweil
          last edited by sgarg15

          @sdetweil
          So i tried redownloading the module andi get this error when i npm install

          > electron-rebuild -e ../../node_modules/electron-prebuilt
          
          
          An unhandled error occurred inside electron-rebuild
          Unable to find electron's version number, either install it or specify an explicit version
          
          Error: Unable to find electron's version number, either install it or specify an explicit version
              at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/electron-rebuild/lib/src/cli.js:86:19
              at Generator.next (<anonymous>)
              at fulfilled (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/electron-rebuild/lib/src/cli.js:6:58)
          npm ERR! code ELIFECYCLE
          npm ERR! errno 255
          npm ERR! MMM-Swipe@1.1.1 postinstall: `electron-rebuild -e ../../node_modules/electron-prebuilt`
          npm ERR! Exit status 255
          npm ERR! 
          npm ERR! Failed at the MMM-Swipe@1.1.1 postinstall script.
          npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
          

          it says it cant find the electron version number, but idk how to fix it

          1 Reply Last reply Reply Quote 0
          • S Offline
            sgarg15
            last edited by

            @sdetweil
            Any ideas?

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

              @sgarg15 maybe can look tomorrow, not home now

              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 that module (mmm-usonic) is not for magic mirror, but a library for a potential module to use to talk to the hardware…

                sadly has same labeling and same verbiage (module)

                he wrote MMM-Swipe, which uses his library (mmm-usonic)

                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

                  @sgarg15 to fix the electron rebuild problem,

                  the package.json file in MMM-Swipe and change

                  this

                      "postinstall": "node_modules/.bin/electron-rebuild -e ../../node_modules/electron-prebuilt"
                  

                  to this

                      "postinstall": "node_modules/.bin/electron-rebuild"
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sgarg15 @sdetweil
                    last edited by sgarg15

                    @sdetweil So the install worked properly but then when i ran sudo npm start it gave this error

                    [1580:0329/130746.224199:FATAL:electron_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
                    

                    Any idea what that means?

                    S 2 Replies Last reply Reply Quote 0
                    • S Do not disturb
                      sdetweil @sgarg15
                      last edited by

                      @sgarg15 what version of electron are u running?

                      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 @sgarg15
                        last edited by

                        @sgarg15 do NOT use sudo, just npm start

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          sgarg15 @sdetweil
                          last edited by

                          @sdetweil I am pretty sure i updated the electron yesterday using npm install --save-dev electron@latest

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

                            @sgarg15 do not use sudo

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              sgarg15 @sdetweil
                              last edited by sgarg15

                              @sdetweil Oh ok i was just following the instruction, so i used npm start and now it has another error

                              [13:13:56.836] [LOG]    Error: unknown hardware: "BCM2835"
                                  at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/mmm-gpio/lib/gpio.js:34:29
                                  at ChildProcess.exithandler (child_process.js:299:7)
                                  at ChildProcess.emit (events.js:210:5)
                                  at maybeClose (internal/child_process.js:1021:16)
                                  at Socket.<anonymous> (internal/child_process.js:430:11)
                                  at Socket.emit (events.js:210:5)
                                  at Pipe.<anonymous> (net.js:658:12)
                              [13:13:56.862] [LOG]    Error: unknown hardware: "BCM2835"
                                  at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/mmm-usonic/lib/usonic.js:34:29
                                  at ChildProcess.exithandler (child_process.js:299:7)
                                  at ChildProcess.emit (events.js:210:5)
                                  at maybeClose (internal/child_process.js:1021:16)
                                  at Socket.<anonymous> (internal/child_process.js:430:11)
                                  at Socket.emit (events.js:210:5)
                                  at Pipe.<anonymous> (net.js:658:12)
                              

                              Any Ideas?

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

                                @sgarg15 something to do with the MMM-Swipe config info

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                S 1 Reply Last reply Reply Quote 0
                                • S Offline
                                  sgarg15 @sdetweil
                                  last edited by

                                  @sdetweil But it is the same as the one in the readMe

                                  readme:

                                  	{
                                  		module: 'MMM-Swipe',
                                  		position: 'bottom_left',	// Doesn't matter after it's setup.  It should be blank.
                                  									// Best results in one of the side regions like: bottom_left
                                  		config: {
                                  			// See 'Configuration options' for more information.
                                  			echoLeftPin: 24, 		//Left Sensor's BCM Numbered Echo pin - REQUIRED
                                  			triggerLeftPin: 23, 	//Left Sensor's BCM Numbered trigger pin - REQUIRED
                                  			echoRightPin: 26, 		//Right Sensor's BCM Numbered Echo pin - REQUIRED
                                  			triggerRightPin: 25, 	//Right Sensor's BCM Numbered trigger pin - REQUIRED
                                  			useAsButton: false,		//Enable a GPIO output when you "press".
                                  			buttonPin: 8,
                                  			verbose: false,		
                                  			calibrate: false	
                                  		}
                                  	}
                                  

                                  My config:

                                  	{
                                  		module: 'MMM-Swipe',
                                  		position: 'bottom_left',	// Doesn't matter after it's setup.  It should be blank.
                                  									// Best results in one of the side regions like: bottom_left
                                  		config: {
                                  			// See 'Configuration options' for more information.
                                  			echoLeftPin: 27, 		//Left Sensor's BCM Numbered Echo pin - REQUIRED
                                  			triggerLeftPin: 24, 	//Left Sensor's BCM Numbered trigger pin - REQUIRED
                                  			echoRightPin: 23, 		//Right Sensor's BCM Numbered Echo pin - REQUIRED
                                  			triggerRightPin: 22, 	//Right Sensor's BCM Numbered trigger pin - REQUIRED
                                  			useAsButton: false,		//Enable a GPIO output when you "press".
                                  			buttonPin: 8,
                                  			verbose: true,		
                                  			calibrate: true	
                                  		}
                                  	},
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil
                                    last edited by

                                    @sgarg15 said in MMM-usonic Problems:

                                    Error: unknown hardware: “BCM2835”
                                    at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/mmm-usonic/lib/usonic.js:34:29

                                    no idea, you would have to read the code there

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    S 2 Replies Last reply Reply Quote 0
                                    • S Offline
                                      sgarg15 @sdetweil
                                      last edited by

                                      @sdetweil so i had a look and apparently this was missing || hardware === 'BCM2835' from else if (hardware === 'BCM2709' || hardware === 'BCM2835') but when i added that now its giving a different error

                                      [14:05:10.212] [ERROR]  Error: EACCES, Permission denied
                                          at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/mmm-gpio/lib/gpio.js:30:18
                                          at ChildProcess.exithandler (child_process.js:299:7)
                                          at ChildProcess.emit (events.js:210:5)
                                          at maybeClose (internal/child_process.js:1021:16)
                                          at Socket.<anonymous> (internal/child_process.js:430:11)
                                          at Socket.emit (events.js:210:5)
                                          at Pipe.<anonymous> (net.js:658:12) {
                                        errno: 13,
                                        code: 'EACCES',
                                        syscall: 'init'
                                      }
                                      [14:05:10.252] [LOG]    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
                                      [14:05:10.254] [LOG]    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
                                      [14:05:10.276] [LOG]    Whoops! There was an uncaught exception...
                                      [14:05:10.278] [ERROR]  Error: EACCES, Permission denied
                                          at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/mmm-usonic/lib/usonic.js:32:20
                                          at ChildProcess.exithandler (child_process.js:299:7)
                                          at ChildProcess.emit (events.js:210:5)
                                          at maybeClose (internal/child_process.js:1021:16)
                                          at Socket.<anonymous> (internal/child_process.js:430:11)
                                          at Socket.emit (events.js:210:5)
                                          at Pipe.<anonymous> (net.js:658:12) {
                                        errno: 13,
                                        code: 'EACCES',
                                        syscall: 'init'
                                      }
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        sgarg15 @sdetweil
                                        last edited by

                                        @sdetweil after reasearching a bit i dont think this modules works anymore with the new updates of pi and MMM a ssaid here
                                        https://forum.magicmirror.builders/topic/205/mmm-swipe-hand-gestures/32

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

                                          @sgarg15 looks like the usonic needed sudo mode…too… dumb

                                          welcome to the ‘fun’ part of open source, constantly changing runtimes and volunteer developers

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          S 1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            sgarg15 @sdetweil
                                            last edited by

                                            @sdetweil so is this problem solvable or should i find another module?

                                            S 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • 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