Questions tagged [c++]

For questions pertaining to compiling c++ programs on the Raspberry Pi.

Filter by
Sorted by
Tagged with
0
votes
2answers
3k views

Is this possible to read internal CPU temp sensor directly from cpp code?

I am working on the kind of RPi platform to collect some external sensors data or control relays (using the remote tools like web or sms). Next problem I am tring to solve now is to get the direct ...
1
vote
1answer
36 views

How to write a C++ wireless communication to control my raspberry pi over network

I have a raspberry pi and I want to convert it into a RC car which I will control through my PC. I know C++ programming and I intend to use that to write the software stack. I want to create a C++ ...
2
votes
4answers
212 views

Install OpenCv in a raspberry pi 3 with c++

I've been working on a project with OpenCV and Visual Studio but I want to perform some tests on a Raspberry Pi 3, I haven't found accurate information about how can I use OpenCV in a Raspberry Pi ...
2
votes
1answer
42 views

Comparison between Object Detection Solutions on Raspberry PI

I have only little experience with embedded systems. I have a Raspberry Pi 4 with 1gb RAM and a Camera Module v2.1 and want to do object detection and tracking on it. By best solution I mean a ...
0
votes
2answers
705 views

(Program Exited with code :139)

Folks, I do have an error similar to the main question . Segmentation Error (Program Exited with code :139) I am new to Raspi but have been programming with C & C++ for more than 15 years. My ...
0
votes
1answer
214 views

pigpio, update xfer.txBuf

Question refactored: Im currently struggling to understand how to update the transmit FIFO of the bsc_xfer. For reference: Slave side: int main(int argc, char** argv) { int GPIO = gpioInitialise(); ...
0
votes
1answer
214 views

Static library linking failed for ubuntu mate 16.04 on Raspberry Pi 3

my first post, i have two make files, one building a static library, other is to build with lib linking when i use make for 2nd file i am getting linker error /usr/bin/ld: skipping incompatible ../...
0
votes
1answer
371 views

AVFrame YUV420P to dispmanx VC_IMAGE_YUV420

I'm using ffmpeg for decoding a video with h264_mmal encoder. And all test videos are in YUV420P color encoding. Also I'm using dispmanx for drawing frames from a video. Only problem which I have is ...
0
votes
2answers
648 views

Camera Module v2 stops working when using raspicam C++ API

I'm experiencing a strange behaviour of my Camera Module v2 when using the raspicam API in my code. Here is what I've done: I've downloaded the last version (0.1.3) of the raspicam API from https://...
0
votes
1answer
541 views

Frequency bands from FFT (audio visualizer)

I'm currently working on an audio visualizer running on a 64x64 LED matrix, and some tests showed that the Pi1 is totally capable of doing that. I'm receiving raw PCM audio data using PortAudio, and I ...
2
votes
1answer
563 views

SPI only returning zeros with Raspbian (It works with IoT core)

I am using this ADC connected to the channel 0 of my Pi3 board for reading values from a sensor. In IoT core, I was using a very simple code for testing the my device, and it worked fine. The C# code ...
0
votes
3answers
2k views

Linking WiringPi library in CMakeLists

So, I have a C++ program that I've compiled with CMake and uses the OpenCV library which I'd like to integrate with wiringPi so I can use functions like digitalWrite(), digitalRead() etc... Before I ...
0
votes
1answer
381 views

Running openCV C++ file from python in Raspberrypi

I'm creating a object and color detection robot. Here in this case, I'm using C++ to run the camera and process the image with openCV in C++, but before I run the Camera, I want the robot to move and ...
0
votes
1answer
104 views

How to use at the same time 2 hardware pwm in wiringpi

I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing ...
1
vote
3answers
2k views

How to use raspicam with Visual Studio 2017 and C/C++

In Visual Studio 2017 I created a new project using the cross-platform linux Blink (Raspberry) template. This compiles and runs perfectly and the debugger in the Debug->Linux Console also works pretty ...
0
votes
2answers
5k views

Compile and run Qt5 webengine on rpi2/3

I have followed the tuto here : https://wiki.qt.io/RaspberryPi2EGLFS to cross-compile Qt 5.6 for my pi 2. But I did not used the git repo, I have downloaded the source tarball. I checked by running ...
0
votes
1answer
1k views

Is it possible to fix the “cannot find -lgcc” and “cannot find -lgcc_s” error messages when using arm-linux-gnueabihf-g++ as a linker?

I get the following error messages: ./Downloads/tmp/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux‌​-gnueabihf/bin/ld: cannot find -lgcc_s and Downloads/tmp/usr/bin/../lib/gcc/arm-...
1
vote
1answer
1k views

Remote develeopment with Netbeans: debugger goes to disasembly

I managed to set up remote development on RPi with Netbeans 8.0.2 over direct connection to my laptop. my simple program compiled, run and debugged. #include <iostream> using namespace std; ...
1
vote
2answers
46 views

Run application with other user than root

Within a small project I opened a wireless connection using the NRF24L01 transceiver and a Raspberry Pi 3 Model B+ with Raspbian 10. To communicate over the transceiver I make use of the RF24 library ...
1
vote
0answers
301 views

Any DS3231 RTC C++ experts here?

I'm trying to program a DS3231 using a translated C++ Arduino Mega 2560 library. Translated means all the Arduino I2C methods have been changed over to use the BCM2835 GPIO/SPI/[I2C] library. The RTC ...
2
votes
3answers
9k views

How to enable SPI1 and SPI0 at the same time?

I have installed a LCD screen that use my SPI0 bus and I2C but i want to connect my RFID reader to the same raspberry. My lcd screen can you see here: https://www.adafruit.com/product/1601 SPI1 will ...
1
vote
1answer
70 views

I want to build “raspberry pi ” c++ code in desktop ubuntu

I have created simple c++ application program in raspberry Pi. I could build this code in raspberry pi, but I'm getting error while compiling it in my labtop "ubuntu". My aim is to create executable ...
1
vote
3answers
8k views

C and C++ Library and where is it located actually?

I'm trying to understand a few simple blocks about programming the Raspberry Pi. My questions are as follows.... I've worked on a number of micro-controllers out there and have always used their ...
1
vote
3answers
724 views

What libraries do I need to write a desktop application for Raspbian with Visual Studio “C++ for Linux” and remote GDB Debugging?

So I bought a Raspberry Pi 3 Model B ("Pi") that I run Raspbian on. I found this tutorial and I've managed to connect to my Pi from Visual Studio and run the example program that was included in the ...
1
vote
1answer
2k views

Raspberry Pi 3 BLE scanning failure

I am trying to implement the next code to scan for BLE devices: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include <bluetooth/...
1
vote
2answers
480 views

WiFi packet sniffer for RPi in c++

We are currently working on a project, where we want to see the packets sent over WiFi. We are using an RPi zero w as a sniffer, and we have managed to use ioctl calls to get ssid and other ...
0
votes
2answers
59 views

SD to USB Adapter: Will the SD card appear as a USB device?

My colleague and I are writing an endurance test for SD cards (running read/write/erase block cycles). We're considering using an Raspberry Pi 3 to run the tests on. The issue is we will be using ...
0
votes
1answer
288 views

Open (lx)terminal on startup, run program in it

I have the following service: [Unit] Description=Create test directory After=graphical.target [Service] Type=oneshot RemainAfterExit=yes User=pi ExecStart=/home/pi/Desktop/startup-script.sh [...
2
votes
2answers
394 views

How to run a script after bootup on RPi 4/Raspbian 10 (buster)

Im trying to run a script after bootup, when the desktop is shown. The script is rather simple: #!/bin/bash mkdir /home/pi/Desktop/test So in other words: This script is creating af folder "Test" ...
1
vote
1answer
132 views

What resolutions can I use for the Raspberry PI camera 2? And how can you tell?

I'm working on a project with Raspberry Pi 3 and camera module v2. I'm using OpenCV and raspicam. I want to know the maximum resolution I can use. The datasheet says 3280*2464, but I get errors when ...
2
votes
1answer
237 views

How to get 10-bit depth black and white image from raspicam v2.1?

I am a little bit confused about image capturing by Raspberry pi camera V2.1 [1]. I work on the Raspberry pi 4 and I know how to get 8-bit depth black and white (BW) image from it on the C++ level ...
0
votes
0answers
56 views

Poor std::atomic performance on Pi 4

I recently migrated a project of mine from Pi 3B+ to Pi 4B only to find that it now runs much slower than before. After investigation, it appears the culprit is the atomic library that I use heavily. ...
2
votes
2answers
524 views

Raspberry pi GPIO pinout diagrams diferent than BCM and BOARD?

I know what BCM and BOARD mean when you set up the pi to work with the GPIO coding in python. Recently a had a look in some code for raspberry written in c++ and everything is okay but how the code ...
1
vote
1answer
497 views

OpenCV Gstreamer pipeline doesn't work on Pi 4 Buster

I'm studying about object tracking and detecting in Gazebo Simulation. So, I'm trying to send Simulation video(Gst Plugin) to Raspberry Pi 4 via ethernet cable over UDP stream. And Pi 4 side, catch ...
0
votes
0answers
29 views

C++ programming - Class for Motor rotation and control for washing machine embedded system device layer error?

#include <iostream> using namespace std; int main() { // declaring variables: int MotorControl; int MotorRotation; MotorControl = on; MotorControl = off; // process motor control and ...
1
vote
0answers
55 views

How to update GTK3 image using a button to capture a picture from the camera using C++?

I managed to create a program that will display some buttons and and Image. Now I would like to update the image when a button is clicked. How do I do that? Here is what I have so far, it all works ...
1
vote
4answers
147 views

Cannot run 2 apps with rc.local but it works from command line

I have 2 apps, lets call them /home/pi/app1 and /home/pi/app2 If I type into console sudo /home/pi/app1 & sudo /home/pi/app2 both apps execute without issue When I add the same line to /etc/rc....
1
vote
2answers
4k views

Running cgi scripts with lighttpd

On my Raspberry Pi Zero-W I like to control my GPIO in and outputs with a webserver. I chose lighttpd as server since I can use cgi scrips with c++. But my setup has issues. I configured lighttpd ...
0
votes
1answer
229 views

Running Visual C++ on raspberry pi

Can we run a program written in visual studio c++ (windows), with or without the rasp-bian OS? Any guidance about how it will be done? What software will be needed?
0
votes
2answers
349 views

Raspberry Pi 4 B g++ undefined reference to boost::system::system_category()

I created a simple program in C++ on my RPi to test the Boost library. This is the code: #include <iostream> #include <boost/asio.hpp> int main() { std::cout << "Hello World!" &...
0
votes
1answer
181 views

Duplex communication via bluetooth - in C++ code [closed]

I have a working C++ code , partially converted to class, passing single (text char ) message form client (Rpi) to server (PC). I have used a composite ( fancy work for hack ) of many C/C++ code ...
0
votes
1answer
136 views

polling gpio raspberry 2 doesn't work

i'm writing a library for my raspberry pi 2 for gpio control. I'm trying to test a function for read a gpio driven by interrupts with sysfs but i can't do that my function stops in poll() function. ...
1
vote
0answers
43 views

pigpio library dependencies missing when compiling Radiohead nRF24 library

I am using Eclipse 2019-06 CDT to compile the Radiohead nRF24L01 library (v1.97) using the pigpio interface (v71) with C++. I get the following errors: rpi/rfs_pizw2/usr/lib/libpigpio.so: undefined ...
4
votes
1answer
7k views

Running Modern Opengl on raspberry pi

Is there any way to "enable" modern OpenGL on the Raspberry Pi (specifically the Raspberry Pi3)? I would like to use C++ instead of Python, since I'm a lot more familiar with it. I know there is a ...
0
votes
1answer
140 views

C++ Long Double or equivalent on ARM64

I'm having a hard time getting a straight answer about long double precision on ARM64 architecture. I'm engineering a scientific machine requiring extreme precision, and the driver, which I will write ...
1
vote
1answer
2k views

Access RPi's camera stream in OpenCV C++ (Qt)

I've setup my Raspberry pi 3 B with uv4l and have access to the video stream on http://(raspberry-IP):8080/stream address. Now, I have Qt5(C++) and OpenCV installed on my main computer. How can I ...
8
votes
4answers
23k views

Installing Raspberry Pi Cross-Compiler

I am attempting to get cross-compiling for Raspberry Pi working on my Ubuntu machine. During my initial attempts I was using the arm-linux-gnueabi compiler, which is available in the Ubuntu repo. I ...
2
votes
0answers
59 views

g++ and gdb debugging does not provide full backtrace

I never experienced this behaviour on classic desktop platform thus I'm asking here. The question is how to correctly debug C++ application (g++ build) using GDB on Raspberry Pi? When my application ...
3
votes
1answer
6k views

RPi-bluetooth headless communication with android phone - no pairing

I am in the middle of a project, where I want to use the integrated bluetooth device on a Raspberry Pi 3 running Jessie and an Android phone to communicate with each other. It is important to notice ...
11
votes
2answers
16k views

PiGPIO Library Example for Bit-Banging a UART

The PiGPIO library http://abyz.me.uk/rpi/pigpio/index.html mentions that one of it's features is "software serial links using any user gpio". I take this to mean that you can use it to generate a ...

1
2 3 4 5