import sacn
import sys
import os
+import socket
+import struct
+import fcntl
# fake GPIO dummy class for debuging
class dummy():
def light(self):
print("starting lighting service...")
- sender = sacn.sACNsender()
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ packed_interface = struct.pack('256s', "wlo1".encode('utf_8'))
+ packed_address = fcntl.ioctl(sock.fileno(), 0x8915, packed_interface)[20:24]
+ ip = socket.inet_ntoa(packed_address)
+ print(f"bound to {ip}...")
+
+ sender = sacn.sACNsender(bind_address=ip, source_name="doomsday")
sender.start()
sender.activate_output(2)
sender[2].multicast = True