Categories
Други Направи сам Упътвания

[Направи сам] Преносимо FM/MW/SW радио

3D модел на кутия за преносимо радио

https://github.com/Nanich87/diy-portable-fm-mw-sw-radio

Categories
Други Направи сам Упътвания

[Направи сам] Преносим MP3 плеър

Проект

3D Модел на кутия за преносим MP3 плеър

https://github.com/Nanich87/diy-mp3-player

Видео

Кадри от видео [Направи сам] Преносим MP3 плеър – част 2
Categories
Raspberry Pi Други Упътвания

Gqrx SDR for the Raspberry Pi

sudo apt-get update
sudo apt-get install -y cmake gnuradio-dev gr-osmosdr qt5-default libqt5svg5-dev libpulse-dev
git clone https://github.com/gqrx-sdr/gqrx.git
cd gqrx
mkdir build
cd build
cmake ..
make -j4
sudo make install
gqrx
Categories
Други Интернет на нещата Упътвания

DIY USB Power Bank

Преносима USB батерия с индикатор на батерията и бутон за включване и изключване

https://odysee.com/@GNN_Tech:2/diy-power-bank-part-1:7

https://odysee.com/@GNN_Tech:2/diy-power-bank-part-2:4

https://github.com/Nanich87/diy-usb-power-bank

Categories
Линукс Упътвания

Обновяване на подмодули в Git

git submodule update --init
cd submodule-directory
git pull
cd ..
git add submodule-directory
Categories
Raspberry Pi Линукс Упътвания

How to fix locale error on Debian 10

Locale error in Debian 10 Buster
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
sudo dpkg-reconfigure locales

Categories
Линукс Упътвания

Преоразмеряване на .img файлове в Ubuntu/Debian

sudo modprobe loop
sudo losetup -f
sudo losetup /dev/loop0 myimage.img
sudo partprobe /dev/loop0
sudo gparted /dev/loop0
sudo losetup -d /dev/loop0
fdisk -l myimage.img
Disk myimage.img: 6144 MB, 6144000000 bytes, 12000000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ea37d

      Device Boot      Start         End      Blocks   Id  System
myimage.img1            2048     9181183     4589568    b  W95 FAT32
truncate --size=$[(9181183+1)*512] myimage.img

Източник: https://askubuntu.com/questions/1174487/re-size-the-img-for-smaller-sd-card-how-to-shrink-a-bootable-sd-card-image

Categories
Raspberry Pi Други Линукс Упътвания

Инсталиране на Samba сървър / Raspberry Pi

Обновяване на инсталираните приложения

sudo apt-get update
sudo apt-get upgrade

Инсталиране на Samba

sudo apt-get install samba samba-common-bin

Създаване на споделена директория

mkdir /home/pi/shared

Конфигуриране на Samba

sudo nano /etc/samba/smb.conf
[share]
path = /home/pi/shared
writeable=Yes
create mask=0777
directory mask=0777
public=no

Създаване на потребител за Samba

sudo smbpasswd -a pi

Рестартиране на Samba

sudo systemctl restart smbd

Източник:

https://pimylifeup.com/raspberry-pi-samba/

Categories
Raspberry Pi Други Упътвания

Install OpenCV 4.5 on Raspberry Pi 4 / Zero 2 W

Swap memory

OpenCV needs a lot of memory to compile. The latest versions want to see a minimum of 6.5 GB of memory before building. Your swap space is limited to 2048 MByte by default. To exceed this 2048 MByte limit, you will need to increase this maximum in the /sbin/dphys-swapfile.

https://www.qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html
sudo nano /sbin/dphys-swapfile
sudo nano /etc/dphys-swapfile
sudo reboot

Installation script

#!/bin/bash
set -e
echo "Installing OpenCV 4.5.0 on your Raspberry Pi 32-bit OS"
echo "It will take minimal 1.5 hour !"
cd ~
if [ -f /etc/os-release ]; then
    # freedesktop.org and systemd
    . /etc/os-release
    VER=$VERSION_ID
fi
# install the dependencies
sudo apt-get install -y build-essential cmake git unzip pkg-config
sudo apt-get install -y libjpeg-dev libtiff-dev libpng-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libgtk2.0-dev libcanberra-gtk* libgtk-3-dev
sudo apt-get install -y libgstreamer1.0-dev gstreamer1.0-gtk3
sudo apt-get install -y libgstreamer-plugins-base1.0-dev gstreamer1.0-gl
sudo apt-get install -y libxvidcore-dev libx264-dev
if [ $VER == '11' ]; then
   echo "Detected Bullseye OS"
else
   sudo apt-get install -y python-dev python-numpy python-pip
fi
sudo apt-get install -y python3-dev python3-numpy python3-pip
sudo apt-get install -y libtbb2 libtbb-dev libdc1394-22-dev
sudo apt-get install -y libv4l-dev v4l-utils
sudo apt-get install -y libopenblas-dev libatlas-base-dev libblas-dev
sudo apt-get install -y liblapack-dev gfortran libhdf5-dev
sudo apt-get install -y libprotobuf-dev libgoogle-glog-dev libgflags-dev
sudo apt-get install -y protobuf-compiler

# remove old versions
cd ~ 
sudo rm -rf opencv*
# download OpenCV
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.5.0.zip 
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.5.0.zip 
# unpack
unzip opencv.zip 
unzip opencv_contrib.zip 
# some administration to make live easier later on
mv opencv-4.5.0 opencv
mv opencv_contrib-4.5.0 opencv_contrib
# clean up the zip files
rm opencv.zip
rm opencv_contrib.zip

# set install dir
cd ~/opencv
mkdir build
cd build

# run cmake
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D ENABLE_NEON=ON \
-D ENABLE_VFPV3=ON \
-D WITH_OPENMP=ON \
-D BUILD_ZLIB=ON \
-D BUILD_TIFF=ON \
-D WITH_FFMPEG=ON \
-D WITH_TBB=ON \
-D BUILD_TBB=ON \
-D BUILD_TESTS=OFF \
-D WITH_EIGEN=OFF \
-D WITH_GSTREAMER=ON \
-D WITH_V4L=ON \
-D WITH_LIBV4L=ON \
-D WITH_VTK=OFF \
-D WITH_QT=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D BUILD_opencv_python3=TRUE \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D BUILD_EXAMPLES=OFF ..

# run make
make -j4
sudo make install
sudo ldconfig

# cleaning (frees 300 MB)
make clean
sudo apt-get update

echo "Congratulations!"
echo "You've successfully installed OpenCV 4.5.0 on your Raspberry Pi 32-bit OS"

$ wget https://github.com/Qengineering/Install-OpenCV-Raspberry-Pi-32-bits/raw/main/OpenCV-4-5-0.sh
$ sudo chmod 755 ./OpenCV-4-5-0.sh
$ ./OpenCV-4-5-0.sh

https://www.qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html

Source:

https://www.qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html

Categories
Линукс Упътвания

Проверка на IP адрес през терминала в Ubuntu/Debian

wget -qO- http://ipecho.net/plain | xargs echo