lucavb / homebridge-hc-sr501

Homebridge plugin for the hc-sr501 motion sensor
GNU General Public License v3.0
10 stars 1 forks source link

No motion detected #4

Closed Rasket787 closed 7 years ago

Rasket787 commented 7 years ago

Hi :)

First of all I would like to thank you for your plugin. It would be great but unfortunatelly it doesn't work for me.

I use the third pin from below on the left side. I think it has physical id=35, wPi id=24 and BCM id=19. So according to your description and other closed issues I used pinID = 19. If i try it with "gpio read 24" it works fine, and if i use it with other python test program it works also. And of course I install onoff and I add pi user to gpio. I have no idea what is the problem. Can you help me?

I have already used couple of things with my homebridge and they are working well.

lucavb commented 7 years ago

sorry about the long delay. totally forgot about your post. maybe try the node code posted on the onoff package site? basically something like this

var Gpio = require('onoff').Gpio;
var button = new Gpio('yourpinidgoeshere' , 'in', 'both');

button.watch(function(err, value) {
  console.log(value);
});

if this is working so should the plugin? report back if it does. https://www.npmjs.com/package/onoff

Rasket787 commented 7 years ago

I try this code and it works and then i try your code and it works also. I dont know what was the problem. Thank you for your reply and help! :)