Quantcast
Viewing all 364 articles
Browse latest View live

Running ofxGPIO on Raspbian Stretch

@ayruos wrote:

I've been maintaining a log of my pursuits so here's more details of ofxGPIO.

I tried to get ofxGPIO to work without OF as well and it didn't work. Error log below.

/usr/include/c++/6/system_error:200:3: note:   no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:274:3: note: candidate: bool std::operator<(const std::error_condition&, const std::error_condition&)
   operator<(const error_condition& __lhs,
   ^~~~~~~~
/usr/include/c++/6/system_error:274:3: note:   no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const std::error_condition&’
Makefile:14: recipe for target 'all' failed
make: *** [all] Error 1

So this might not be a oF related issue but more specific to Stretch in some other way. Spoke to Dario Longobardi on Facebook too (he's made the ofxGPIO addon), he said he would investigate.

Posts: 3

Participants: 2

Read full topic


Should we move to GLFW windowing by default on Raspberry Pi?

@bakercp wrote:

Hello all,

I wanted to seek feedback on whether we should move to GLFW as the default windowing sys on Raspberry Pi. Currently we use ofAppEGLWindow, which can be used in native (brcm`) or x11/mesa mode with these instructions.

My recent testing with GLFW on Raspberry Pi using the mesa driver shows that it works really quite well. The version of GLFW via apt on the RPI is still 2.7, and even the last release 3.2.1 does not work very smoothly, but the master branch of GLFW seems to be rendering quite well using the mesa driver.

Is a move away from ofAppEGLWindow to ofAppGLFWWindow` worth pursuing? The main upside is less maintenance as it would track with desktop windowing. We basically get a lot better UI (e.g. hotplug UI support, etc) and it is easier to port work directly from Desktop Linux to Raspberry Pi. The main downside is that older versions of Raspbian wouldn't be supported by newer versions of openFrameworks.

I'm happy to take on this transition if there is interest.

Posts: 8

Participants: 4

Read full topic

ofxOpenCv Error on Raspberry PI 3

@NickHardeman wrote:

Hello,
I setup the Pi according to the Raspberry Pi getting started docs. I can't seem to get the opencv example to compile on a Raspberry Pi 3. I can compile other examples just fine, but not the opencv one.

I get the following error
/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxOpenCv/src/ofxCvHaarFinder.o: file not recognized: File truncated
collect2: error: ld returned 1 exit status
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:382: recipe for target 'bin/opencvExample' failed

I am pretty inexperienced with Linux and Raspberry Pi and am unsure how to fix this issue. Any help would be much appreciated.

Thanks!
Nick

Posts: 2

Participants: 1

Read full topic

Multichannel audio playback on RPi with octo sound card

@dmn wrote:

Hi,

I'm writing a program to play back a 6 channel audio file on a Raspberry Pi in sync with some other activities. I have installed an octo sound 8 channel sound card and tested it ( using 'speaker-test -c 8'). All channels are working fine.

When I play back a 6 channel audio file using ofSoundPlayer, it mixes all of the channels into a stereo mix. It's hard to tell but it seems like all 6 channels are mixed to both the left and right channels.

I've looked into various solutions that oF users have come up but they use FMOD and from what I can tell, FMOD hasn't been compiled for ARM. I know that multichannel playback is possible on the Pi outside of oF, so I'm wondering if anyone has any suggestions as to how I can make this work?

Many thanks,
Dennis.

Posts: 8

Participants: 3

Read full topic

Cross compiling OF app for Raspberry Pi

@cuinjune wrote:

Hi, I'm trying to figure out how to cross compile an OF app for RPi.
I tried to follow this instruction. (http://openframeworks.cc/setup/raspberrypi/raspberry-pi-cross-compiling-guide-wheezy/) but it seems I need an actual RPi hardware to try it. I don't have RPi hardware now but I would like to build a armv6 binary that will run on the device. In my case, is it not possible to build the binary without getting an actual RPi? I can use MacOS, Ubuntu and Windows10 though. Any advice would be appreciated!

Posts: 2

Participants: 2

Read full topic

ofxCv on Raspberry Pi - how?

@steeley wrote:

Ok been struggling with this all day...

Has anyone got ofxCv to run on a Raspberry Pi3? I'm on OF 0.9.8 and Jessie(fully updated)

It seems that OF can't find the opencv libraries or gets confused when compiling.

Error:
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable

But I don't seem to have this variable, and have tried to put paths in config files etc, but it all fails miserably.

Any ideas? TIA.

Posts: 1

Participants: 1

Read full topic

GLES/Raspberry Pi shaders on desktop?

@ayruos wrote:

I'm working on a project that would be finally deployed on a raspberry pi but I wanted to develop the shaders required for it on my Mac.

While setting up the project with GLESWindowSettings on the Mac seems to work, the shaders themselves don't - with errors on the headers of the .frag files and even on in vs attribute and out/ouput gl_fragColor and so on and precision highp float etc.

So, is it possible to run the same shaders on the Mac with rPi shaders or do I need separate versions for each platform with targets as #ifdef statements, etc?

What's the best way to go about this?

Posts: 11

Participants: 4

Read full topic

App for Raspberry Pi integrating shaders and ofGraphics objects

@medul_la wrote:

Hi,

I am developing an app for Raspberry Pi that uses shaders but also regular ofGraphics objects, such as 2D shapes and text. But I’m noticing that ofGraphics objects are not rendered in screen if the renderer is set to OpenGLES in main.cpp (below is how I currently have main.cpp).

#include "ofMain.h"
#include "ofApp.h"

//========================================================================
int main(){
	ofGLESWindowSettings settings;
	settings.glesVersion = 2;
	ofCreateWindow(settings);
	ofRunApp(new ofApp());
}

In other words, I cannot render any other visual object besides ofShader. Does anyone know why?

I’m using Raspberry Pi 3, Raspian Stretch and the master branch of OF.

Posts: 2

Participants: 2

Read full topic


Using addons with openFrameworks on Raspberry Pi

@elliot wrote:

I'm trying to compile a project on a Raspberry Pi with an addon that is in the openFrameworks/addons directory.
I created the addons.make file in the project directory and added ofxOpenCv to the first line.

I then in my ofApp.h file added the include for ofxOpenCv:

#pragma once
#include "ofMain.h"
#include "ofxOpenCv"

class ofApp : public ofBaseApp{

When trying to compile the project with make -j2 -s results in an error relating to not being able to find the ofxOpenCv directory.

Not sure if there is a certain way I need to link the addon to the project.

Any help would be great.

Here is the compilation error:

Compiling Spaces for Release
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=
Compiling /home/pi/openFrameworks/apps/myApps/Spaces/src/main.cpp
Compiling /home/pi/openFrameworks/apps/myApps/Spaces/src/ofApp.cpp
In file included from /home/pi/openFrameworks/apps/myApps/Spaces/src/main.cpp:2:0:
/home/pi/openFrameworks/apps/myApps/Spaces/src/ofApp.h:4:21: fatal error: ofxOpenCv: No such file or directory
 #include "ofxOpenCv"
                     ^
compilation terminated.
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:221: recipe for target 'obj/linuxarmv6l/Release/src/main.o' failed
make[1]: *** [obj/linuxarmv6l/Release/src/main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /home/pi/openFrameworks/apps/myApps/Spaces/src/ofApp.cpp:1:0:
/home/pi/openFrameworks/apps/myApps/Spaces/src/ofApp.h:4:21: fatal error: ofxOpenCv: No such file or directory
 #include "ofxOpenCv"
                     ^
compilation terminated.
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:221: recipe for target 'obj/linuxarmv6l/Release/src/ofApp.o' failed
make[1]: *** [obj/linuxarmv6l/Release/src/ofApp.o] Error 1
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed
make: *** [Release] Error 2

Posts: 5

Participants: 2

Read full topic

oxfOMXPlayer - load movie in thread?

@steeley wrote:

Tried using a thread to load a movie into an ofxOMXplayer ,but as soon as i do this the app quits with a seg fault.( I can stop and start a movie ok, but no loading.)

Anyone actually achieved this?

Tried async load with the regular ofVideoPlayer which works sometimes but has random app. freezes
which seems to be an ongoing issue on PI.

RPI 3 of 0.9.8 Jessie.

TIA

Posts: 1

Participants: 1

Read full topic

ofxCv compiling issues on Raspberry Pi (Raspbian stretch)

@elliot wrote:

I've been trying to compile ofxCv on a Raspberry Pi running stretch. I have tried both with the master and stable branches. I get various errors and warnings during compilation.

At the moment I'm just trying to compile one of the examples.

My openFrameworks set up is based on brcm from bakercp post

I copy the obj file from the empty example project:
cp -R /home/pi/openFrameworks/examples/templates/emptyExample/obj/ /home/pi/openFrameworks/addons/ofxCv/example-flow

I also copy the Makefile into the project:
cp /home/pi/openFrameworks/scripts/templates/linuxarmv6l/Makefile /home/pi/openFrameworks/addons/ofxCv/example-flow

These are the last few lines before the compile fails:

/home/pi/openFrameworks/addons/ofxCv/libs/ofxCv/src/Utilities.cpp: In function ‘std::vector<cv::Point_<float> > ofxCv::toCv(const ofPolyline&)’:
/home/pi/openFrameworks/addons/ofxCv/libs/ofxCv/src/Utilities.cpp:43:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < polyline.size(); i++) {
                  ~~^~~~~~~~~~~~~~~~~
/home/pi/openFrameworks/addons/ofxCv/libs/ofxCv/src/Utilities.cpp: In function ‘std::vector<cv::Point_<float> > ofxCv::toCv(const std::vector<glm::tvec2<float, (glm::precision)0u> >&)’:
/home/pi/openFrameworks/addons/ofxCv/libs/ofxCv/src/Utilities.cpp:52:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < points.size(); i++) {
                  ~~^~~~~~~~~~~~~~~
/home/pi/openFrameworks/addons/ofxCv/libs/ofxCv/src/Utilities.cpp: In function ‘std::vector<cv::Point3_<float> > ofxCv::toCv(const std::vector<glm::tvec3<float, (glm::precision)0u> >&)’:
/home/pi/openFrameworks/addons/ofxCv/libs/ofxCv/src/Utilities.cpp:61:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < points.size(); i++) {
                  ~~^~~~~~~~~~~~~~~
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:358: recipe for target '/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxCv/libs/ofxCv/src/Helpers.o' failed
make[1]: *** [/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxCv/libs/ofxCv/src/Helpers.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:358: recipe for target '/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxCv/libs/ofxCv/src/Utilities.o' failed
make[1]: *** [/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxCv/libs/ofxCv/src/Utilities.o] Error 1
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed
make: *** [Release] Error 2

Not sure if I'm missing something. Anyone else been able to get it working?

Posts: 3

Participants: 2

Read full topic

ofxOMXPlayer and gstreamer

@hereIAM wrote:

Hey all--I'm trying to build an app that can load and play both live-streamed video and video files, and switch from one to the other in the window with a keystroke. I'm running OF on a Raspberry Pi 3, with the live stream coming in from a Pi Zero and Pi Camera via raspicam/gstreamer.

I'm basically trying to combine two apps to make this work-- @jvcleave's "example-playlist" from the ofxOMXPlayer examples and some code from @kashim on this thread. (Thanks to both of you.)

I think I have both the live stream and the video player running simultaneously, but the live stream is the only thing visible in the window, and it's really slow.

Code is here: https://pastebin.com/cCquKCHw

I'm newish to Pi and Linux, and new to OF. Would appreciate any tips! Thanks.

Posts: 3

Participants: 2

Read full topic

Adding files to openFrameworks project with the command line (Raspberry Pi)

@elliot wrote:

I'm trying to add a class to my openFrameworks project through the command line. (I'm working on a Raspberry Pi).

As there is no project generator for Raspberry Pi, I copied an existing project that could be compiled and then replaced the files in src with the code I wanted to use including my .cpp and .h for my class.

I guess I may need to do something with the .o files or the Makefile for it to compile as the Makefile has no rule to compile the additional files.

Posts: 2

Participants: 1

Read full topic

Is it possible to compile OF 0.9.8 on Raspbian Stretch?

@cuinjune wrote:

Hi, I'm trying to use OF 0.9.8 on Raspberry Pi 3.

Firstly, I'm having trouble installing poco using install_dependencies.sh

Is there any work around to this? Or is it simply not possible to use 0.9.8 on Stretch?

Thanks in advance..

Posts: 4

Participants: 2

Read full topic

IDE/Text editor for Raspberry Pi?

@ayruos wrote:

What is everyone using? I usually write code on my Mac and just send it over (either via git or ssh) to the Pi but been working on some GPIO based stuff and obviously I can't test that well on the Mac side and been struggling to find a good text editor/IDE for rPi. Nano is irritating, the Geany IDE on the X environment is okay, but not very promising, don't think there's Atom, Sublime or VSCode on the rPi side - any suggestions? I don't really want to learn vim Image may be NSFW.
Clik here to view.
:expressionless:

Posts: 1

Participants: 1

Read full topic


ofSoundPlayer limits in Raspberry Pi

@dmelladom wrote:

Hi!
I am trying to load a .wav file using ofSoundPlayer. That very file can be played without problems by omxplayer. When I play it with aplay, the volume is quite low.

The codec specifications are:

Audio
Format:               PCM, Little / Signed
                           CBR, 1.536Kbps, 2ch.
Sampling rate:    48,0KHz
BitDepth/String:  16bits
Length:                15min. 12secs.
Size:                    167MB (100%)

When I try to load it both as stream and not, considering its size:

player.load(“test.wav”)

Fails!

player.load(“test.wav”, true)

It works, but the volume is super low, even thought I set it to 1.0f compared to using, for example, omxplayer.
Generally speaking, the quality is pretty low.
Is streaming incompatible with changing the volume? When I change it between 0.5 and 1 I don’t feel much difference, even the quality seems to drop…

I tried using a ofVideoPlayer. The main problem is the loading delay but sound level is similar to what I get using OMXPlayer.

Do you have any suggestion on where the problem could be coming from?

Best,
Diego

Posts: 1

Participants: 1

Read full topic

ofSerial max baudrate for Rpi 3

@yiannis wrote:

Hi,

I am using ofxSimpleSerial for communication between Rpi3 and arduino and I cannot set the baudrate higher than 230400.

Is there anything I can do to achieve higher rates?

Thanks.

Posts: 1

Participants: 1

Read full topic

Shader performance on rPi

@ayruos wrote:

Hello again, everyone! So I’ve been working on a project on the Raspberry Pi which basically uses GLES shaders drawing fullscreen, i.e., fragment shaders doing all the drawing - and the performance seems to be quite terrible on even simple random/perlin noise based shaders (I’m talking 5 fps or less). I’m wondering if there’s some tweaking that needs to be done somewhere, something obvious I’m missing or is the Pi just that weak when it comes to running shaders?

The GPU has been allocated 512mb of memory already, so I don’t think that would be an issue…

I’ve tried on both Stretch and now Jessie with 0.9.8 Nightly, GL legacy driver selected on the Pi.

Posts: 2

Participants: 1

Read full topic

ofxNetwork on RPi with OF 0.9.8

@CCx266 wrote:

Hello !
I just arrived in C++ programming and openFrameworks, with the main goal of modifying the ofxPiMapper addon to give it TCP superpowers.

ofxNetwork works great with the nightly build because there is even an example that builds without any errors.

But ofxPiMapper only builds with OF 0.9.8 so here I am trying on this version :

ofxNetwork is present in the addons folder but there are no examples so I’m unsure how to make it functional, event for a test. There is indeed a ‘doc’ file that stipulates requirement of ofThread but this I don’t see anywhere

Is the doc file obsolete ? Can you explain how to get the latest example of ofxTCPClient working ? I hope you do Image may be NSFW.
Clik here to view.
:smile:

Thanks

Posts: 6

Participants: 2

Read full topic

OSC Communication Not Stable?

@ayruos wrote:

Hi! I’m developing a project on the Raspberry Pi which works with the GPIO pins. There are two apps, one of them is doing the hardware interfacing and sending the values over OSC. The second app is doing some visuals with the values received over OSC. 4 of these are float values from an ADC and 8 of them are ints (technically bools) sending 1s or 0s depending on whether the gate is one or off.

Now, when these two apps the running, the OSC messages received by the second apps, for the gates that are 1, seem to quit often keep flickering between 1 and 0, and I’m trying to figure out why. When I run just the first app to check, it’s rock steady on the readings that it’s getting - so I’m a bit confused what’s going on.

Here’s some of the code,
App 1/HW

for(int i = 0; i < chip; i++){
	   if(i<4){
	      analogIn[i] = 1023 - a2d.getValueAllChannel(chip)[i]; //fix potentiometer wired the wrong way by inverting the value :P
	     } else {
	        analogIn[i] = a2d.getValueAllChannel(chip)[i];
	       }
      usleep(100);
    }

  int r0 [] = {0, 1, 0, 1, 0, 1, 0, 1};
  int r1 [] = {0, 0, 1, 1, 0, 0, 1, 1};
  int r2 [] = {0, 0, 0, 0, 1, 1, 1, 1};

  for(int i = 0; i< mux.size(); i++){

  	gpio14.setval_gpio(ofToString(r0[i]));
  	gpio15.setval_gpio(ofToString(r1[i]));
  	gpio18.setval_gpio(ofToString(r2[i]));

  	gpio17.getval_gpio(mux[i]);
  	usleep(100);

	}

  //sending CVs packed in one OSC message.
  //......................................
  int max = 1023 * 1023;

  ofxOscMessage cv;
  cv.setAddress("/cv");

  for(int i = 0; i < o_cv.size(); i++){
    o_cv[i] = ofMap(analogIn[i] * analogIn[i+4], 0, max, 0, 1.0f);
    cv.addFloatArg(o_cv[i]);
  }

  sender.sendMessage(cv, false);


  //sending gate/triggers in one OSC message.
  //.........................................
  ofxOscMessage gates;
  gates.setAddress("/gates");

  for(int i = 0; i < mux.size(); i++){
    int value = ofToInt(mux[i]);
    gates.addIntArg(value);
  }

  sender.sendMessage(gates, false);

Briefly, first I’m reading the 8 channels of the MCP3008 ADC, then I’m reading the 8 gates connected to a multiplexer, mapping the ADC values to 4 channels and then sending them over via OSC.

In the second app, this is how I’m receiving the OSC messages.

  while(receiver.hasWaitingMessages()){
        
        ofxOscMessage m;
        receiver.getNextMessage(m);
        
        if(m.getAddress() == "/cv"){
            for(int i = 0; i<CV.size(); i++){
                CV[i] = m.getArgAsFloat(i);
            }
        }
        
        else if (m.getAddress() == "/gates"){
            for(int i = 0; i<gateIn.size(); i++){
                gateIn[i] = m.getArgAsInt(i);
            }
        }
        
    }

The gateIn[] values seem to be not stable, what am I doing wrong, should I be doing something differently? As I said earlier, when I just run the first app and draw the values to screen, everything is steady, no flickering of any sort, it’s only when I’m getting them from the second app through OSC the values are jumping around a bit… Also, the /cv values seem steady enough, they’re mapped to be between 0-1 so there’s some flickering in the .000xxx ranges but that’s too minor to worry about.

Posts: 3

Participants: 1

Read full topic

Viewing all 364 articles
Browse latest View live