Go to advanced search

by deepo
Fri Aug 16, 2019 8:11 pm
Forum: C/C++
Topic: Looking for advice with C++ learning
Replies: 13
Views: 420

Re: Looking for advice with C++ learning

printf is still valid for C++, so you don't need to use std::cout if you don't want to yet. You can still use the std::string class, also with printf: #include <string> #include <cstdio> int main() { std::string message = "Hello world!"; printf("%s\n", message.c_str()); return 0; } I use cplusplus.c...
by deepo
Wed Aug 14, 2019 8:26 pm
Forum: C/C++
Topic: Looking for advice with C++ learning
Replies: 13
Views: 420

Re: Looking for advice with C++ learning

I earn a living programming in C++ and I learned (most of) the language at work over many years. So it's not easy pointing out a specific book to read. But learning the object oriented programming concepts and then later the C++ specific syntax has helped me, i.e. learning about inheritance between ...
by deepo
Wed Aug 14, 2019 8:09 pm
Forum: Beginners
Topic: How to control multiples output
Replies: 9
Views: 205

Re: How to control multiples output

Most school and educational projects I have done have been proof-of-concept projects. What I mean by that is that my projects have shown a working corner of what could be a bigger projects. So maybe you could scale your project to show that you can control the outputs available on a single Raspberry...
by deepo
Tue Aug 13, 2019 1:04 pm
Forum: Beginners
Topic: Is it possible to power off a monitor when the RPi is powered off?
Replies: 13
Views: 306

Re: Is it possible to power off a monitor when the RPi is powered off?

just get a power strip with a master and slave outlets https://www.amazon.com/APC-P8GT-Power-Saving-SurgeArrest-Protection/dp/B002K8S2J6 Raspberry Pi Master Monitor Slave A relay from China costs less then 1USD shipped: https://www.aliexpress.com/item/32909704250.html?spm=a2g0o.productlist.0.0.4084...
by deepo
Tue Aug 13, 2019 12:38 pm
Forum: C/C++
Topic: Ways to compile C/C++ code for pi
Replies: 4
Views: 305

Re: Ways to compile C/C++ code for pi

I'm not quire sure what it is you're asking for, but the easiest way it to use the Raspbian OS which comes with g++ installed. If you choose the desktop (not Lite version) you will be able to easily edit and compile C/C++ code on you Raspberry. It is of course also possible with the console only Lit...
by deepo
Mon Aug 12, 2019 8:43 am
Forum: Beginners
Topic: Can’t ssh into raspberry Pi Zero
Replies: 10
Views: 270

Re: Can’t ssh into raspberry Pi Zero

Hello, everyone... I have been trying to ssh into the (original) Pi Zero, but without any success. I have tried all of the following: Following some headless setup tutorials, none of which worked. Putting an empty ssh.txt file on the sd card before putting in the Pi. I have done this every time I’v...
by deepo
Mon Aug 12, 2019 8:29 am
Forum: General discussion
Topic: Raspberry Pi to display videos in multiple LCD displays
Replies: 1
Views: 89

Re: Raspberry Pi to display videos in multiple LCD displays

All Raspberry Pi's only has a single HDMI output, except for the new model 4B which as two micro HDMI outputs. So you need a Raspberry Pi per monitor, unless you can use an HDMI splitter on monitors close to each other. McDonalds here in Denmark uses Raspberry Pi's for some of their info screens, bu...
by deepo
Tue Aug 06, 2019 9:06 pm
Forum: Beginners
Topic: how to setup a raspberry pi without keyboard and monitor?
Replies: 2
Views: 105

Re: how to setup a raspberry pi without keyboard and monitor?

The Raspbian OS is setup for DHCP ethernet from birth, so all you need is to mount the SD card on your Windows/Mac/Linux computer and add a file named ssh. See section 3 here: https://www.raspberrypi.org/documentation/remote-access/ssh/ At next boot you'll be able to connect to your RPi using a SSH ...
by deepo
Tue Aug 06, 2019 8:05 pm
Forum: Beginners
Topic: Date and Time Change
Replies: 4
Views: 121

Re: Date and Time Change

Try this command: pi@raspberrypi:~ $ timedatectl Local time: Tue 2019-08-06 22:03:51 CEST Universal time: Tue 2019-08-06 20:03:51 UTC RTC time: n/a Time zone: Europe/Copenhagen (CEST, +0200) Network time on: yes NTP synchronized: yes RTC in local TZ: no And this: pi@raspberrypi:~ $ systemctl status ...
by deepo
Wed Jul 17, 2019 7:22 am
Forum: General discussion
Topic: Complete description of vcgencmd anywhere?
Replies: 10
Views: 782

Re: Complete description of vcgencmd anywhere?

trejan wrote:
Mon Jul 15, 2019 3:56 pm
Bosse_B wrote:
Mon Jul 15, 2019 3:52 pm
Is the source for vcgencmd available?
Yes but it doesn't show you anything useful since the commands are processed in the VideoCore firmware. vcgencmd will send anything you tell it.
Aaargh!

vcdgencmd send-more-money does not seem to work :)

/Mogens
by deepo
Thu Jun 27, 2019 9:30 pm
Forum: C/C++
Topic: Problem using wiringPiISR (c++)
Replies: 3
Views: 512

Re: Problem using wiringPiISR (c++)

This thread seems to have info on the function: https://www.raspberrypi.org/forums/viewtopic.php?t=184388 There may be help to find here: https://stackoverflow.com/questions/30812340/pass-a-callback-function-with-a-parameter-to-a-function And more code here: https://gist.github.com/antimodular/b1fdf...
by deepo
Thu Jun 27, 2019 9:24 pm
Forum: C/C++
Topic: Problem using wiringPiISR (c++)
Replies: 3
Views: 512

Re: Problem using wiringPiISR (c++)

According to your code: static_cast<void*>(visualisation::traitement()) you are trying to take the output of: void visualisation::traitement(void) which is void and cast that to void * which won't work, as the traitement() function does not return anything. Apart from that you can't call visualisati...
by deepo
Wed Jun 26, 2019 9:05 pm
Forum: General discussion
Topic: Posture Sensor
Replies: 3
Views: 285

Re: Posture Sensor

I would go for a pulse sensor like those found in many smart watches. The type that shines a light into your skin and detects your pulse. By analyzing data from the sensor you can tell for how long time the pulse is high. That may give you an indication of activity. Maybe in combination with a GPS y...
by deepo
Wed Jun 26, 2019 8:34 pm
Forum: C/C++
Topic: [Serial port] The 'read()' will read 8 bytes blocks only
Replies: 26
Views: 7102

Re: [Serial port] The 'read()' will read 8 bytes blocks only

Serial communication does not give any guarantee that you will receive what's being sent as a whole telegram, as you expect. I think you need to follow some kind of protocol, if you need to split the serial data stream into telegrams. A very simple protocol could be STX/ETX, i.e. ASCII character 2 (...
by deepo
Wed Jun 26, 2019 8:02 pm
Forum: General discussion
Topic: My project with raspberry
Replies: 5
Views: 275

Re: My project with raspberry

W. H. Heydt wrote:
Tue Jun 25, 2019 11:34 pm
C# has, as I understand it, proprietary extensions from Microsoft (part of their "4X" practices). You should consider C or C++.
C# can (with some restrictions) run on Linux:
https://www.mono-project.com/

/Mogens
by deepo
Fri Jun 21, 2019 5:03 pm
Forum: General discussion
Topic: My Raspberry Home Server
Replies: 7
Views: 592

Re: My Raspberry Home Server

Besides fail2ban I'd like to give a shout out to UFW Uncomplicated Firewall. Really easy to setup. Here are some of the commands you'll need to use: sudo apt-get install ufw sudo ufw disable sudo ufw enable sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow from 192.168.0....
by deepo
Thu Jun 20, 2019 9:14 pm
Forum: General discussion
Topic: Getting IP from headless RPi
Replies: 30
Views: 1478

Re: Getting IP from headless RPi

Just as a proof of concept, this code works to set up a BLE service on the Pi with one characteristic providing the Pi's IP address. Advantages: should work from any modern Android or iPhone. Disadvantages: many, but it's a little more modern than Morse code. You'll need to grab the imports from my...
by deepo
Thu Jun 20, 2019 7:33 am
Forum: General discussion
Topic: Anrdriod Screen mirroring/casting
Replies: 1
Views: 111

Re: Anrdriod Screen mirroring/casting

There are a ton of webpages describing how to turn your RPi into a Chromecast thingie. Maybe you should give them a go, since you already have the RPi Zero. https://thepi.io/how-to-use-your-raspberry-pi-as-a-chromecast-alternative/ I don't have an Android phone, so I can't tell you whether it will w...
by deepo
Thu Jun 13, 2019 9:05 pm
Forum: Beginners
Topic: Anyone run MySQL on a RPi 3+?
Replies: 8
Views: 431

Re: Anyone run MySQL on a RPi 3+?

I just installed MariaDB on my RPi 3B+ running Raspbian Lite.

All you have to do is:

Code: Select all

sudo apt-get install mariadb-server
You can then log in:

Code: Select all

sudo mysql -u root -p -h localhost
There is no password, so just press enter.

/Mogens
by deepo
Thu Jun 13, 2019 8:50 pm
Forum: General discussion
Topic: simple html <button> execute aplay
Replies: 2
Views: 193

Re: simple html <button> execute aplay

Maybe this guide can inspire you:
https://www.element14.com/community/com ... age-reboot

You should be able to replace the reboot action to playing your sound file.

/Mogens
by deepo
Thu Jun 13, 2019 7:50 pm
Forum: General discussion
Topic: Enable SSH when creating SD card
Replies: 9
Views: 56628

Re: Enable SSH when creating SD card

Hi I use raspbian version april 2019, and you can create a folder ssh in boot and take SD card to Pi. You can't create before write .img to SD card. :)) Good night Actually you can, but it involves a lot of mounting, unpacking, partition operations i.e. bash gymnastics :) But it is possible to crea...
by deepo
Thu Jun 13, 2019 7:27 pm
Forum: C/C++
Topic: Programming bluetooth using C++
Replies: 12
Views: 2270

Re: Programming bluetooth using C++

I stumbled upon TinyB from Intel: TinyB exposes the BLE GATT API for C++, Java and other languages, using BlueZ over DBus. https://github.com/intel-iot-devkit/tinyb I was able to discover Bluetooth devices, listing their services etc. But it does not seem to allow me to receive BLE advertisements, s...
by deepo
Fri May 31, 2019 8:25 am
Forum: C/C++
Topic: Programming bluetooth using C++
Replies: 12
Views: 2270

Re: Programming bluetooth using C++

AnneRanch: You should be able to fix the missing file problem by editing the file that includes the missing file as robot: sudo nano filename.ext But your build might still be broken after that. I think I updated BlueZ to 5.5 but I don’t have my notes here. I’ll respond when I get back home monday. ...
by deepo
Thu May 30, 2019 7:33 am
Forum: C/C++
Topic: Programming bluetooth using C++
Replies: 12
Views: 2270

Re: Programming bluetooth using C++

AnneRanch, I understand your frustration. I'm there myself. My latest Bluetooth "project" was installing SBFspot this week on a rPi Zero W to transfer data via Bluetooth from my solar cells on the roof to pvoutput.org. https://github.com/SBFspot/SBFspot I haven't looked into the code yet, but it wor...
by deepo
Wed May 29, 2019 9:59 pm
Forum: C/C++
Topic: printf issue on raspbian
Replies: 9
Views: 1675

Re: printf issue on raspbian

Your while loop does not contain any code to release the CPU for other purposes, such as flushing stdout.
Maybe adding a small pause will help?
Look at this post for short sleeps: viewtopic.php?t=80705

/Mogens

Go to advanced search