Banana Pi BPI-CM4

I have bananapi cm4 with base module so now i am trying to control ws2812b led connected to gpio 23 on this board.

i have followed all the information given in the Getting Started with CM4 - Banana Pi Wiki to install wiringpi rpi.gpio and it successfully installed.

now when i run the basic ws2812b code it gives an error like this

CODE:

import time
from rpi_ws281x import PixelStrip, Color

# LED strip configuration:
LED_COUNT = 16      # Number of LED pixels.
LED_PIN = 18        # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000  # LED signal frequency in hertz (usually 800khz)
LED_DMA = 10         # DMA channel to use for generating signal (try 10)
LED_BRIGHTNESS = 255  # Set to 0 for darkest and 255 for brightest
LED_INVERT = False   # True to invert the signal (when using NPN transistor level shift)
LED_CHANNEL = 0

# Create PixelStrip object with appropriate configuration.
strip = PixelStrip(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
strip.begin()

def colorWipe(strip, color, wait_ms=50):
    """Wipe color across display a pixel at a time."""
    for i in range(strip.numPixels()):
        strip.setPixelColor(i, color)
        strip.show()
        time.sleep(wait_ms / 1000.0)

# Main program logic follows:
if __name__ == '__main__':
    # Color wipe animations.
    colorWipe(strip, Color(255, 0, 0))  # Red wipe
    colorWipe(strip, Color(0, 255, 0))  # Green wipe
    colorWipe(strip, Color(0, 0, 255))  # Blue wipe

ERROR:

sudo python3 led.py 
Traceback (most recent call last):
  File "led.py", line 15, in <module>
    strip.begin()
  File "/usr/local/lib/python3.8/dist-packages/rpi_ws281x/rpi_ws281x.py", line 143, in begin
    raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, str_resp))
RuntimeError: ws2811_init failed with code -3 (Hardware revision is not supported)
Segmentation fault

So can you give me the solution to control my ws2812b led strip using bananapi cm4 gpio

rpi_ws281x lib is only for rpi hardware, so it can’t be used on other platform. Three ways for gpio control on Bananapi CM4, WiringPi, Rpi.gpio and WiringPi2-Python