ws28128-rpi
ws28128-rpi copied to clipboard
does not work on raspberry pi 3
I was trying several things, but it just doesn't start on my raspberry pi 3, the pin doesn't activate and doesn't send anything to the output of pin 18 nor pin 40, when I build it I get several warnings regarding the init_hardware function of the test in C++, however it builds the executable but the output of the pin stays down no matter what instruction I send.
left one of the warnings you sent me below:
ws2812-rpi.cpp:239:46: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] fatal("Failed to open /dev/mem: %m\n");
It works on Raspberry Pi Zero, i try it on Raspberry Pi 3B+ and it doesn't work.
Doesn't work for me either. No idea why yet. Running Raspbian-buster may be relevant.
Looking at https://github.com/raspberrypi/linux/issues/3257 makes me think this is a Buster issue. Possibly.
Mbasttias: This warnings are not relevant to the issue, at least I don't think so. They are because passing a const string to void NeoPixel::fatal(char *fmt, ...)
triggers the error. Change the function params to
void NeoPixel::fatal(const char *fmt, ...)
on line 206(ish) and the warnings go away.
For anyone else in the future I found changing line 235 changing ws2812-rpi.cpp '/dev/mem' to '/dev/gpiomem'. This is because gpiomem is a way of accessing /dev/mem without being root. Tested and resolve that particular issue on the RPI3B+.
See https://raspberrypi.stackexchange.com/questions/47020/accessing-gpio-not-working-as-non-root-cant-open-dev-mem-permission-denie
Note 1: This is not a proper fix if you want it running on multiple pi devices with varying OS's. Note 2: This also create a new problem with line 416 causing the pi to fail accessing the SD card and crashes the PI but that's another issue.