rpi-led-matrix icon indicating copy to clipboard operation
rpi-led-matrix copied to clipboard

corrupted size vs. prev_size error

Open mistic100 opened this issue 2 years ago • 0 comments

My setup

  • Raspberry Pi Zero W
  • Adafruit HAT (clone)
  • 64x32 1/16 RGB matrix
  • Raspbian Lite 11
  • Node 16.15

The code

import { Font, GpioMapping, LedMatrix } from 'rpi-led-matrix';
import process from 'process';

const matrix = new LedMatrix(
    {
        ...LedMatrix.defaultMatrixOptions(),
        rows: 32,
        cols: 64,
        hardwareMapping: GpioMapping.AdafruitHat,
    },
    {
        ...LedMatrix.defaultRuntimeOptions(),
    }
);

process.on('SIGINT', () => { 
    matrix.clear().sync();
});

const font = new Font('5x7', `${process.cwd()}/node_modules/rpi-led-matrix/fonts/5x7.bdf`);

matrix.afterSync((matrix, dt, t) => {
    setTimeout(() => matrix.sync());
});

matrix
    .clear()
    .brightness(100)
    .fgColor(0x00adff)
    .drawRect(0, 0, 63, 31)
    .font(font)
    .fgColor(0xff0000)
    .drawText('Hello', 1, 1)
    .drawText('World', 1, 8)
    .sync();

Behavior

The display is initially correct then after 10 seconds the program stops with

corrupted size vs. prev_size
Aborted

Note : I have no problems with the examples of hzeller/rpi-rgb-led-matrix

mistic100 avatar Jul 02 '22 18:07 mistic100