/trunk/Server/doorbell/bell_listener.py |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/trunk/Server/doorbell/detect.d/client_alert |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/trunk/Server/doorbell/detect.d |
---|
Property changes: |
Deleted: svn:ignore |
-stop_spotify |
/trunk/Server/doorbell/detect.py |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/trunk/Server/doorbell/test/doorbell_test.wav |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/Server/doorbell/test/freq_test.py |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/trunk/Server/doorbell/test/record.sh |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/trunk/Server/config.py |
---|
2,6 → 2,3 |
motion_stream_port = 8081; |
enable_motion_detect = 1; |
enable_doorbell_listener = 1; |
/trunk/Server/daemon.py |
---|
10,10 → 10,8 |
import subprocess |
import config |
import threading |
import subprocess as sp |
g_subscribed = [] |
g_bellListenerProc = None |
class S(BaseHTTPRequestHandler): |
def _output(self, code, content): |
128,7 → 126,6 |
# --- |
global g_subscribed |
global g_bellListenerProc |
if pvget(postvars, "action")[0] == "client_subscribe": # 1.3.6.1.4.1.37476.2.4.1.1 |
client_ip = self.client_address[0] |
187,16 → 184,11 |
if pvget(postvars, "action")[0] == "motion_on": # 1.3.6.1.4.1.37476.2.4.1.100 |
print "Motion start" |
if config.enable_motion_detect: |
os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_start_safe") |
if config.enable_doorbell_listener: |
g_bellListenerProc = sp.Popen(['python3',os.path.dirname(os.path.abspath(__file__)) + "/doorbell/bell_listener.py"]) |
if pvget(postvars, "action")[0] == "motion_off": # 1.3.6.1.4.1.37476.2.4.1.101 |
print "Motion stop" |
if config.enable_motion_detect: |
os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_stop_safe") |
if config.enable_doorbell_listener: |
sp.Popen.terminate(g_bellListenerProc) |
self._output(200, '') |
/trunk/Server/motion/motion_start_safe |
---|
11,7 → 11,5 |
system(escapeshellcmd(__DIR__.'/usbreset').' '.escapeshellarg("/dev/bus/usb/".$m[1]."/".$m[2])); |
} |
sleep(10); |
system("service motion start"); |