No commit activity in last 3 years
No release in over 3 years
A humble_rpi plugin which detects motion for 1 or more PIR sensor. This plugin can be tested in isolation with the Raspberry Pi.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.10.6, ~> 0.10
>= 0.1.2, ~> 0.1
 Project Readme

Introducing the Humble_rpi-plugin-pir gem

Set up an SPS broker

require 'simplepubsub'

SimplePubSub::Broker.start(host: 'localhost', port: 59000)

Test the SPS messaging is working

Set up a subscriber

require 'sps-sub'

sps = SPSSub.new address: 'localhost', port: 59000

def sps.ontopic(topic, msg)
  puts "%s - %s: %s"  % [Time.now.to_s, topic, msg.inspect]
end

sps.subscribe topic: '#'

Publish a message

require 'sps-pub'

sps = SPSPub.new address: 'localhost', port: 59000
sps.notice 'test: 123'

Testing the plugin

require 'sps-pub'
require 'humble_rpi-plugin-pir'

sps = SPSPub.new address: 'localhost', port: 59000
rpi = HumbleRPiPluginPir.new(settings: {pins: [17, 27], \
              duration: '10 seconds'}, variables: {notifier: sps})
rpi.start

Observed

2015-06-13 21:06:45 +0100 - pi/motion: "detected 4 times within the past 10 seconds"

Resources

humblerpi plugin pir