Start With Raspberry Pi

Start With Raspberry Pi

Start With Raspberry Pi

apt Mirror

reference: https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/

## 编辑 `/etc/apt/sources.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib

## 编辑 `/etc/apt/sources.list.d/raspi.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

Virtual Keyboard

reference:https://www.cnblogs.com/little-kwy/p/9478961.html

sudo apt-get install matchbox-keyboard
sudo apt-get install libmatchbox1 -y
sudo nano /usr/bin/toggle-matchbox-keyboard.sh
##!/bin/bash
##This script toggle the virtual keyboard

PID=`pidof matchbox-keyboard`
if [ ! -e $PID ]; then
killall matchbox-keyboard
else
matchbox-keyboard&
fi
sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop
[Desktop Entry]
Name=Toggle Matchbox Keyboard
Comment=Toggle Matchbox Keyboard
Exec=toggle-matchbox-keyboard.sh
Type=Application
Icon=matchbox-keyboard.png
Categories=Panel;Utility;MB
X-MB-INPUT-MECHANSIM=True


It’s failed and I don’t know why. But there is a keyboard for rasberrypi, so…
Nse24I.png

Screen Shot

sudo apt-get install scrot
scrot test.png

## screen shot for
scrot -s 0 0 100 100
## Screen shot after 10s
scrot -d 10

Screen Record

sudo apt-get install vokoscreen
vokoscreen

USB Camera

reference: https://blog.csdn.net/yjp19871013/article/details/80147803

Take a Photo

sudo apt-get install fswebcam
fswebcam /dev/video0 ~/image.jpg #/dev/video0 is the video
raspistill -o ugi.jpg -w 2560 -h 1440 -v # -vf

Stream image

sudo apt-get install luvcview
luvcview -s 400x400


I got an error code after I launched the command. The image popped out and crashed after about 1s.

luvcview: ../../src/xcb_io.c:165: dequeue_pending_request:
Assertion `!xcb_xlib_unknown_req_in_deq' failed.


But I find that once you launched your camera, you need to keep the camera moving for a while and so, it can run smoothly.

自动免密码登录

##https://blog.csdn.net/zexzex_/article/details/78490054
sudo raspi-config
选择Boot Options
Desktop / CLT
console Autologin Text console init 3 或者 Desktop Autologin Desktop GUI 桌面环境
finish
reboot

开机任务

参考: yuanfujie

进入隐藏文件夹, 然后创建一个文件夹和文件, 做开机启动脚本

cd ~/.config
cd /home/pi/.config
mkdir autostart
cd autostart
## 创建自启脚本
sudo nano myapp.desktop

nano后粘贴代码如下。重点在Exec=XXX;
比如,我的需要执行的脚本路径为/home/pi/Blive

[Desktop Entry]
Type=Application
Exec=/home/pi/Blive
Icon=ICON_PATH

亲测有效

Enjoy~

Author

Karobben

Posted on

2020-06-26

Updated on

2025-09-02

Licensed under

Comments