从0开玩树莓派-1-开机配置

注意:如果你使用的是带HDMI的桌面版,一定要选择一个电流足够的适配器,否则会导致异常重启。

设置 root 密码

sudo passwd root

屏幕翻转

  • 带ui的新系统
    如果你的屏幕是180度倒置的,需要设置下屏幕:

    1. preferences->screen configuration
    2. 选择HDMI屏幕,右键->Orientation->inverted
  • 命令行的老系统
    1. sudo nano /boot/config.txt
    2. display_hdmi_rotate=2

开启sshd

  • 方法1:通过界面UI
    如果烧录是没有配置sshd,我们可以在进入系统以后启动:

    sudo systemctl enable ssh
    sudo systemctl start ssh
  • 方法2:通过SD
    当没有屏幕时,我们可以通过在sd boot盘的跟目录下创建SSH空文件,来启用默认的sshd配置。用户名pi,密码respberry

安装pyenv

系统默认python3,有时候你需要运行的项目是python2的,我们需要pyenv

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo 'export PATH="$PYENV_ROOT/libexec:$PATH"' >> ~/.profile
echo 'eval "$(pyenv init --path)"' >> ~/.profile
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL -l

从0开玩树莓派-0-安装和环境

Raspberry Pi 1 Model B+

file

On the other hand, the BCM2835 uses a single core and thread 32-bit microprocessor. Once again, it features a clock speed of 700 Mhz. However, it has a turbo capability to boost clock frequencies up to 1 GHz. Unfortunately, this feature is absent from the BCM2711.
The BCM2835 is an SoC that Broadcom Semiconductors developed.  As we have briefly mentioned in the introduction, SoC packages such as the BCM2835 make devices such as the Raspberry Pi Zero possible. Additionally, The Raspberry Pi Foundation features the BCM2835 in the Raspberry Pi A, A+, B, B+, and the Raspberry Pi Zero W. Moreover, you can find it in rare models such as the Raspberry Pi Compute Module 1.

Since it’s an older chip package, you’re unlikely to find it in newer microcontrollers or single-board computers. However, its capabilities and peripherals are still worth exploring.
  • Core Processor Architecture: ARM
  • Processor Speed: 700 MHz
  • Core Processor Sub-Architecture: ARM1176JZF-S processor
  • RAM: 512MB
  • SODIMM Board Size: 6.5x3.0 cm
  • Edge Connector Pins: 200
  • On-Board Flash Memory: 4GB eMMC
  • GPU: VideoCore IV GPU running at 250MHz

安装系统

准备大于8G的SD

Raspberry Pi Imager

根据前面的介绍,我们知道我们的板子是32架构,所以我们要选择32bit的系统:

file

说明:

  • 一定要选好的sd卡和读卡器,否则可能浪费很多时间。
  • 右下角的设置是可以预设一些参数的,对于无屏场景,很有用

经过耐心的等待,就会提示校验成功,可以拿下sd插入设备了。

参考

https://www.ourpcb.com/bcm2835.html

七牛的镜像存储配置说明

关于镜像存储功能简单总结:自动回源,切换无拷贝工作量,且只回源一次,在某些源不稳定的架构中,非常有用。

主要做以下几步:

空间管理

在对象存储-》空间管理里面,创建一个空间。

加速域名

加速域名其实就是你想镜像的内容入口。

  1. 需要去你的域名运营商解析处,配置cname,让域名能被重定向七牛的域名
  2. 如果原始资源是https,一定要配置https,否则无法访问

镜像回源

这里主要就是回源地址,这里非常有用的是支持端口,你懂的,内网资源呵呵呵。

file

做好以上设置,功能就基本可用了,至于其他高级数据,再按需开启。

最后需要说明的是,镜像服务是一种cdn服务,是收流量费的,在方便和钱之前,还是要实际斟酌调试的。

在ffmpeg项目中新增lib以及如何在so中调用so

我们知道在ffmpeg已经有了很多lib,比如avcode avdevice avutil等。

如果我们要现有的makefile框架中新增加一个lib叫做a.so,该如何修改?

本文基于ffmpeg4.3.4,如果验证版本有变,请自行调整。

  1. a自身的makefile可以参考现有的来修改:
    NAME    = a
    DESC    = FFmpeg new demo library
    HEADERS = a.h version.h
    OBJS    = a.o
  2. Makefile:
    FFLIBS := avutil a
  3. configure:
    # this list should be kept in linking order
    LIBRARY_LIST="
    avdevice
    avfilter
    swscale
    postproc
    avformat
    avcodec
    swresample
    avresample
    avutil
    a
    "
  4. ffbuild/common.mk
    ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample a

至此,只要a配置正确的makefile就应该能正确编译了。

扩展:如何 so 中调用so

上面介绍了如何扩展lib,假如ffmpeg原有的lib 叫 x.so, 我们二次开发了一个基于x.so的 a.so, 那么如何让a.so能正确调用到x.so?

configure:

# libraries, in any order
avenc_deps="ava"

说明上面的av是沿用ffmpeg默认命令习惯

附带make配置脚本

x86-64

TOOLS_DIR=toolchain/bin
./configure --enable-shared \
--disable-static \
--disable-x86asm \
--enable-cross-compile \
--strip=$TOOLS_DIR/llvm-strip \
--extra-cflags="-I$(pwd)/install/include" \
--extra-ldflags="-L$(pwd)/install/libs" \
--prefix=$(pwd)/install \
--target-os=linux \

arm

TOOLS_DIR=ndk-toolchain/bin
./configure --enable-shared \
--disable-static \
--disable-x86asm \
--enable-cross-compile \
--cc=$TOOLS_DIR/armv7a-linux-androideabi26-clang \
--cxx=$TOOLS_DIR/armv7a-linux-androideabi26-clang++ \
--strip=$TOOLS_DIR/llvm-strip \
--extra-cflags="-I$(pwd)/install/include" \
--extra-ldflags="-L$(pwd)/install/libs" \
--arch=arm \
--prefix=$(pwd)/install \
--target-os=android \

几个有用plmn

当我们想定制入网优先级,或者在多漫游网络中想选择较为理想信号强度的时候,就可能用到xPLMNs。

需要说明的是,部分plmn是在sim中的,能不能定制修改,跟开卡的套餐和运营商发卡的限制有关,需要实际测试。

所有的细节都在3GPP的标准中有详细说明,可以自行查阅。

PLMN 关系图

file

PLMN

file

OPLMN

file

HPLMN

file

FPLMN

file

UPLMN

我们经常看到uplmn用户自定义plmn,优先级高于oplmn,参考概述图,我们并没有看到uplmn的说明。

参考以下的内容:

The OPLMN is formally known as the ‘OPLMNwAcT’, and the UPLMN as the ‘PLMNwAcT’. The ‘wAcT’ in each case is short for ‘with Access Technology’

所以,uplmn 实际就是 PLMNwAcT=0x6F60=28512

参考ref:

  1. https://www.etsi.org/deliver/etsi_ts/131100_131199/131102/15.05.00_60/ts_131102v150500p.pdf
  2. https://www.twilio.com/docs/iot/supersim/how-and-why-to-set-super-sims-uplmn-table#super-sim-uplmn-codec