You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is a documentation issue or a code issue. On my PIR sensor I can configure the timeout delay to be quite long (it might be broken but it seems like 60 mins or more). When set to this state, the PIR doesn't make any changes to the signal.
For example, the python code MotionSensor.py won't print anything (it just sits at pause) since it doesn't check the initial setting of the sensor - and since the signal may never change if there is motion, MotionSensor.py will never do anything at all - at least in my tests, the code will never trigger for as long as there is motion especially when the device is in H mode and with a high timeout set.
I think this could be fixed relatively simply by checking the initial state of the sensor - this would be straightforward in MotionSensor.py with the following before running pause:
if pir.motion_detected:
motion()
else:
no_motion()
pause()
I'm not sure if the node GPIO code works similarly or not - I also haven't tried yet using the new option for trigger, but I think this would happen regardless of trigger - in LH mode, you would still have to wait for the module timeout to trigger.
So I think this change would be useful - and or perhaps a recommendation to change the PIR timeout to be the minimum value as this module includes a built-in timer, so you don't need to use the PIR timer
The text was updated successfully, but these errors were encountered:
Possibly, but my sensor doesn't seem to retrigger signals when already set (regardless of H or LH trigger mode) - but I'll test it. But in any event having your PIR sensor with a timeout LONGER than the timeout set here in the module is probably not a useful setting combination
I think perhaps a mention in the documentation that your PIR h/w timeout should be less than your module config timeout would be helpful.
On my sensor, in H mode - the sensor simply keeps the line pulled HIGH and resets the timer - it doesn't actually cause the line to change, so code expected for signals won't get any signal since nothing on the line changes.
In LH mode, the sensor will always drop the line to LOW on timeout.
So in H mode, my sensor may never actually trigger a signal at all ever, if the line is already pulled High when the module starts, and while motion it will never go LOW. So I do think it might be important to check the state at start time
I don't know if this is a documentation issue or a code issue. On my PIR sensor I can configure the timeout delay to be quite long (it might be broken but it seems like 60 mins or more). When set to this state, the PIR doesn't make any changes to the signal.
For example, the python code MotionSensor.py won't print anything (it just sits at pause) since it doesn't check the initial setting of the sensor - and since the signal may never change if there is motion, MotionSensor.py will never do anything at all - at least in my tests, the code will never trigger for as long as there is motion especially when the device is in H mode and with a high timeout set.
I think this could be fixed relatively simply by checking the initial state of the sensor - this would be straightforward in MotionSensor.py with the following before running pause:
I'm not sure if the node GPIO code works similarly or not - I also haven't tried yet using the new option for trigger, but I think this would happen regardless of trigger - in LH mode, you would still have to wait for the module timeout to trigger.
So I think this change would be useful - and or perhaps a recommendation to change the PIR timeout to be the minimum value as this module includes a built-in timer, so you don't need to use the PIR timer
The text was updated successfully, but these errors were encountered: