OF v20180313 armv6l on Raspberry Pi 3 + ofxPiMapper + ofxKinect

PiBakery download:


*Use to configure under “On First boot”> setup WIFI, set user password to, and set hostname…(OPTIONAL: enable VNC, enable SPI, enable I2C) then in a separate block under “On Every Boot”> Set boot option to “Console logged in”

PiFinder download:
http://ivanx.com/raspberrypi/files/PiFinder.zip

*Use PiFinder to locate the SSH Address of your Pi

*SSH into the Pi from a different computer using
ssh pi@###.###.###.###
————————————————————————
sudo apt-get clean

sudo apt-get update

sudo apt-get upgrade

sudo raspi-config

  1. Select 7 Advanced Options: Select 1 Expand Filesystem and hit Enter
  2. Select 7 Advanced Options: Select A3 Memory Split and hit Enter
    • Type 64 and Hit ok
  3. Select 7 Advanced Options: Select A7 GL Driver
    • G3 Legacy and Hit
    • “The GL driver is disabled.” Hit ok
  4. Hit Finish
    ————————————————————————

cd

wget http://ci.openframeworks.cc/versions/nightly/of_v20180313_linuxarmv6l_nightly.tar.gz

sudo reboot
————————————————————————
*SSH into the Pi from a different computer using
ssh pi@###.###.###.###

sudo apt-get clean

sudo apt-get update

sudo apt-get upgrade

mkdir openFrameworks

tar vxfz of_v20180313_linuxarmv6l_nightly.tar.gz -C openFrameworks --strip-components 1

cd /home/pi/openFrameworks/scripts/linux/debian

sudo ./install_dependencies.sh

Do you want to continue? [Y/n] y hit return

Do you want to continue? [Y/n] y hit return

sudo ./install_codecs.sh

Do you want to continue? [Y/n] y hit return

cd /home/pi/openFrameworks/libs/openFrameworksCompiled/project/linuxarmv6l

nano config.linuxarmv6l.default.mk

  1. Replace
    PLATFORM_LIBRARIES += GLESv2
    PLATFORM_LIBRARIES += GLESv1_CM
    PLATFORM_LIBRARIES += EGL
    with
    PLATFORM_LIBRARIES += brcmGLESv2
    PLATFORM_LIBRARIES += brcmEGL
    *To save the changes you’ve made, press Control + O
    *hit return
    *To exit nano, type Control + X

sudo make Release -C /home/pi/openFrameworks/libs/openFrameworksCompiled/project
————————————————————————
*Compile your first app
cd /home/pi/openFrameworks/examples/graphics/polygonExample

make

make run
————————————————————————
Unlike other platforms, OF Raspberry Pi projects do not make use of the projectGenerator. To create your own project from scratch, copy examples/empty/emptyExample into apps/myApps/yourProjectName folder and start from there
For example:
————————————————————————
*File Structure: cp -R /home/pi/openFrameworks/examples/empty/emptyExample /home/pi/openFrameworks/apps/myApps/myRpiApp

*File Structure: cd /home/pi/openFrameworks/apps/myApps/myRpiApp

————————————————————————
*Our polygonExample:
cp -R /home/pi/openFrameworks/examples/graphics/polygonExample /home/pi/openFrameworks/apps/myApps/myRpiApp

cd /home/pi/openFrameworks/apps/myApps/myRpiApp

make

make run
————————————————————————
#Don’t forget to reset the memory split from raspi-config back to 128 or 256.

sudo shutdown -h now

————————————————————————
#ofxPiMapper
————————————————————————
*SSH into the Pi from a different computer using
ssh pi@###.###.###.###

sudo apt-get clean

sudo apt-get update

sudo apt-get upgrade

cd /home/pi/openFrameworks/addons/

git clone https://github.com/jvcleave/ofxOMXPlayer.git

cd /home/pi/openFrameworks/addons/ofxOMXPlayer

git checkout 0.9.0-compatible

cd /home/pi/openFrameworks/addons

git clone https://github.com/kr15h/ofxPiMapper.git

cd /home/pi/openFrameworks/addons/ofxPiMapper/example

make && ./bin/example
————————————————————————
————————————————————————
*to run example:
cd /home/pi/openFrameworks/addons/ofxPiMapper/example

make && ./bin/example

./bin/example -f
————————————————————————

*to move example:
cp -R /home/pi/openFrameworks/addons/ofxPiMapper/example /home/pi/openFrameworks/apps/myApps/PiMapperApp


*to run PiMapperApp:
cd /home/pi/openFrameworks/apps/myApps/PiMapperApp

./bin/example -f
————————————————————————

sudo shutdown -h now

————————————————————————
#ofxKinect
————————————————————————
*SSH into the Pi from a different computer using
ssh pi@###.###.###.###

sudo apt-get clean

sudo apt-get update

sudo apt-get update

cd /home/pi/openFrameworks/examples/computer_vision/kinectExample

sudo make

cd bin

sudo ./kinectExample

————————————————————————
————————————————————————
*to move example:
cp -R /home/pi/openFrameworks/examples/computer_vision/kinectExample /home/pi/openFrameworks/apps/myApps/kinectApp


*to run ofxKinectApp:
cd /home/pi/openFrameworks/apps/myApps/kinectApp/bin

sudo ./kinectExample

————————————————————————

sudo shutdown -h now

6 Likes

Hello !
Thanks for your step by step go through, it’s very appreciable !
Happy to see we can go on with Stretch now.
I followed the steps, except that I got the 2018-04-02 nightly-build.
As I can see there is already a patch for the PLATFORM_LIBRARIES for RPi on the
config.linuxarmv6l.default.mk file. I hope this works alright, here it is.

# raspberry pi specific
ifeq (,$(wildcard $(RPI_ROOT)/opt/vc/libGLESv2.so))
	PLATFORM_LIBRARIES += GLESv2
	PLATFORM_LIBRARIES += GLESv1_CM
	PLATFORM_LIBRARIES += EGL
else
	PLATFORM_LIBRARIES += brcmGLESv2
	PLATFORM_LIBRARIES += brcmEGL
endif

Then I try to run the polygonExample but it shows errors:

pi@raspberrypi:~/openFrameworks-20180402/examples/graphics/polygonExample $ make run
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 rtaudio gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
[warning] ofAppEGLWindow: init(): X11 not availble on RPI yet, using a native window instead
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1920x1080
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1024x768
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0xffe458
libEGL warning: DRI2: failed to authenticate
[notice ] ofAppEGLWindow: createSurface(): no current renderer selected
[notice ] ofAppEGLWindow: createSurface(): default renderer detected
[ error ] ofAppEGLWindow: createSurface(): no matching configs were found, num_configs: 0
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupMouse(): mouse_fd=6 devicePath=/dev/input/by-path/platform-3f980000.usb-usb-0:1.3:1.0-event-mouse
[notice ] ofAppEGLWindow: setupMouse(): mouse device name = Logitech USB Optical Mouse
[ error ] ofAppEGLWindow: ioctl GABS failed
[ error ] ofAppEGLWindow: ioctl GABS failed
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard_fd=7 devicePath=/dev/input/by-path/platform-3f980000.usb-usb-0:1.5:1.0-event-kbd
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard device name = SEM USB Keyboard
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
//And this last line continues forever

I hope this is an easy fix. :grinning:

Then I tried to make ofxPiMapper and got this after an hour of compilation:

/usr/bin/ld: /home/pi/openFrameworks-20180402/addons/obj/linuxarmv6l/Release/ofxOMXPlayer/src/ofxOMXPlayer.o: undefined reference to symbol 'eglCreateImageKHR'
//opt/vc/lib/libbrcmEGL.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
/home/pi/openFrameworks-20180402/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:403: recipe for target 'bin/example_basic' failed
make[1]: *** [bin/example_basic] Error 1
make[1]: Leaving directory '/home/pi/openFrameworks-20180402/addons/ofxPiMapper/example_basic'
/home/pi/openFrameworks-20180402/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed
make: *** [Release] Error 2

Any idea ?

PS: I’m not sure it is a good advice to give but I always use the “make […] -j3” option in order to use 3 cores for 3x faster compilation. (I had freezes when trying -j4).
It has always worked till now. By reading the forum, it looks like you should be using -j2 to be sure, because of the maxed use of swap memory on the SD card. So make sure you have a class 10 for this.

Ok I see, this was not a fix of what you suggested.
So I changed the first three line by the next two, and now the polygonExample works.

I also compiled and run ofxPiMapper example-basic, fine !

Thanks

I’m literally trying to get openFrameworks to work on the pi 3 b+ what did you do in the file config.linuxarmv6l.default.mk to make it work?

I changed this:

to this:

Yes that is it basically. As @Nat_Fast said, then if you already compile, do this to force recompiling of OF:

cd /home/pi/openFrameworks/libs/openFrameworksCompiled/project/linuxarmv6l

sudo make Release -C /home/pi/openFrameworks/libs/openFrameworksCompiled/project -B

The “-B” here (aka “–always-make”) will update OF and it was rolling fine for me then.

Very happy with that !

This should be fixed already in tomorrow’s nightlies

1 Like

thanks, that would make it a lot easier.

Thanks, thats what I ended up doing before you replied.

Hi all,
seems that I have still this kind of problem. I downloaded of_v0.10.0 armv6 yesterday and installed it on my RaspPi3B+ running the NOOBS version of Raspian. Today I did all the things mentioned above:

  • apt clean/update/upgrade
  • raspi-config
  • reboot
  • install_dep
  • install_codecs
  • updated config.linuxarmv6l.default.mk
  • sudo make Release -B

Still none of the examples work. They all compile but at run time I get the following output:

pi@raspberrypi:~/Dokumente/of_v0.10.0_linuxarmv6l_release/examples/gui/guiExample $ bin/guiExample 
[warning] ofAppEGLWindow: init(): X11 not availble on RPI yet, using a native window instead
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1680x1050
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1024x768
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x1
[notice ] ofAppEGLWindow: createSurface(): no current renderer selected
[notice ] ofAppEGLWindow: createSurface(): default renderer detected
[ error ] ofAppEGLWindow: createSurface(): error creating surface: EGL_BAD_ALLOC 
[ error ] ofAppEGLWindow: createSurface(): not enough resources available
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupMouse(): mouse_fd=5 devicePath=/dev/input/by-path/platform-3f980000.usb-usb-0:1.2:1.0-event-mouse
[notice ] ofAppEGLWindow: setupMouse(): mouse device name = Logitech USB-PS/2 Optical Mouse
[ error ] ofAppEGLWindow: ioctl GABS failed
[ error ] ofAppEGLWindow: ioctl GABS failed
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard_fd=6 devicePath=/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.3:1.0-event-kbd
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard device name = Dell Dell USB Keyboard
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 

Any hints what I could do?

Many thanks in advance!
Werner

Hello,
Did you put back the video memory allocation back to 128 or 256 ?

In raspi-config

Advanced settings

No, I haven’t.

Now I have. And it works. Many thanks!
(I was a bit confused, because I did not need the first step, because NOOBS does that automatically. So I did not read the instructions carefully enough.)

:slight_smile:

Nice,
I would suggest raspbian headless (without desktop if you dare) from their website at least, just to save a bit of RAM.

and now OF has been fixed so there are not really any special step to get to your first example.

Have fun :slight_smile:

OK, thanks for the hint. I will give it a try.