tobyweston / unicorn-hat

Unicorn HAT Pi library
4 stars 0 forks source link

Segmentation Fault #1

Closed marcuscraske closed 9 years ago

marcuscraske commented 9 years ago

I have tried using parts of this repo for a project and I am receiving the following issue:

Starting program: /usr/bin/java -jar rpi-test.jar [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [New Thread 0x76422470 (LWP 7912)] [New Thread 0x670f1470 (LWP 7913)] [New Thread 0x67071470 (LWP 7914)] [New Thread 0x67021470 (LWP 7915)] [New Thread 0x66e5a470 (LWP 7916)] [New Thread 0x66e0a470 (LWP 7917)] [New Thread 0x66d8a470 (LWP 7918)] [New Thread 0x66bff470 (LWP 7919)] lib path: /home/limpygnome/java/libws2811.so loaded

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x76422470 (LWP 7912)] ws2811_led_set (channel=, lednum=0, color=16777215) at rpi_ws281x_wrap.c:213 213 channel->leds[lednum] = color;

With the following code: AdafruitNeoPixel adafruitNeoPixel = new AdafruitNeoPixel(59, 18, 800000, 5, false, 255, 0); adafruitNeoPixel.setBrightness(1.0); for (int i = 0; i < 25; i++) adafruitNeoPixel.setPixelColor(i, (short) 255, (short)255, (short)255); adafruitNeoPixel.show(); adafruitNeoPixel.cleanup();

The issue is the call to ws2811_led_set for the very first pixel.

Any suggestions/ideas?

tobyweston commented 9 years ago

sorry, no ideas here.

Are you using the project verbatim? you said "parts of it"?

You can always go back to the originating C code from pimoroni/unicorn-hat et al and avoid the Java layer

marcuscraske commented 9 years ago

I'm not sure how, but I got it working eventually. I suspect I was not linking the libraries correctly. I've used your build scripts and found them very useful, thank you! Repo starred <3.