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

PIR-Sensor with relay

Scheduled Pinned Locked Moved Solved Troubleshooting
4 Posts 2 Posters 778 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.
  • P Offline
    PottiMc
    last edited by Oct 8, 2019, 1:50 PM

    Hi all,

    I try to run a relay which is cutting down the power to my lcd monitor. The PIR-Sensor module works fine as long as i don’t use the relayPin command. I get the following error message in the logs:

    { Error: EPERM: operation not permitted, write
    at Object.fs.writeSync (fs.js:707:3)
    at Gpio.writeSync (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/onoff/onoff.js:243:8)
    at Class.activateMonitor (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:27:24)
    at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:124:30
    at gpio._listeners.slice.forEach.callback (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/onoff/onoff.js:135:9)
    at Array.forEach ()
    at pollerEventHandler (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/onoff/onoff.js:134:32) errno: -1, syscall: ‘write’, code: ‘EPERM’ }

    Can somebody tell me what to do?

    S 1 Reply Last reply Oct 8, 2019, 2:06 PM Reply Quote 0
    • S Offline
      sdetweil @PottiMc
      last edited by Oct 8, 2019, 2:06 PM

      @PottiMc i would guess that you have the wrong pin for the relay

      from the onoff library

      Note that EPERM: operation not permitted, write isn't actually related to permissions. An EPERM error occurs when an operation is not permitted because it doesn't make sense. In this case it looks like the EPERM error occurred because an an attempt was made to write data to an input. Here's an example:
      
      pi@raspberrypi:~ $ cd /sys/class/gpio/
      pi@raspberrypi:/sys/class/gpio $ echo 17 > export 
      pi@raspberrypi:/sys/class/gpio $ cd gpio17
      pi@raspberrypi:/sys/class/gpio/gpio17 $ echo in > direction 
      pi@raspberrypi:/sys/class/gpio/gpio17 $ echo 1 > value 
      -bash: echo: write error: Operation not permitted
      pi@raspberrypi:/sys/class/gpio/gpio17 $ 
      Errors related to permissions are usually EACCES errors.
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • P Offline
        PottiMc
        last edited by Oct 8, 2019, 4:18 PM

        Thank you. I managed it! The problem was that my start script didn’t switch the gpio to output correctly. You gave me the right direction.

        S 1 Reply Last reply Oct 8, 2019, 4:19 PM Reply Quote 0
        • S Offline
          sdetweil @PottiMc
          last edited by Oct 8, 2019, 4:19 PM

          @PottiMc awesome… glad it worked out

          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/4
            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