Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
33 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
1answer
30 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
85 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
39 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
34 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
39 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. ...
0
votes
0answers
19 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
35 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
48 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
1answer
132 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
2answers
101 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
54 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
45 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
27 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 ...
2
votes
0answers
38 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 ...
0
votes
1answer
79 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 ...
0
votes
0answers
48 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 ...
0
votes
1answer
159 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
0answers
43 views

How to link gmp to g++ on Raspberry?

I attempt to compile a small code that uses bitcoin.hpp with the line g++ -o file file.cpp $(pkg-config --cflags --libs libbitcoin) and get an error related to gmp. /usr/bin/ld: /home/pi/libbitcoin/...
1
vote
0answers
232 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 ...
0
votes
1answer
84 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 ...
0
votes
0answers
20 views

Looking for suggestions digital price cards

Hello fellow raspberry pi users I am looking for suggestions in getting a raspberry pi 3 to create digital pricing for our locations. The idea is to have it pull the price for products from a google ...
2
votes
1answer
155 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?
1
vote
1answer
299 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 ...
3
votes
2answers
900 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 ...
3
votes
1answer
546 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 ...
0
votes
1answer
291 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....
1
vote
1answer
91 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 ...
1
vote
0answers
33 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?
1
vote
1answer
144 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 ...
-2
votes
1answer
67 views

Ensure/lock a program to run on Raspberry Pi only?

Are there any characteristics/ lock available so that the program would fail to run on any other device except Raspberry Pi. I have thought about using GPIO with external circuits but would prefer ...
1
vote
1answer
108 views

SPI sending function

I'm currently reworking a project from someone who graduated a few years back and I'm supposed to change the function of his work for a bit. I have trouble understanding these few lines from SPI ...
0
votes
0answers
58 views

HD44780 Display and wiringPi

I have wired a display to the raspberry pi, which uses an HD44780 controller. The wiring was verified by using this python script: https://www.raspberrypi-spy.co.uk/2012/08/20x4-lcd-module-control-...
0
votes
1answer
407 views

Several serial ports with c++

Trying to work on Raspberry Pi 3, Model B V1.2 with several serial ports with C++ code. Previously I should say that when I use only one ports everything works like a charm, so ports configuration is ...
0
votes
2answers
97 views

Is it possible to compile and Arduino Sketch into a C++ file to run on Raspberry Pi?

Since Arduino uses C++ for its programming with libraries that are specific to Arduino, is it possible to compile your sketch and have it run as a C++ program on a Raspberry Pi? I saw there was ...
0
votes
0answers
113 views

Raspberry Pi 3 Model B - Windows IOT - UWP C++ - Servo control?

So currently, I have already developed a uwp application in Visual C++. I ordered a raspberry pi 3 model b from Amazon and its expected to arrive on Wednesday. In my program, I have a button, when I ...
2
votes
1answer
1k views

Problem with gcc/g++ versions

I'm currently setting up Homebridge to run on my Pi using this installation guide. I have run into a problem regarding the C++ compiler section; I understand that this part of the guide is out of ...
1
vote
0answers
224 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 ...
0
votes
1answer
86 views

Can't trigger GPIO control via executable run through php's exec function

/var/www/html/index.php <?php exec("./on"); shell_exec("/var/www/html/on"); on.cpp #include <string> #include <getopt.h> #include <cstdlib> #include <sstream> #include &...
0
votes
1answer
111 views

HC-SR04 Sensor stops reading

I am working on HC-SR04 ultrasonic sensor for my project. I made the connections given here. Here is my code int main(){ int count = 0; if (gpioInitialise() < 0) { qDebug() << "...
-1
votes
1answer
338 views

Data logging in Raspberry Pi

I have made a C++ program which communicates with an RFM95 LoRa module and listens to messages from a various transmitters nearby. Those transmitters transmits sensors' data like temperature, humidity,...
1
vote
1answer
526 views

What is the pixel format for Raspberry Pi framebuffer

Good afternoon, I'm trying to programmatically display an image to a 3.5 inch TFT display mounted on /dev/fb1 using the following code: Using trial and error I determined the pixel width to be 16 ...
5
votes
0answers
149 views

Raspberry as I2C Slave, how to slow down transfer rate?

I have had minor success using the PIGPIO library and interfacing the Pi as an I2C Slave (Using GPIO Pins 18 and 19 as SDA and SCL) with a Campbell CR1000X Datalogger I am encountering a problem ...
2
votes
1answer
178 views

memory trouble compiling c++ on the rpi3b+

The compiler works great, there are 4 cores available, but if I use all 4 of them, invariably the memory runs out. Aside from uninstalling as many services as possible, compiling with a cross-compiler ...
2
votes
1answer
452 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 ...
-1
votes
1answer
971 views

Showing an image on HDMI (DSI, HDMI screens connected)

I have a Raspberry Pi 3B device connected to a LCD '7 (7 inches LCD, its a touch screen I believe that's called DSI not sure) and also a HDMI screen. By default Raspbian considers the LCD as the ...
1
vote
1answer
562 views

Files not saving even with flush

I have a program that is intended to log the incoming data from a sensor. The sensor is reporting at 200 hz and needs to be logged at least that fast so there are no lapses in data. It is important ...
2
votes
2answers
504 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 ...
0
votes
0answers
822 views

Invalid string offset errors when compiling RaspiCam C++ Library

I am getting these warnings with the RaspiCam C++ library, and wondering if anyone has a fix for them? My program is also crashing and I'm wondering if it's related. /usr/bin/ld: /usr/local/lib/...
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 ...

1
2 3 4 5