2020年3月8日日曜日

rockpi-s に浮気

低消費電力==低発熱だというので、
rockpi-s に浮気しました。

注: arietta G25 も買いました。licheepi nano も買いました。後者はネットにつなげにくので、可愛いし、最初からflashにlinuxが入ってるという偉いやつなので重用してあげたいんだけども難しい。しかも詳しいwikiは中国語のまんまだし。

で、もとにもどって rockpi-s に aitendo で買った gps GE612Tをつなごうとしてなかなか繋がらなくて参りました。
よーくデータシートをみたら、GE612Tの pin4 をLowに落とさないとパワーセーブモードになってるんだって。<< よく読めよ俺

rockpi-s の初期設定

sdcard にはココから ubuntu-bionic を落として書き込みます。
シリアルのデフォルトは へんな数字になってて持ってるやつだと繋がらないので、
イーサネットに接続。DHCPです。
id/password は rock/rock です。さっさとこのパスワードと、rootパスワードを変更して自分の id を追加しておきます。
追加したユーザはvisudo で権限を与えておきましょう。
面倒なので、いつも下記の行をコピペしてからidに変えてます。

root    ALL=(ALL:ALL) ALL

つぎはお作法通りに

$ sudo apt update
$ sudo apt upgrade
ですね。
私はemacs指なので、ここが終わったら、
$ sudo apt install ng-cjk tcsh
とかとか。

さて肝心のGPIO系の設定ですが、ココの指示通りでいけますが、一応ダイジェスト版としてメモを残しておきます。

$ sudo su
#
# export DISTRO=bionic-testing
# echo "deb http://apt.radxa.com/$DISTRO/ ${DISTRO%-*} main" | sudo tee -a /etc/apt/sources.list.d/apt-radxa-com.list
# apt install wget
# apt install rockchip-overlay rockpis-dtbo libmraa-rockpis

GPIOの設定ファイルは /boot/hw_intfc.conf です。
armbian-config 見たいのはありません :-)
下記は設定サンプルです。まあまあわかりやすいですね。当然ですが、有効にするためにはrebootが必要です。
# Hardware Interface Config

# Set "on" to enable the optional hardware interfaces while set "off" to disable.

intfc:i2c0=off
intfc:i2c1=off
intfc:i2c2=off
intfc:i2c3=off

intfc:pwm1=off
intfc:pwm2=off
intfc:pwm3=off

intfc:spi0=off
intfc:spi2=off

intfc:uart0=off
intfc:uart1=on
intfc:uart2=off

# Devicetree Overlay Enable, uncomment to enable .dtbo under /boot/overlays/.

# Serial console on UART0
intfc:dtoverlay=console-on-ttyS0

# waveshare 3.5inch lcd (B v2) on SPI2. Need set:
# intfc:uart1=off intfc:uart2=off intfc:i2c0=off intfc:spi2=on
#intfc:dtoverlay=spi2-waveshare35b-v2

# waveshare 3.5inch lcd (C) on SPI2. Need set:
# intfc:uart1=off intfc:uart2=off intfc:i2c0=off intfc:spi2=on
#intfc:dtoverlay=spi2-waveshare35c

# Dummy spi device on SPI0 for test. Need set: intfc:spi0=on
#intfc:dtoverlay=devspi0

# Dummy spi device on SPI2 for test. Need set: intfc:spi2=on
#intfc:dtoverlay=devspi2

# Use /dev/ttyS0. Need set: intfc:uart0=on
#intfc:dtoverlay=rk3308-uart0

# Use /dev/ttyS1. Need set: intfc:uart1=on
intfc:dtoverlay=rk3308-uart1

# Use /dev/ttyS2. Need set: intfc:uart2=on
#intfc:dtoverlay=rk3308-uart2