Knifa / led-matrix-zmq-server

A tool for streaming frames to rpi-rgb-led-matrix over ZeroMQ.
GNU General Public License v3.0
28 stars 1 forks source link

Cannot send pictures more than 32767 size #2

Closed Pitou1 closed 4 years ago

Pitou1 commented 4 years ago

Hello,

I've setup a PI4 along with 2x 128x64 panel. Everything works fine with the included tools, but I can't send images of more than 32767 in size. The server doesn't even react.

Here is an example of a 32767 frame:

pi@raspberrypi:~/led-matrix-zmq-server/bin $ sudo ./led-matrix-zmq-server --led-cols=128 --led-rows=64 --led-chain=2 --led-slowdown-gpio=3 Listening on tcp://*:42024 @ 24BPP Frame dimensions: 256x64 Expected frame size: 49152 bytes Frame size mismatch! Expected 49152 but got 32767

And a 32768 frame:

pi@raspberrypi:~/led-matrix-zmq-server/bin $ sudo ./led-matrix-zmq-server --led-cols=128 --led-rows=64 --led-chain=2 --led-slowdown-gpio=3 Listening on tcp://*:42024 @ 24BPP Frame dimensions: 256x64 Expected frame size: 49152 bytes

As you can see no error message. I can do some tcpdump/wireshark if needed.

I also tried to change the type to unsigned int here:

unsigned int frame_size = zmq_sock.recv(&frame, expected_frame_size);

But it didn't help.

Any idea?

Thanks!

Pitou1 commented 4 years ago

Sorry for creating this issue, the problem was on my client side. My variable didn't have the right type and I was limited to signed int.

I changed my code from:

int16_t image_size = stoil(argv[5]);

To:

uint32_t image_size = stoul(argv[5]);

Pitou!

Knifa commented 4 years ago

Glad you got it sorted. :)