diff --git a/config.yml b/config.yml index 9096e8e..fcaccd8 100644 --- a/config.yml +++ b/config.yml @@ -26,55 +26,55 @@ cameras: led: fps: 90 - timeout: 0 + timeout: 1 controllers: - - universe: 9 - ip: 192.168.68.131 + - universe: 0 + ip: 192.168.1.200 ledstart: 0 ledend: 143 mode: rgb - - universe: 3 - ip: 192.168.68.131 + - universe: 1 + ip: 192.168.1.201 ledstart: 144 ledend: 287 mode: rgb - universe: 2 - ip: 192.168.68.131 + ip: 192.168.1.202 ledstart: 288 ledend: 431 mode: rgb - - universe: 4 - ip: 192.168.5.40 + - universe: 3 + ip: 192.168.1.203 ledstart: 432 ledend: 575 mode: rgb - - universe: 1 - ip: 192.168.5.4 + - universe: 4 + ip: 192.168.1.204 ledstart: 576 ledend: 719 mode: rgb - universe: 5 - ip: 192.168.68.131 + ip: 192.168.1.205 ledstart: 720 ledend: 863 mode: rgb - universe: 6 - ip: 192.168.68.131 + ip: 192.168.1.206 ledstart: 864 ledend: 1007 mode: rgb - universe: 7 - ip: 192.168.68.131 + ip: 192.168.1.207 ledstart: 1008 ledend: 1151 mode: rgb - universe: 8 - ip: 192.168.68.131 + ip: 192.168.1.208 ledstart: 1152 ledend: 1295 mode: rgb - - universe: 0 - ip: 192.168.68.130 + - universe: 9 + ip: 192.168.1.209 ledstart: 1296 ledend: 1365 mode: rgbw diff --git a/led_control.py b/led_control.py index 641d64a..403a61b 100755 --- a/led_control.py +++ b/led_control.py @@ -68,6 +68,7 @@ class LEDSystem(): self.leds_size = list() self.controllers = list() self.rings = list(range(len(self.config["position_map"]))) + print("Setting ring status") self.ringstatus = list(range(len(self.config["position_map"]))) #print(rings) #fprint(config["led"]["map"]) @@ -186,16 +187,19 @@ class LEDSystem(): self.map() self.sender = sacn.sACNsender(fps=self.config["led"]["fps"], universeDiscovery=False) self.sender.start() # start the sending thread - """for x in range(len(self.controllers)): - print("Waiting for the controller at", self.controllers[x][2], "to be online...", end="") + for x in range(len(self.controllers)): + print("Waiting for the controller at", self.controllers[x][2], "to be online...", end="", flush=True) count = 0 - while not ping(self.controllers[x][2]): + while not self.ping(self.controllers[x][2]): count = count + 1 if count >= self.config["led"]["timeout"]: - fprint(" ERROR: controller still offline after " + str(count) + " seconds, continuing...") + print(" ERROR: controller still offline after " + str(count) + " seconds, continuing...") break - if count < self.config["led"]["timeout"]: - fprint(" done")""" + else: + print(" done") + #if count < self.config["led"]["timeout"]: + + time.sleep(1) for x in range(len(self.controllers)): print("Activating controller", x, "at", self.controllers[x][2], "with", self.controllers[x][1]-self.controllers[x][0], "LEDs.") self.sender.activate_output(x+1) # start sending out data @@ -320,7 +324,7 @@ class LEDSystem(): # loading animation. cable check if self.firstrun: self.changecount = self.animation_time * 3 - firstrun = False + self.firstrun = False for x in range(len(self.ringstatus)): self.ringstatus[x] = [True, self.animation_time] @@ -645,6 +649,7 @@ if __name__ == "__main__": show = False ring = 1 ledsys = LEDSystem() + ledsys.init() ledsys.startup_animation(show) for x in range(54): ledsys.ringstatus[x][0] = True diff --git a/map.png b/map.png index f10b1b1..d2b773b 100644 Binary files a/map.png and b/map.png differ diff --git a/requirements.txt b/requirements.txt index 295e078..489e3a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,6 +20,7 @@ pyarrow ghostscript pyzbar segno +pyModbusTCP # Development matplotlib