MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. mochman
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 2
    • Topics 6
    • Posts 146
    • Groups 1

    Posts

    Recent Best Controversial
    • MMM-Swipe - Hand gestures

      Description

      I was tinkering around with the HC-SR04 Ultrasonic Rangers and I figured I’d use them to try and detect hand motion in the form of “swipe” gestures. In the module’s current form it allows you to detect swiping left or right along with a “press” (when both sensors are covered). The module then sends a notification & payload to other modules for their usage.

      It has a calibration mode which allows you to see the raw distance data from each sensor so you can determine what a good “detection” distance is. I use 20cm for mine. There is also a “verbose” mode which will show you the “swipes” on the screen so you can see if it works for you. The normal mode is invisible, since it is used to send data to other modules for their use.

      The issue I ran into was permissions. I couldn’t figure out a way to use the GPIO portion of the pi without running MagicMirror using sudo npm start

      Screenshots

      Calibrate Mode
      This will constantly update with both sensor’s distances. You can see that I put my hand in front of the right sensor. This is used to tweak the initial trigger distance (how far out from the sensors you want to have your hand to register a movement).

      Verbose Mode
      This will show you when you perform a swipe or press movement. The program waits for a trigger by you putting your hand in front of a sensor, then it looks to see if you move it away and put it in front of the other sensor. This will give you a swipe. If you put your hand in front of both sensors at the same time, it give you a press.

      0_1465068627925_Swipe.jpg

      Here’s the testbed so you can see the wiring.
      0_1465070259612_Board.jpg

      Download

      [card:mochman/MMM-Swipe]

      posted in Utilities module motion swipe hand-gestures
      mochmanM
      mochman
    • RE: Where to run a Script?

      Are you physically connected or VNC’ed to the raspberryPi? If so, open up a terminal window and then type
      sudo python /path/to/your/alexapi/folder/auth_web.py
      then open up your browser (the one in the pi) and go to http://localhost:3000
      log in with your Amazon login/pass. The script should update your settings.py file for you.

      If you are using an ssh program to access the pi. Run the first command as normal, then open up a browser and go to http://your.pi.ip.addr:3000

      The rest should be the same.

      posted in Troubleshooting
      mochmanM
      mochman
    • RE: Voice/motion control

      @coolbotic I just made a motion control module. It’s no where near as intricate as leapmotion though. It just detects hand movements, using 2 ultrasonic sensors and give you a swipe left, right, and press notification. If you have any ideas on how to improve it, please let me know.

      posted in Requests
      mochmanM
      mochman
    • RE: MMM-Gas

      @cowboysdude I just sent you a pull request that should fix their new page.

      posted in Transport
      mochmanM
      mochman
    • RE: Updating to v2.2.0...

      okay, try running
      rm -f ~/MagicMirror/.git/index.lock
      then try git pull again. Hopefully you’ll see more than:
      Updating b799609..20823bf

      posted in Troubleshooting
      mochmanM
      mochman
    • RE: How to update the master branch?

      Seems like you’ve changed some of the files in the MagicMirror directory. If you want to upgrade you’ll have to stash the changes. run git stash in your MagicMirror directory, then run git pull. Stashing wont affect your config.js or any modules you’ve installed into your modules directory.

      Edit
      @ninjabreadman’s has a better fix for you than I do.

      posted in Troubleshooting
      mochmanM
      mochman
    • RE: Trying to write my own Module...

      You don’t have this.xml defined anywhere in your script. If you look at @strawberry-3-141’s post, it says:

      I’m assuming that you saved your server response into this.xml

      You need to create a function that uses the URL and saves that data in a variable called xml. Since your program never does that, this.xml isn’t defined so your if/else always goes to “NO DATA”.

      Why do you have

      getCurrentData: function(that) {
             that.sendSocketNotification('GET-CURRENT-DATA', that.url);
             setTimeout(that.getCurrentData, that.config.interval, that);
          },
      

      in your program? Did you just see it in another persons code? This code snippet sends your URL to node_helper.js. Are you using that node_helper to pull the XML data from the website? If so, you’re going to need a socketNotificationReceived function to get the data and put it into the xml variable.

      The modules documentation shows you some examples of that.

      posted in Development
      mochmanM
      mochman
    • RE: MMM-Gas

      @3d Hmm, the code is supposed to use that variable as an integer. What kind of error were you getting when you had items: 10,?

      Edit: Guess it doesn’t matter. Math.min() still works using a string.

      posted in Transport
      mochmanM
      mochman
    • RE: Nest Thermostat & Protect

      I just took a wack at making a Nest Module. It works, but it’s a pain to set up. Nest has you walk through a bunch of hoops to get an account so you can get a token for your nest. I made a simple script that walks you through it in the root folder. The Module is very basic right now. It just displays your current temp, requested temp, and humidity. I will try to change it in a little bit to make it look like the Nest (Have a blue background around your Temp to indicate it’s cooling, etc…). If you want to take a hand at making it look better, please go right ahead.

      I am using the REST format to get all the data. If someone knows how to use firebase, that’s what Nest prefers you use to get all the info.

      posted in Requests
      mochmanM
      mochman
    • RE: Nubie question... How do I kill magic mirror so that I test new settings for config.js

      If you’re using pm2 then SSH in and run
      pm2 stop mm

      If you’re using the nohup command to run it, you’ll have to find the PID by running
      ps aux | grep npm
      You should see something like
      pi 26292 38.3 4.3 122360 38428 pts/0 Sl 19:17 0:03 npm
      pi 26318 0.0 0.2 4276 1952 pts/0 S+ 19:18 0:00 grep --color=auto npm

      use the first number you see in the line that just has “npm” (in this example it’s 26292)

      then run
      kill 26292 (using your PID number)

      I recommend setting up pm2. It makes it much easier.

      posted in Troubleshooting
      mochmanM
      mochman
    • 1 / 1