Closed tihoangyeudau closed 1 year ago
I have written a program in which the packet sent to HyperSerialEsp8266 has the following:
def test_packet(data: np.ndarray, color_order: str): pixel_length = len(data) packet = bytearray([ ord('A'), ord('w'), ord('a'), (pixel_length >> 8), (pixel_length & 0x00FF) ]) packet.append(packet[3] ^ packet[4] ^ 0x55) # CRC byteData = data.astype(np.dtype('B')) # Rearrange colors based on the color_order # ... (as before) # Add color data to the packet for color in byteData: packet.append(color[0]) # Red packet.append(color[1]) # Green packet.append(color[2]) # Blue # Fletcher checksum fletcher1 = sum(packet[6:]) % 255 fletcher2 = (sum(packet[6:]) + fletcher1) % 255 packet.append(fletcher1) packet.append(fletcher2) return packet
however ws2812b shows nothing after running the . Am I wrong somewhere? can you help me fix it?
Im using python 3.11.4, windows 10, wemos d1 mini pinout D4, Led ws2812b, baud 1000000 and works well with HyperHDR
Probably not a valid Fletcher checksum computed this way.
I have written a program in which the packet sent to HyperSerialEsp8266 has the following:
however ws2812b shows nothing after running the . Am I wrong somewhere? can you help me fix it?
Im using python 3.11.4, windows 10, wemos d1 mini pinout D4, Led ws2812b, baud 1000000 and works well with HyperHDR