How to remove modules which are in use? - raspberry-pi

I'm using ov5647 MIPI camera in raspberry pi,
I make ov5640 driver as dynamic, now I try to remove ov5647 module with
sudo rmmod ov5647
but what I got is this:
$ sudo rmmod ov5647.ko
rmmod: ERROR: Module ov5647 is in use
this is lsmod output:
$ lsmod | grep ov5647
ov5647 20480 1
v4l2_fwnode 24576 2 bcm2835_unicam,ov5647
v4l2_async 24576 3 bcm2835_unicam,v4l2_fwnode,ov5647
videodev 249856 10 bcm2835_unicam,rpivid_hevc,bcm2835_isp,ov5647,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2,v4l2_async
mc 49152 10 bcm2835_unicam,rpivid_hevc,bcm2835_isp,ov5647,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2,v4l2_async
how to remove ov5647 module which is in use?

Related

How to install brew on a raspberry pi?

These are my raspberry pi OS, Kernel version and archtecture configs
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.10.52-v7l+
Architecture: arm
When I try to run their script(https://brew.sh/):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
I get
Homebrew on Linux is only supported on Intel processors!
and, whenever I try to run a brew command, I get:
-bash: brew: command not found
Homebrew for linux is called Linuxbrew. And the installation command that you need is:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
Please check out this link to get more info about it: https://github.com/Linuxbrew/brew
Also notice that while Linuxbrew can run on Raspberry Pi (32-bit ARM), no binary packages are available for it.
Here are my two cents on installing brew on RaspberryPi Zero W and RaspberryPi 3+ (RaspberryPi OS, bullseye).
$ # Install dependencies
$ sudo apt update -y && sudo apt upgrade -y
$ sudo apt install git
$ # Install rbenv and Ruby 2.6.8 (It takes 30-90 min.)
$ # As of 2022/06/09, ARM processors require Ruby 2.6.8.
$ # Check the gist below what is doing as well.
$ bash <(curl -sL https://gist.github.com/KEINOS/7101f542be23e5048198e2a27c3cfda8/raw/install_ruby_rpi.sh)
$ source ~/.bashrc
$ # Smoke test Ruby
$ ruby --version
ruby 2.6.8p205 (2021-07-07 revision 67951) [armv6l-linux-eabihf]
$ # Clone homebrew repo under /opt
$ sudo git clone --depth=1 https://github.com/Homebrew/brew /opt/homebrew
$ # Setup homebrew
$ sudo chown -R $(whoami) /opt/homebrew
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc
$ source ~/.bashrc
$ # Full update to tap homebrew/core (It takes 30-90 min.)
$ brew update --force --verbose
$ # Smoke test brew
$ brew --version
Homebrew 3.5.1
Homebrew/homebrew-core (git revision 1d9fb5dd1e6; last commit 2022-06-09)
$ # Install "hello world" package which supports both 32bit and 64 bit ARM.
$ # - Source: https://github.com/KEINOS/Hello-Cobra
$ # - Formula: https://github.com/KEINOS/homebrew-Hello-Cobra
$ brew install KEINOS/Hello-Cobra/hello-cobra
***snip***
$ hello-cobra hello world
Hello, world!
$ # Env info of RaspberryPi Zero W
$ more /proc/device-tree/model
Raspberry Pi Zero W Rev 1.1
$ cat /etc/debian_version
11.3
$ uname -a
Linux rpi-zero 5.10.92+ #1514 Mon Jan 17 17:35:21 GMT 2022 armv6l GNU/Linux
$ whoami
pi
$ echo $SHELL
/bin/bash
$ # Env info of RaspberryPi 3+
$ more /proc/device-tree/model
Raspberry Pi 3 Model B Rev 1.2
$ cat /etc/debian_version
11.3
$ uname -a
Linux rpi-3pls 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
$ whoami
pi
$ echo $SHELL
/bin/bash
Note that everything for brew is slow on ARM6. Patience is required not only when setting up linuxbrew, but also when installing packages using brew.
However, once the package has been successfully installed, it should work as fast as expected. So, I'd say it is worth trying linuxbrew on the ARM6 and ARM64 architectures.
References
ARM | Homebrew on Linux # docs.brew.sh
Untar anywhere | Installation # docs.brew.sh
How can I check the available version of a package in the repositories? # AskUbuntu.com
Installing Ruby versions | rbenv # GitHub
Raspberry Pi
Homebrew can run on Raspberry Pi (32-bit ARM), but no binary packages
(bottles) are available. Support for Raspberry Pi is on a best-effort
basis. Pull requests are welcome to improve the experience on
Raspberry Pi.
https://docs.brew.sh/Homebrew-on-Linux
Two comments on installing Homebrew on Raspberry Pi 400 Rev 1.0, Raspbian Debian 11.5.
For an unknown reason Homebrew installer requires exactly ruby version 2.6.8. My Pi has ruby 2.7.4 but that was not accepted
After installing 2.6.8 using the above hint (ruby-build available from the regular repository does not offer it, the next after 2.6.6 being 2.7.0), the brew update --force --verbose command was still failing on not finding 2.6.8. It was so because the 'brew' script has the PATH explicitely filtered to the system one, "/usr/bin:/bin:/usr/sbin:/sbin". Only after manually adding the path for ruby 2.6.8 did the update work. NB. the script was overwritten during the process so in order to install any package I had to add the path it again.
Any idea why it is "exactly 2.6.8" and not "2.6.8 or newer"?

Identifying distro on Raspberry Pi

I followed instructions to get distro on my Raspberry Pi and got the following:
pi#raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
How do I extract the distribution from this? Next time someone asks how do I answer?
The content of that file is full of variable so:
source /etc/os-release && echo $PRETTY_NAME
Replace the variable name with the one you are interested of.
You can also use the lsb_release -a command to detect the distribution

rsync ignoring file permissions

I'm sorting and rationalising my backups to my raspberry pi + ext drive
One is a win10 PC that I mount
sudo mount -t cifs //192.168.1.92/blah/PC /mnt/PC -o username=xx,password=xx,ro,uid=pi,gid=pi
and then the source directory (eg)
pi#raspberrypi:~ $ ls -la /mnt/PC/pictures/
total 24284
pi#raspberrypi:~ $ ls -l /mnt/PC/..../Pictures/2009_07_15/ | grep 70
-rwxr-xr-x 1 pi pi 2387027 Jul 15 2009 IMG_0063.JPG
-rwxr-xr-x 1 pi pi 2385117 Jul 15 2009 IMG_0070.JPG
-rwxr-xr-x 1 pi pi 3457076 Jul 15 2009 IMG_0071.JPG
pi#raspberrypi:~ $
pi#raspberrypi:~ $
ive rationalised backups so have some pictures in destination from another source
so the (existing) destination is
pi#raspberrypi:~ $ ls -l /mnt/seagate/PC/../2009_07_15/ | grep 70
-rwxrwxrwx 1 pi pi 2387027 Jul 15 2009 IMG_0063.JPG
-rwxrwxrwx 1 pi pi 2385117 Jul 15 2009 IMG_0070.JPG
-rwxrwxrwx 1 pi pi 3457076 Jul 15 2009 IMG_0071.JPG
when I do
rsync -n -vv -rtdiz --no-owner --no-perms --no-group --progress --log-file=/tmp/rsynclog --backup-dir=/mnt/seagate/deletedfiles/backup-2020-01-07 --delete /source /destination
it says it will delete the files in 'destination' and then copy the same file from 'source'
pi#raspberrypi:~ $ cat /tmp/rsynclog | grep 2009_07_15
2020/01/08 11:55:02 [31205] backed up Documents.../2009_07_15/Thumbs.db to /mnt/seagate/deletedfiles/backup-2020-01-08/....2009_07_15/Thumbs.db
2020/01/08 11:55:02 [31205] backed up Documents..../2009_07_15/IMG_0071.JPG to /mnt/seagate/deletedfiles/backup-2020-01-08/....2009_07_15/IMG_0071.JPG
etc etc
2020/01/08 11:56:45 [31205] .d..t...... Documents/.....Pictures/2009_07_15/
2020/01/08 11:56:45 [31205] .f Documents/.. .2009_07_15/IMG_0061.JPG
2020/01/08 11:56:45 [31205] .f Documents/../Pictures/2009_07_15/IMG_0062.JPG
2020/01/08 11:56:45 [31205] .f Documents../Pictures/2009_07_15/IMG_0063.JPG
etc
I assume because the permissions are different
OK - i could just chmod all the files in 'destination' but I'd like to know what ive done wrong in the rsync command .
The difference i have found which could account for the transfers is
on the source , the mounted windows machine
pi#raspberrypi:/mnt/PC/Documents/path,... $ ls -l | grep ALL
drwxr-xr-x 2 pi pi 0 Jan 1 07:54 ALL PHOTOS
on the destination , the seagate attached HD
pi#raspberrypi:/mnt/seagate/PC/Documents/path,... $ ls -la | grep ALL
drwxrwxrwx 1 pi pi 20480 Dec 18 22:08 ALL PHOTOS

Docker compose install error 'curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104' in Ubuntu

I am trying to install docker compose on the Ubuntu 18.04.2 LTS.
I tried installing using the official link here and followed the Docker Compose documentation given, but when i run the command
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
then after some time it gives me this error
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 617 0 617 0 0 613 0 --:--:-- 0:00:01 --:--:-- 613
24 8280k 24 2056k 0 0 789 0 2:59:06 0:44:27 2:14:39 0
**curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104**
Kindly help me on this i have tried many times but it is not working.
I had the same problem. I assume that you are using Docker Docs, which are usually outdated. You should go to Docker Compose Github instead.
Solution
1 - Open Linux Terminal by pressing Ctrl + Alt + T
2 - Install curl:
sudo apt install curl
3 - Turn on root privileges in terminal for your user (something like admin in Windows OS), with command:
sudo -i
4 - Go to Docker Compose Github. In releases you will find this code. Run it in your linux terminal.
curl -L https://github.com/docker/compose/releases/download/1.25.1-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
5 - Turn off root privileges in terminal for your user, with command:
exit
6 - Check if docker-compose is installed with command:
docker-compose version
Outcome: In your terminal, you should see docker-compose version number and some other informations.

AT command gives no response

I have a Raspberry Pi 3 running Raspian Lite
pi#raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
I am following this tutorial, setting up an Adafruit Fona 808 for GSM/GPS connections. I've installed screen and pppd as instructed.
pi#raspberrypi:~ $ sudo apt-get install screen ppp
Reading package lists... Done
Building dependency tree
Reading state information... Done
ppp is already the newest version (2.4.7-1+4).
screen is already the newest version (4.5.0-6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
The problem is that when I start screen and enter 'AT' I get no response.
I start the screen session like so:
pi#raspberrypi:~ $ sudo screen /dev/serial0 115200
I see a black screen with blinking cursor. I enter 'AT' on my keyboard but no characters appear on the screen. I press enter, still nothing appears.
I'm using screen version 4.05.00
pi#raspberrypi:~ $ screen --version
Screen version 4.05.00 (GNU) 10-Dec-16
I am not sure how to troubleshoot this issue.
Any suggestions?
Running the following:
pi#raspberrypi:~ $ sudo ls -l /dev/
I noticed that serial0 is pointed at ttyS0
lrwxrwxrwx 1 root root 5 Feb 3 23:49 serial0 -> ttyS0
So, running the following worked:
pi#raspberrypi:~ $ sudo screen /dev/ttyS0 115200
In screen:
AT
OK