]> OzVa Git service - doomsday-clock/commitdiff
Added reciver file for testing and a .gitignore
authorwill <greenwoodw50@gmail.com>
Mon, 19 Aug 2024 22:25:57 +0000 (23:25 +0100)
committerwill <greenwoodw50@gmail.com>
Mon, 19 Aug 2024 22:25:57 +0000 (23:25 +0100)
.gitignore [new file with mode: 0644]
clock.py
reciver.py [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..a699830
--- /dev/null
@@ -0,0 +1 @@
+./.venv
index 44cf4f4dfb19a73f451902398f7e8d997566d60a..5e5cfd7f9aa409c51dc63e4c360bf65632dda89c 100755 (executable)
--- a/clock.py
+++ b/clock.py
@@ -4,13 +4,13 @@ from http.server import HTTPServer, SimpleHTTPRequestHandler
 from multiprocessing import Process, Array, Value
 import subprocess
 import requests
+import socket
+import struct
+import fcntl
 import time
 import sacn
 import sys
 import os
-import socket
-import struct
-import fcntl
 
 # fake GPIO dummy class for debuging
 class dummy():
diff --git a/reciver.py b/reciver.py
new file mode 100755 (executable)
index 0000000..4e5f750
--- /dev/null
@@ -0,0 +1,27 @@
+#!./.venv/bin/python
+
+import sacn
+import sys
+import os
+
+receiver = sacn.sACNreceiver(bind_address="192.168.8.103")
+receiver.start()
+
+@receiver.listen_on('universe', universe=2)
+def callback(packet):
+       if packet.dmxStartCode == 0x00:
+               print(packet.dmxData)
+
+receiver.join_multicast(2)
+
+try:
+       while True:
+               pass
+
+except KeyboardInterrupt:
+       receiver.leave_multicast(2)
+       receiver.stop()
+       try:
+               sys.exit()
+       except SystemExit:
+               os._exit(130)