• 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-GPIO-Notifications] Sends notifications based on GPIO events on multiple pins

Scheduled Pinned Locked Moved Utilities
7 Posts 3 Posters 1.6k Views 4 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.
  • W Offline
    wishmaster270 Module Developer
    last edited by wishmaster270 10 days ago Mar 8, 2019, 4:33 PM

    Description:

    This module monitores multiple configurable GPIO pins for state changes; if one of the pins changes to the configured state the notifcations which are specified will be send.
    I wrote this module to send “USER_PRESENCE” notifications based on PIR Sensors.

    Download:

    MMM-GPIO-Notifications
    [card:Tom-Hirschberger/MMM-GPIO-Notifications]

    Example:

    I recently added an example on how to connect a HC-SR501 PIR sensor to GPIO4 and send a SCREEN_ON notification to the MMM-Screen-Powersave-Notification module.


    Version 0.2.9

    • fixed a bug to support string only pin names (thanks to @n00b42)

    Version 0.2.8

    • changed from console.log to logger in node_helper (thanks to @gonzonia)

    Version 0.2.7

    • Introducing the new option forceInfoFileUsage. If this option is set to true the build in device information will be skipped the usage of the gpioinfo.json is forced.

    Version 0.2.6

    • fixed a issue which caused the converter script to not be called correctly by the preinstall script in some container setups
    • fixed bloated output introduced with version 0.2.5

    Version 0.2.5

    ** rolled back**

    Version 0.2.4

    • fixed another issue in the stop function which de-registers all pins during shutdown

    Version 0.2.3

    • fixed a bug which caused the stop function of node_helper.js to throw an error

    Version 0.2.2

    • As the new version of the opengpio library contains the GPIO information of most of the Raspberry devices now, the module tries to use the information of the library in a first mannwe. Only if no information is available for the used model the information generated during installation in gpioinfo.json is used.
    • added exception handling. Now console messages are printed instead of killing the whole application if a pin is already used or no information about the chip and lane to use are available.
    • the module releases all registered pins during shutdown now.

    Version 0.2.1

    • Now not only GPIOs which are named “GPIOX” (where X is the number of the GPIO) in the output of gpioinfo can be used but also named GPIOs.
    • added more output to log to show if a GPIO could be registered or not.

    Version 0.2.0

    • changed the “under the hood” library from onoff to opengpio to make it possible to use GPIO with kernels >= 6.6
    • totally rewrite of the GPIO handling
    • totally rewrite of the installation process
      • the required library gets installed with apt
      • the required toolset gets installed with apt
      • a python script automatically creates a configuration file with your GPIO info inside. The file will be used by the module to determine which GPIO chipset and GPIO line needs to be used for a specific GPIO number
    • removed the test scripts in the example folder and added some new one to either monitor GPIO ports or test a rotary encoder

    BREAKING CHANGES

    • dropped “gpio_debounce” option as the new library does not support debounce (at the moment). Please use delays as an alternative.

    Version 0.1.0

    • it is possible to use rotary encoders with this module now
    • added a hint about how to use the module in a container setup to the readme

    Version 0.0.9

    • it is possible to set different delays for high and low state now
    • the default value of gpio_debounce is now set to 0
    • the old syntax using gpio_state and notifications options is deprecated now. Use notifications_low and notifications_high instead.
    • add examples and a own section about the difference between gpio_debounce and the options delay, delay_low and delay_high to the README

    Version 0.0.8

    • It is possible to send notifications for both states of a watched pin now

    Version 0.0.7

    • Changed the way the necessary re-compile is handled during the installation (electron-rebuild problem). Removed the magicmirror-rebuild dependency and changed back to offical @electron/rebuild. Instead of installing electron-rebuild in the module directory it will be installed to the main MagicMirror project now and will be called from there.

    Version 0.0.6

    • changed the way electron-rebuild is called in the post-installation step to avoid problems if the electron version of the mirror changes

    Version 0.0.3

    • it is now possible to send different notifications based on profiles

    Version 0.0.2

    • introduced an delay option which can be used to suppress notifications if they happen to quick after another (PIR-Sensor without option to configure a hold time)

    Version 0.0.1

    • A first version of the module which montiores different GPIO pins and sends notifications based on the events
    1 Reply Last reply Reply Quote 3
    • A Offline
      AdnanAhmed97
      last edited by Mar 12, 2019, 8:13 PM

      Hi,
      I was thinking of making a phone dialer module through a keypad module which are connected to gpio pins hence i neede some help in that!

      W 1 Reply Last reply Mar 12, 2019, 8:56 PM Reply Quote 0
      • W Offline
        wishmaster270 Module Developer @AdnanAhmed97
        last edited by Mar 12, 2019, 8:56 PM

        @AdnanAhmed97
        Hi, i do not have any experience with keypads. A short research showed me, that the pads work with a polling mechanism. You need to check in a endless loop if two signals on different pins happend. In my opinion this is a bad job for the Pi. A better solution would be to do recognition work on a arduino board and only send the result (key x pressed) via serial interface to the Pi.

        1 Reply Last reply Reply Quote 0
        • W Offline
          wishmaster270 Module Developer
          last edited by Apr 6, 2020, 1:14 PM

          I did some work on the module the last days.
          An example how to use an PIR sensor is integrated now. Also a new delay option is included and the possibility to send different notifications for the same pin based on profiles

          1 Reply Last reply Reply Quote 0
          • K Offline
            kash
            last edited by May 19, 2020, 2:54 PM

            i am following your guide for the pir. i have installed the modules and when i add the gpio notifications module to the config and sudo reboot i get a white screen and site cant be reached error. removing this from the config and everything works as it should.

            normally if there is a issue with the config i will get a message saying this on the display.

            any help would be appreciated. forgive me if ive left anything out.

            W 1 Reply Last reply May 20, 2020, 7:16 PM Reply Quote 0
            • W Offline
              wishmaster270 Module Developer @kash
              last edited by May 20, 2020, 7:16 PM

              @kash Hi, I only get the white screen if my config is broken really badly.
              Are you sure you added a “,” after the last module before the Gpio module?

              1 Reply Last reply Reply Quote 0
              • K Offline
                kash
                last edited by May 23, 2020, 11:57 PM

                fixed that issue. switched from api zero to pi 3 b+ and a fresh install. much quicker now also. may have another teething issue. sometimes the display comes on black screen with backlight then turns of instantly with light at the back of the monitor flashing. manually setting to hdmi one and the monitor keeps switching itself from hdmi 1 to analog around 4-5 times then sticks to hdmi 1 in a off state.

                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