Open harissutanrafiq opened 1 month ago
hey iam forks and add custom port parameter https://github.com/harissutanrafiq/python_sacn_e131
and this is the result https://youtu.be/--cskecVTWU?si=6G72XJrXCMCE28Os
According to the error ValueError: dmxData is a tuple with a max length of 512! The data in the tuple has to be valid bytes! Length was 512
, either the length or the data types inside the tuple are wrong. As the error also states the length of 512, that does not seem to be an issue.
I don't know anything about opencv, so I suspect your pixel_color
is not a valid integer (an integer in the range 0 to 255).
SOLVED
I try send a dmx data from opencv frame to Arduino esp32, but error can you help me ..?
import cv2 import sacn
GRID_WIDTH = 64 GRID_HEIGHT = 64
num_pixels = GRID_WIDTH * GRID_HEIGHT num_channels_per_universe = 512 # Max channels per universe for DMX data
sender = sacn.sACNsender(source_name="Python Sender", universeDiscovery=False) sender.start()
num_universes = (num_pixels * 3 + num_channels_per_universe - 1) // num_channels_per_universe
cap = cv2.VideoCapture(0)
while True: ret, frame = cap.read() if not ret: break
cap.release() sender.stop() cv2.destroyAllWindows()
Traceback (most recent call last): File "sacntest.py", line 56, in <module> sender[i+1].dmx_data = tuple(dmx_data[start_channel:end_channel]) File "C:\python\lib\site-packages\sacn\sending\output.py", line 26, in dmx_data self._packet.dmxData = dmx_data File "C:\python\lib\site-packages\sacn\messages\data_packet.py", line 130, in dmxData raise ValueError(f'dmxData is a tuple with a max length of 512! The data in the tuple has to be valid bytes! ' ValueError: dmxData is a tuple with a max length of 512! The data in the tuple has to be valid bytes! Length was 512