Skip to content

Commit

Permalink
:setup poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Sep 20, 2022
1 parent 184cddc commit a0e8e08
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 42 deletions.
8 changes: 4 additions & 4 deletions acabsl.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import socket
import sys, getopt

UDPHOST="localhost"
UDPPORT=6002
UDPHOST="127.0.0.1"
UDPPORT=8002

WALLSIZEX=16
WALLSIZEY=16
WALLSIZEX=6
WALLSIZEY=6
NOOFWALLS=1
WALL=0
# Throws an error if an option is not recognized
Expand Down
12 changes: 6 additions & 6 deletions animations/blackAllTheThings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ def set_all(r,g,b):

def set_wall(r,g,b):
acabsl.set_target("127.0.0.1",6002)
for w in range(acabsl.NOOFWALLS):
for x in range(acabsl.WALLSIZEX):
for y in range(acabsl.WALLSIZEY):
for w in range(1):
for x in range(6):
for y in range(8):
acabsl.send(x,y,r,g,b,1,w)
acabsl.update()

def set_decke(r,g,b):
acabsl.set_target("127.0.0.1",8002)
for w in range(acabsl.NOOFWALLS):
for x in range(acabsl.WALLSIZEX):
for y in range(acabsl.WALLSIZEY):
for w in range(2):
for x in range(12):
for y in range(12):
acabsl.send(x,y,r,g,b,1,w)
acabsl.update()

Expand Down
4 changes: 2 additions & 2 deletions animations/enerystar.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def turn_off():
global turned_off
turned_off = True

schedule.every().day.at("16:00").do(turn_on)
schedule.every().day.at("08:00").do(turn_off)
schedule.every().day.at("13:00").do(turn_on)
schedule.every().day.at("07:00").do(turn_off)

while 1:
schedule.run_pending()
Expand Down
2 changes: 1 addition & 1 deletion animations/s-color4-faster.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import time
import math

tick = 1.65
tick = 1.65 / 10

def setcol(col, r, g, b, time):
for i in range(0,6):
Expand Down
17 changes: 10 additions & 7 deletions playlist-wall.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ def getPlaylist():
#wall can be temporary blanked by issuing python black.py in a different screen window
#[20, [["python","animations/black.py","--wall=0"]]],

[20, [["python","animations/screw.py","--wall=0"], ["python","animations/rainbowscroll.py","--wall=1"]]],
[20, [["python","animations/screw.py","--wall=0"]]],
#[20, [["python","animations/pride.py", "--wall=0"]]],
#[20, [["python","animations/green.py", "--wall=0"]]],
[20, [["python","animations/rc3-2021.py", "--wall=0"]]],
#[20, [["python","animations/screw.py","--wall=0"], ["python","animations/rainbowscroll.py","--wall=1"]]],
#[20, [["python","animations/screw.py","--wall=0"]]],
#[20, [["python","animations/rainbowscroll.py","--wall=0"]]],
[20, [["python","animations/multiwall_rainbowscroll.py"]]],
[20, [["python","animations/s-color4-faster.py"]]],
#[20, [["python","animations/multiwall_rainbowscroll.py"]]],
#[20, [["python","animations/s-color4-faster.py"]]],
#[20, [["python","animations/rand.py"]]],
#[20, [["python","animations/python-banner.py"]]],
#[20, [["python","animations/gameoflife.py"]]],
#[20, [["python","animations/dmm/hackerbrucke.py"]]],
[20, [["python","animations/red-sym-scroll.py"]]],
[20, [["python","animations/multiwall_fullpulse.py"]]],
#[20, [["python","animations/red-sym-scroll.py"]]],
#[20, [["python","animations/multiwall_fullpulse.py"]]],
#[20, [["python","animations/dropping.py"]]],
#[20, [["python","animations/dmm/hackerbrucke.py"]]],
#[20, [["python","animations/dmm/dt.py"]]],
#[20, [["python","animations/dmm/uhrzeit.py"]]],
[20, [["python","animations/multiwall_warp_core.py"]]],
#[20, [["python","animations/multiwall_warp_core.py"]]],
]
return playlist
21 changes: 21 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.poetry]
name = "acab-streetlife"
version = "0.1.0"
description = ""
authors = ["muCCC"]
readme = "README.md"
packages = [{include = "acab_streetlife"}]

[tool.poetry.dependencies]
python = "^3.9"
pyserial = "^3.5"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
4 changes: 1 addition & 3 deletions server/acabsl-config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ def write_config(serials, interfaces, matrix):
serials1 = set()

serials1 = set()

input("Please attach the USB to RS485 bridges and press enter.: ")

serials2 = set(os.listdir('/dev/serial/by-id'))

serials = ['/dev/serial/by-id/'+serial for serial in serials2 - serials1]

if len(serials) == 0:
Expand Down Expand Up @@ -114,7 +112,7 @@ def get_tuple(message, default=None):
print("Your matrix is",xsize,"X",ysize,"big.")

min_address = get_number("Please enter the smallest lamp address (in hexadecimal)[10]: ", 16, 0x10)
max_address = get_number("Please enter the biggest lamp address (in hexadecimal)[FF]: ", 16, 0xFF)
max_address = get_number("Please enter the biggest lamp address (in hexadecimal)[BF]: ", 16, 0xFF)
print("Tested address range: %02X - %02X (%d addresses)"%(min_address, max_address, max_address-min_address+1))

addresses = list(range(min_address, max_address+1))
Expand Down
2 changes: 2 additions & 0 deletions server/acabsl-rconfig-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
path=arg

serials = os.listdir(path)
#print("WARNING: serials are currently hardcoded")
#serials = [ 'usb-FTDI_FT232R_USB_UART_A400fvDr-if00-port0', 'usb-FTDI_FT232R_USB_UART_A10044Xp-if00-port0']

if len(serials) == 0:
print "Found no devices. Aborting."
Expand Down
4 changes: 2 additions & 2 deletions server/acabsl_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def interfaceHandler(queue, serial, updatequeue):
time.sleep(0.001)

def createBridge(dev):
serial = serialinterface.SerialInterface(dev,115200,1)
queue = Queue()
serial = serialinterface.SerialInterface(dev, 115200, 1)
queue = Queue(255)
updatequeue = Queue(1)
updatequeues.append(updatequeue)
return (queue, serial, updatequeue)
Expand Down
2 changes: 1 addition & 1 deletion server/acabslrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#inputs = [[port, priority, timeout, socket],
inputs = [{'port': router_base_port + 0, 'priority': 0, 'timeout': 1},
{'port': router_base_port + 1, 'priority': 1, 'timeout': 5},
{'port': router_base_port + 2, 'priority': 2, 'timeout': 5},
{'port': router_base_port + 2, 'priority': 2, 'timeout': 30},
{'port': router_base_port + 3, 'priority': 3, 'timeout': 5},
{'port': router_base_port + 4, 'priority': 4, 'timeout': 5}]

Expand Down
27 changes: 14 additions & 13 deletions server/config-decke.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
server_ip = '0.0.0.0'
server_port = 7000
serials = ['/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A10044Xp-if00-port0', '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A400fvDr-if00-port0']
serials = ['/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A400fvDr-if00-port0', '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A10044Xp-if00-port0']
interfaces = [0, 1]
matrix = [[(0x57,0), (0x4A,1)],
[(0x6D,0), (0x43,1)],
matrix = [
[(0x57,0), (0x47,1)],
[(0x6d,0), (0x4a,1)],
[(0x17,0), (0x41,1)],
[(0x42,0), (0x19,1)],
[(0x67,0), (0x38,1)],
[(0x20,0), (0x56,1)],
[(0x5A,0), (0x3E,1)],
[(0x5C,0), (0x4C,1)],
[(0x4E,0), (0x3F,1)],
[(0x22,0), (0x6B,1)],
[(0x28,0), (0x47,1)],
[(0x26,0), (0x45,1)]]

[(0x42,0), (0x3f,1)],
[(0x67,0), (0x39,1)],
[(0x20,0), (0x38,1)],
[(0x5a,0), (0x43,1)],
[(0x5c,0), (0x45,1)],
[(0x4e,0), (0x4c,1)],
[(0x22,0), (0x19,1)],
[(0x28,0), (0x56,1)],
[(0x26,0), (0x3e,1)],
]
simulation = False
router_base_port = 8000

Expand Down
7 changes: 5 additions & 2 deletions start-all
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ killall -9 python
sleep 2

cd /home/acab/acab-streetlife
# ./start-32c3
#./start-34c3
#./start-muc-sf-festival
./start-wall
./start-decke
#./start-camp19
#./start-decke
#./start-cccamp
#./start-36c3

./web-control-server.py &
6 changes: 5 additions & 1 deletion start-wall
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ python server/acabslserver.py server/config-wall.py &
#python animations/s-color4-faster.py --port=6000 &
python animations/enerystar.py --port=6003 &

screen -A -m -d -S wall-scheduler python scheduler.py playlist-wall 6001 6 8
# Original
screen -A -m -d -S wall-scheduler python scheduler.py playlist-wall-normal 6001 6 6

# For 33c3 lamp testing
#screen -A -m -d -S wall-scheduler python scheduler.py playlist-wall 6001 4 8
3 changes: 3 additions & 0 deletions tests/testlamp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ x = int(sys.argv[1])
y = int(sys.argv[2])
t = float(sys.argv[3])

acabsl.UDPHOST = "localhost"
acabsl.UDPPORT = 8002

while 1:
send(x,y,255,0,0,t)
#update()
Expand Down

0 comments on commit a0e8e08

Please sign in to comment.