Pine A64+ single-board computer

This comes in a few different models, A64 and A64+ they are all 64-bit with 4 cores but RAM and IO varies.

There are also the SOPine module, which has the system on a smaller card, similar to a memory module. There exist also the PineBook, a laptop with the processor and screen. The discussion here will apply to the Pine A64+ with 2 GB.

Throughout these pages, there will be references to the various electrical connections to the Pine board. These have a letter identifying the connector, and a number identifying the pin on the connector.

Pin numbers legend.

PPI-2-BUSP1 ... P40
EEuler BusE1 ... E34
XExpansion ConnectorX1 ... X10
WWifiW1 ... W14
BBluetoothB1 ... B16
TTP connectorT1 ... T6

There are also two ways that the various GPIOs are referred to in documentation and software: the Port-letter-number referring to the various banks of hardware IO structures, and the sequential numbering used in the Linux system, both in /sys/class/gpio and inside the kernel module sources.

There is a fairly simple one-to-one mapping between these, essentially, for port PXn this is:

Linear = (letter X - 'A') * 32 + n 

More details on these will be revisited as needed on these pages

Board
GPIOs Electrical specs
GPIOs Geographical layout
GPIOs ordered by number
Audio Jack
UARTs and serial ports
i2c
SPI
GPIOs via /sys/class/gpio
GPIOs via /dev/mem
Miscellanea
Installation notes
Kernel hacking
On Devicetree
OpenBSD experiences

Early notes and other unsorted details are moved here

To index page

Network settings:

DHCP:

File /etc/network/interfaces.d/eth0

allow-hotplug eth0
iface eth0 inet dhcp

Make sure DHCP is enabled.

systemctl enable dhcpcd.service
systemctl start dhcpcd.service

Fixed:

Showing example with ip-address at 10.0.1.254

File /etc/network/interfaces.d/eth0

auto eth0
iface eth0 inet static
    address     10.0.1.254
    netmask     255.255.255.0
    network     10.0.1.0
    broadcast   10.0.1.255
    gateway     10.0.1.1

Turn DHCP off -- or we will get assigned another IP address as well!

systemctl stop dhcpcd.service
systemctl disable dhcpcd.service

On Armbian

There is also a utility called nmtui that helps with a lot of these settings, for the NetworkManager which is used there.

Other items

Vim

I like some of the default settings in vim, such as syntax coloring, but incremental search and many levels of undo are annoying. The configuration used to be .exrc files, but these removed the coloring, so there are some other places for settings, notably /etc/vim/vimrc

and /usr/share/vim/vim81/defaults.vim

So adding the following in /etc/vim/vimrc worked almost right:

set background=dark
set noincsearch
set undolevels=0
set tabstop=4
set shiftwidth=4
set showmatch

undolevels=0 turns the many undo levels things off, tabstop=4 and shiftwidth=4 makes tabs at spacing 4, and the << and >> shifts 4 to the left or to the right. showmatch makes vim highlight matching parentheses and bracket. And background=dark makes things look good on the usual black screen background.

Except for that the incremental search stayed on no matter what. Turns out, this is enabled as long as the terminal is sufficiently responsive. This was found in the file: /usr/share/vim/vim81/defaults.vim and the cure was to comment out the section there that turned on the incremental search.

All the other settings shown can also go into the /usr/share/vim/vim81/defaults.vim

ll alias

For the ll command, usually mapped to ls -l to show file dates in iso-8601 style yyyy-mm-dd, the option --time-style=long-iso exists for ls. So in the .bashrc file the alias is defined as:

alias ll='ls -l --color=auto --time-style=long-iso'

Things in /etc/rc.local won't start

Sometimes, server programs started from /etc/rc.local won't run. This is because rc.local might be started before the networking is up. One fix is to have it wait for 10 or 20 seconds before doing anything.

Or use the systemd mechanism instead of /etc/rc.local. For the rpiinfoserv program that listens on port 11620 and allows discovering interesting and useful info from the device, then instead of:

sleep 20
/usr/local/bin/rpiinfoserv &

in /etc/rc.local, we make a file /etc/systemd/system/rpiinfoserv.service with the following contents:

[Unit]
Description=Machine info server
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=hware
ExecStart=/usr/local/bin/rpiinfoserv

[Install]
WantedBy=multi-user.target

Then do

chmod 664 /etc/systemd/system/rpiinfoserv.service
systemctl start rpiinfoserv.service
systemctl enable rpiinfoserv.service

Now this will start up automatically on booting, as well as re-start when or if it fails.


Powered by Apache

Valid XHTML 1.0!