How can we read all mp3 files in a mounted(Raspberry pi) usb in Qt toolkit (Qt) application - linux

I am trying to create an music application for my Raspberry pi, I have finished my player UI. Now i need to detect the USB which is mounted in the raspberry pi and read all the mp3 files from the USB. Is there any example which i can refer to for implementing this.
Somewhere i read about solid.kde library but no examples are there to actually start implementation, Any guides or example links would be appreciated.

I did that on another board a couple of years ago. What you can do is using dbus to get notifications about plugged in devices and mounting. You can do all via dbus and QtDbus using this code, which is very simple: https://github.com/Razor-qt/razor-qt/blob/master/libraries/razormount/rzmountproviders_udisks2.cpp. You have add and remove notifications and a few methods to mount and unmount. I think this can be done also on the Pi as dbus is available.

Related

Receiving data from a BLE device to a raspberry Pi3

I never used a raspberry pi before and I have a project part of which includes receiving data from a BLE blood pressure device over Bluetooth to a raspberry pi 3. I can pair the device to my raspberry but I have no idea what to do next. I need to be able to receive the measurements in my raspberry please help and thank you in advance.
PS: the device I'm trying to use is very similar to this one:
https://ibb.co/71365k5
Thanks for your answers, I have tried "Gatt" and "Gatttool" but the problem is after pairing the device is meant to send the measurement to its application on an android phone, without it I cannot read the blood measurement characteristic or it just does not exist.
Linux uses BlueZ as a default bluetooth stack. It exposes DBus APIs for implementing software using Bluetooth.
If you don't want to use this API directly, which can sometimes feel a bit low level you have many libraries that wrap it, such as https://github.com/getsenic/gatt-python that also comes with examples.
All other solutions requires replacing the Bluetooth stack on Linux and hence your other existing Bluetooth pairings to the system will stop working.

QR scanning using raspberryPi camera nodeJS

I am creating a nodeJS application that can be used to scan QR code on the raspberry Pi3 board.
I am able to successfully use a USB camera and scan the QR code using the Instascan node module.
However, when I try to use the Raspberry pi Camera, the Insta scan is not able to find it and not able to show the camera.
I have found many such options using python and OpenCV, however not with node js or electron.
Can someone help with this?
Finally this is resolved.
Actually by default rpi camera is not shown in /dev/video list
so I had to enable V4L2 driver by
modprobe bcm2835-v4l2
This made CSI camera list in /dev/video list and application started detecting RPI camera.
Thanks everyone

Reading Bluetooth data and command (Raspberry pi 3)

I am currently working on a project that make me control media center and a few domotic parts in my living room.
I have connected on my raspberry pi 3 a NAS, my Spotify account (with hifiberry, controls to close my amp, my PC and a few lights...
At first to control it all I programmed a web server that I can access on my phone. That made the job but it is not completely user friendly since I have to have my phone go to the interface and do whatever I have to... And I'm not a web designer 😁 it's far from perfect!
I've made some research and I have decided to build a bluetooth remote control (raspberry pi 3 do have Bluetooth low energy).
Since nothing exist as I want, it is going to be a custom one made with Arduino mini and hm10 module.
But I'm stuck on the raspberry part!
How can I read the Bluetooth data send by my remote and launch scripts according to the command sent?
Via a serial listener of some kind?
Yes, in fact, you should use a serial port to connect your pi with Bluetooth module.
You then use software input information for your purposes, but you must first implement the hardware and hardware interface first.
You can build application software with the Python programming language.

UVC function config interface

I'm reading Linux Documentation about UVC function. I'm struggling to understand an example that starts here and goes until here. What exactly is this going to do and where exactly do I create these files?
Any help is appreciated.
From your other posts I gather that you are attempting to implement a UVC gadget with a Xilinx device. Nonetheless, as Linux devices share the same opaque kernel documentation, the procedure is just as error-prone on the Raspberry Pi Zero and other OTG-enabled devices.
What exactly is this going to do
The idea of a UVC gadget is to build something that acts like a webcam. Once completed you could potentially connect that device into a Mac or PC and use it as your video for FaceTime or Skype.
Depending on your goals you could stream synthetic images, a recorded video, or passthrough video from an add-on like a MIPI CSI camera.
where exactly do I create these files?
Here's a great intro to ConfigFS: link. Again it's for Raspberry Pi Zero rather than your Xilinx device, but the same concepts apply.
While gadget-testing.txt is inconveniently curt, if you start off by running:
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
then you can proceed with the steps mkdir functions/uvc.usb0/control/header/h ...
Here is a more detailed post covering various caveats on Raspberry Pi Stack Exchange.

Can PulseAudio/ALSA work without built-in soundcard?

I am new to PulseAudio and ALSA, so please go easy on me. This might seem like a dumb question, but it is quite important to have it answered.
I am developing application on ARM imx6 board (lets call it BOARD1), with built-in sound card support. With ALSA, I am able to play audio throgh Headset_OUT. But now, we want to move to a new board (lets call it BOARD2), which does not have built in soundcard. But the idea is to connect a bluetooth module to the BOARD2 and have the audio streamed to the bluetooth speaker.
My question is, is it possible to use PULSEAUDIO to send/receive audio to external (bluetooth) audio device without local embedded soundcard (i.e. is it possible to do audio encoding/decoding in just software with pulseaudio and gstreamer combination) ?
Regards

Resources