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

MMM-PIR-Sensor tuning

Scheduled Pinned Locked Moved Troubleshooting
40 Posts 7 Posters 30.7k Views 6 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
    shgmongohh @Jopyth
    last edited by Oct 1, 2016, 6:59 PM

    @Jopyth
    I will try it.
    I want to know if for example the monitor stays off during the night. I have the feeling, that he sometimes turns on when nobody is around. Thats the reason I want to trigger the on/off time.
    When I have the times I can also adjust the minutes he stays on with the knob.

    Sebastian.

    1 Reply Last reply Reply Quote 0
    • S Offline
      shgmongohh
      last edited by Oct 3, 2016, 6:41 PM

      Can anybody tell me, how to write a python programm to trigger the on / off time of the monitor? My monitor starts during the night. I want to now how often he starts.

      Sebastian

      J 1 Reply Last reply Oct 3, 2016, 11:38 PM Reply Quote 0
      • J Offline
        jc21 @shgmongohh
        last edited by Oct 3, 2016, 11:38 PM

        @shgmongohh I have forked the original MMM-Pir-Sensor repo and made some mods to debug my own sensor last week.

        https://github.com/jc21/MMM-PIR-Sensor

        If you add debug: true to the config of my forked code, you’ll get console info about when the sensor detects motion and when it doesn’t. Also note, I’ve renamed the sensorPIN config item to sensorGpio to more accurately indicate the numeric determination.

        [MMM-PIR] [2016-10-04 09:31:07] Watching on GPIO #25 ...
        [MMM-PIR] [2016-10-04 09:34:15] Motion no longer detected
        [MMM-PIR] [2016-10-04 09:34:15] Turning Screen OFF in 30 seconds
        [MMM-PIR] [2016-10-04 09:34:18] Motion detected
        [MMM-PIR] [2016-10-04 09:34:18] Not turning monitor ON, its already ON
        
        S 2 Replies Last reply Oct 5, 2016, 4:00 PM Reply Quote 1
        • S Offline
          shgmongohh @jc21
          last edited by Oct 5, 2016, 4:00 PM

          @jc21
          Thanks alot for your help. I was on vacation and will try it now.

          Sebastian

          1 Reply Last reply Reply Quote 0
          • S Offline
            shgmongohh @jc21
            last edited by Oct 5, 2016, 4:15 PM

            @jc21 said in MMM-PIR-Sensor tuning:

            debug: true

            One stupid question, how is the debug info started?

            1 Reply Last reply Reply Quote 0
            • K Offline
              KirAsh4 Moderator
              last edited by Oct 5, 2016, 6:54 PM

              As @jc21 suggested, add the line debug: true to the module’s config section, and restart MM, then look at the console log.

              A Life? Cool! Where can I download one of those from?

              S 1 Reply Last reply Oct 5, 2016, 7:28 PM Reply Quote 0
              • S Offline
                shgmongohh @KirAsh4
                last edited by Oct 5, 2016, 7:28 PM

                @KirAsh4 said in MMM-PIR-Sensor tuning:

                I have add the line to the config section. My question is, how can I look at the console log, when I have start the mm new.
                Have I go to a special folder, have I to put something in the consule?

                pi@raspberrypi:~ $ pm2 stop mm
                [PM2] Applying action stopProcessId on app [mm](ids: 0)
                [PM2] [mm](0) ✓
                ┌──────────┬────┬──────┬─────┬─────────┬─────────┬────────┬────────┬──────────┐
                │ App name │ id │ mode │ pid │ status  │ restart │ uptime │ memory │ watching │
                ├──────────┼────┼──────┼─────┼─────────┼─────────┼────────┼────────┼──────────┤
                │ mm       │ 0  │ fork │ 0   │ stopped │ 0       │ 0      │ 0 B    │ disabled │
                └──────────┴────┴──────┴─────┴─────────┴─────────┴────────┴────────┴──────────┘
                 Use `pm2 show <id|name>` to get more details about an app
                pi@raspberrypi:~ $ pm2 start mm
                [PM2] Applying action restartProcessId on app [mm](ids: 0)
                [PM2] [mm](0) ✓
                [PM2] Process successfully started
                ┌──────────┬────┬──────┬──────┬────────┬─────────┬────────┬────────────┬────────   ──┐
                │ App name │ id │ mode │ pid  │ status │ restart │ uptime │ memory     │ watchin   g │
                ├──────────┼────┼──────┼──────┼────────┼─────────┼────────┼────────────┼────────   ──┤
                │ mm       │ 0  │ fork │ 1246 │ online │ 0       │ 0s     │ 2.262 MB   │ disable   d │
                └──────────┴────┴──────┴──────┴────────┴─────────┴────────┴────────────┴────────   ──┘
                 Use `pm2 show <id|name>` to get more details about an app
                pi@raspberrypi:~ $
                

                So, what next?

                Sebastian

                1 Reply Last reply Reply Quote 0
                • K Offline
                  KirAsh4 Moderator
                  last edited by Oct 5, 2016, 7:42 PM

                  You need the browser’s console log. I forgot how to pull it up in Electron, but a search on the forums should give you an answer. Alternatively, you can open your favorite browser on a different machine (on the same network) and visit the rpi’s ip and MM’s port, like so: http://rpi_ip:8080 (fill in rpi_ip). Then hit F12 on the browser to open the console panel.

                  A Life? Cool! Where can I download one of those from?

                  J 1 Reply Last reply Oct 5, 2016, 7:54 PM Reply Quote 0
                  • J Offline
                    Jopyth Moderator @KirAsh4
                    last edited by Jopyth Oct 5, 2016, 7:55 PM Oct 5, 2016, 7:54 PM

                    @KirAsh4 actually it looks like most of the Debug log will appear on the server side.

                    You can check this with ‘pm2 logs mm’. Add ‘–lines 100’ to show more off the logs (100) in this case.

                    Helpful sticky: How to troubleshoot

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      KirAsh4 Moderator
                      last edited by Oct 5, 2016, 7:57 PM

                      Most being the keyword, not all. And honestly, when I’m developing, I don’t rely on what pm2 is telling me, but rather specifically what the browser sees (or doesn’t) and where the errors lie. pm2 doesn’t do that. I can get all errors and debug messages in one place: the browser’s console log. I don’t need to open yet another window just to look at pm2’s logs.

                      A Life? Cool! Where can I download one of those from?

                      J 1 Reply Last reply Oct 5, 2016, 8:12 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 1 / 4
                      1 / 4
                      • First post
                        9/40
                        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