Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
587 views

wiringPi compile issue on RPi 4B 64bit

I am trying to compile my C++ project using CMake. My Raspberry Pi OS does include /usr/include/wiringPi.h and all the required .so files in /usr/lib/. Here is the output of gpio -v command: gpio ...
user avatar
  • 51
1 vote
1 answer
254 views

Using Motor Encoders with Raspberry Pi

I am trying to read a quadrature motor encoder with the Raspberry Pi. After attempting to write the code in Python, I came to the conclusion that Python was too slow (which was expected). I tried to ...
user avatar
  • 129
0 votes
1 answer
44 views

OpenCV setting resolution results failing in reading frames

I've tried to change the resolution on raspicam v2 with my raspberry pi 4 b, but this code gives me false every time I try to read frame... Is there anything I am missing? I can easily read frames ...
user avatar
0 votes
2 answers
42 views

How can the x-tools C++ crosscompiler build code, which does not use the Pi's FPU?

After starting over with the x-tools C++ crosscompiler to build my Raspi apps, I found out that the app runs considerably (approx. 1/3) slower than when built with the g++ (version 6.5.0) on the Raspi....
user avatar
  • 445
0 votes
0 answers
174 views

How to use 4 CS for SPI in C++

I'm currently trying to implement 4 CS in RaspPi. I'm still a newby in this field and used the library wiringPi. For CS0 and CS1 this works totally fine. However now I have 2 more CS on the GPIO Pin ...
user avatar
0 votes
1 answer
93 views

Cross Compilation of Qt OPC UA Server on Raspberry Pi 4B fails

currently I am trying to cross compile a stand-alone Opc Ua Server on a Raspberry Pi4B with Qt 5.15.2 and the Qt Opc Ua Plugin. For Cross Compilation, I used this instruction: https://wapel.de/?p=842. ...
user avatar
  • 1
0 votes
0 answers
28 views

RPI not recieving I2C master's messages

Im trying to use a RPI3B+ to emulate a WiiMotion Plus, So i have it set up as a slave using pigpio and connected to a wiimote. Expected outcome: The wiimote will try to read from register 0xfe and ...
user avatar
1 vote
3 answers
198 views

How to start GPCLK2 pin inside code of C/C++

I would like to use GPIO 6 (GPCLK2) to produce a 8.192 MHz clock in other words i would like to use its alternate function of a general purpose clock, but im having trouble looking for a guide that ...
user avatar
0 votes
1 answer
841 views

How to read any connected DS18B20 temperature sensors with C/C++

I'm new to the Raspberry Pi ecosystem so pardon me if I'm talking nonsense. I want to read the temperature data from the connected DS18B20 sensors using C/C++. I followed this schema to connect them: ...
user avatar
0 votes
1 answer
391 views

Raspberry Pi Auto-start Executable with Systemd, Loaded but Inactive (Dead)

I am trying to run a CPP client application to connect to a server when Raspberry Pi is booted and connected to the Internet. I validated this CPP executable (Asio_Client_Main) works fine when ...
user avatar
0 votes
1 answer
472 views

How can I make an app linked against GLIBCXX_3.4.26 run on Raspbian Buster, which only offers 3.4.25?

I'm now trying to compile C++ apps for my Raspi 3B by using crosstool-ng on my OpenSuSE-based host machine. The toolchain now works fine, but when trying to run the app on the Raspi, I always get this ...
user avatar
  • 445
2 votes
1 answer
506 views

How to directly render pi camera output to display using C++

Right now, I'm building an application and one of the sub goals is to display the camera to the screen with a good resolution and frame rate. I'm also trying to keep the cpu usage as low as possible ...
user avatar
  • 31
0 votes
1 answer
314 views

Changing the code for the "Waveshare" e-paper display

I've put together quite a nice little ePaper display clock with the Raspberryp Pi Zero W running Buster. I'm using the Waveshare 6" kit (display and controller board). Has anyone here had any ...
user avatar
  • 419
0 votes
0 answers
241 views

Visual Studio Code - output to "integrated Terminal" is corrupted / unreadable

the Unreadable text output from the 'integrated terminal' is shown below this line: xecutinga isk:C /+/++C a++ ltndv suinfc <ndc < tarrangb ulnd.... flnd. fngnhec. hlcchhflddy i am new to ...
user avatar
  • 26
0 votes
1 answer
33 views

NRF24L01 PRX only datapipe 0 and 1 receiving data

I'm creating a project in C++ on a raspberry pi zero and C on PIC18F26Q10 where multiple PICs will transmit sensor data to the raspberry pi. Both devices can send and receive data to and from each ...
user avatar
  • 3
0 votes
1 answer
604 views

How to control a Servo via libgpiod on a raspberry PI

I am trying to control a Servo in c ++ using the libgpiod library. My problem is in defining the 50Hz pwm pulse on the pin that the servo is connected to. The servo signal cable is connected to pin 33 ...
user avatar
  • 3
0 votes
1 answer
72 views

Camera, splitter and encoder in OpenMAX

I want to access camera and get both encoded and not-encoded video from it in my C++ application. As I'm targetting Raspberry Pi Zero, I want it to be as efficient as possible, so I decided to use ...
user avatar
  • 101
1 vote
1 answer
657 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++ ...
user avatar
  • 21
2 votes
4 answers
2k 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 ...
user avatar
  • 31
1 vote
2 answers
221 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 ...
user avatar
  • 454
2 votes
1 answer
318 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 ...
user avatar
2 votes
1 answer
160 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 ...
user avatar
  • 21
2 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
1k 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 [...
user avatar
  • 133
2 votes
2 answers
1k 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" ...
user avatar
  • 133
1 vote
1 answer
677 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 ...
user avatar
  • 111
3 votes
1 answer
976 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 ...
user avatar
  • 63
0 votes
0 answers
105 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. ...
user avatar
  • 159
0 votes
0 answers
137 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 ...
user avatar
1 vote
0 answers
191 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 ...
user avatar
2 votes
4 answers
1k 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....
user avatar
  • 121
1 vote
1 answer
1k 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 ...
user avatar
0 votes
2 answers
1k 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!" &...
user avatar
  • 3
0 votes
1 answer
611 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 ...
user avatar
  • 9
0 votes
1 answer
479 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. ...
user avatar
1 vote
0 answers
109 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 ...
user avatar
  • 11
2 votes
0 answers
108 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 ...
user avatar
  • 241
0 votes
1 answer
303 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 ...
user avatar
0 votes
0 answers
123 views

Running a visual studio 2019 c++ code with cryptopp library on raspberrypi for performance analysis

I've written a code in visual studio 2019 in c++ language and it involves various cryptographic mechanisms. It also includes Elliptic curve library named cryptopp. I want to simulate and test the ...
user avatar
0 votes
1 answer
354 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?
user avatar
1 vote
0 answers
486 views

Cross-compiling for Raspberry Pi I fails using Linaro 7.4.1 toolchain

I downloaded the latest Linaro toolchain (https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/) to cross-compile C++ code for different Raspberry Pis which running a ...
user avatar
  • 43
-1 votes
1 answer
179 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 ...
user avatar
2 votes
1 answer
246 views

see output from c++ program which was started by rc.local

is there a possibility to see output (f.e. std cout << ...) from my program which was started from rc.local script when i am logged into my Rpi via SSH?
user avatar
  • 21
1 vote
1 answer
508 views

Programming MLX90640 to display what I want [closed]

Yay. Got my MLX90640 working and boy it works great. However, the ambient temp of around 20C keeps showing as a green background and i would like it to be blue or even grey. Has anyone attempted to ...
user avatar
3 votes
2 answers
5k views

C++ problem: boost/asio.hpp non existing

I'm using Raspberry Pi 3B+. I'm trying to compile a rather massive C++ package given to me from somewhere else. However make fails compiling. It cannot find boost/asio.hpp. I simplified the problem ...
user avatar
3 votes
1 answer
756 views

outb() equivalent in Python for GPIO

I am a very beginner on programming and raspberry usage, tho I think I learn fast. I am trying to convert an old program (not mine) that was written for Linux on C++ for communication with a printer ...
user avatar
0 votes
1 answer
1k views

sqlite3 cannot find -lsqlite3

I'm using raspberry pi 2B with raspbian lite. I'm trying to add an sqlite3 library on my C++ program. Without starting adding any piece of code, using the flag -lsqlite3 I get the error. src/main....
user avatar
  • 131
1 vote
1 answer
227 views

C++ Qt5 / OpenGL issue when compiling a program that uses glGetTexImage()

I am on latest Raspian release with latest Qt5 pkgs and related OpenGL + MESA pkgs installed from the standard Raspian repo. I am attempting to build a C++ program (not mine) that relies on Qt5 and ...
user avatar
1 vote
0 answers
39 views

I want to know about printing NFC tag time out

I used libnfc and nfc-poll command. I get a UID and something else can I get a information about NFC tag time and print it out?
user avatar
1 vote
1 answer
263 views

Qt Userland raspistill/racpicam integration - Unable to find an X11 visual which matches EGL config

I am developing simple gui app for a client on Raspberry pi running Ubuntu(Mate) 16.04 using Qt 5.5.1 and OpenCV for some face recognition (all C++) using 5MP pi camera. The framerate/CPU usage ...
user avatar
  • 223

1
2 3 4 5