Orange Pi Zero + Armbian Setup

Orange Pi Zero + Armbian Setup Техника

You can update the the board using apt.

apt update
apt upgrade

I bought a couple of Orange Pi Zero () mini computers and decided to install Armbian on them.

ARMBIAN IS NO LONGER ACTIVELY SUPPORTED BY OLIMEX, CONTACT ARMBIAN COMMUNITY FOR SUPPORT

Get the latest sources:

git clone https://github.com/OLIMEX/u-boot.git
cd u-boot

make A20-OLinuXino_defconfig
make CROSS_COMPILE=arm-linux-gnueabihf-

On paper, the Orange Pi Zero looked like
a a single board computer that could be useful, so I purchased one. As
a first test, I installed (). I also installed the
MQTT broker.

The comments below are only first impressions because I only wanted to
check that the hardware worked. I will set aside the Orange Pi Zero to
complete more urgent projects.

Default login is:

login: root
password: 1234

After login you’ll be prompt for new password.

If you don’t reach console login prompt, ensure that your external power supply is good enough (A20 boards shouldn’t be powered via USB, neither via GPIO headers); ensure that your card is properly working and properly written with a well-known tool; consider that your board and/or image might require manual configuration (refer to Manual board configuration)

More than two years ago I purchased a Rock Pi S model D4W and after not doing much with the board for almost a year, I finally installed on it. At that time, I put up a post about Installing an OS on the Rock Pi S. In it I described in detail the installation of the January 26, 2021 versions of both Buster and Focal images from . I also reported a failure when it came to install the then currently available version of for the Rockchip RK3308. I have now managed to install a newer version of on the board and below I describe the relatively painless procedure. Do check out the last section which explains why, after all this, will not be used with the Rock Pi S.

Lately, I’m using the Orange Pi Zero bought some time ago for new
projects. It is important to validate procedures by repeating them in fresh
installation of the operating system. That means burning the OS image on a
microSD card and then performing a number of initial steps such as setting up
the network, upgrading all installed packages and so on that need to be
repeated in exactly the same way each time a new image is used. All this
takes time and somewhat error prone. So I decided to create a binary image
that avoids these steps.

It is much easier to create a custom image of than it was to do it for . However, it is necessary to have access to a machine with a microSD card reader and with installed. Probably the command line utility
parted could be used in place of the latter.

The elegant way of doing this would be to build the OS image from sources
modifying it to meet my needs. But a cursory look at the Developer Guide was enough to convince me that such an
endeavour was above my pay scale.

Make sure to take a look at the official Armbian documentation here: https://docs.armbian.com

git clone —branch olimex https://github.com/olimex/build

cd build
./compile

Building requires root access. System preparation can take long, depending on system, internet connection, etc. After everything is ready a prompt will appear:

The first option will build only u-boot and kernel packages. This is suitable for updating image. The second option will make ready to use image with u-boot, kernel and rootfs.

Here you can modify kernel configuration, before build. After that target must be selected.
Olimex’s images are not officially supported by Armbian team, so you must select Show CSC/WIP/EOS option.

Select the target board. Displaying:
— (CSC) — Community Supported Configuration
— (WIP) — Work In Progress
— (ESO) — End Of Support

Here select either:

olinuxino-a20 — Common configuration file for All A20-OLinuXino boards

olinuxino-a33 — A33 quad core 1Gb Soc

Next kernel variant must be selected. Here select next branch:

Next select distribution:

Finally select building desktop environment or not:

After some time the image / packages will be available in the output directory. For example:

# dd if=/path/to/Armbian_5.65_Olinuxino-a20_Ubuntu_bionic_next_4.19.5_desktop.img.img of=/dev/sdx bs=10M

Replace /dev/sdx with your device. You must use /dev/sdx, not /dev/sdx1!

Armbian — ОС для однопалатных компьютеров на базе ARM — процессоров: Orange Pi, Banana Pi, Odroid, Olimex, Cubieboard, Roseapple Pi, Pine64, NanoPi и др.. При помощи этой ОС можно создать домашний сервер, мультимедийную приставку, игровой сервер и многое другое. И для того, чтобы работать с ОС Armbian, для начала необходимо как-то её установить. В данной статье пойдёт речь о том, как установить и настроить Armbian на Orange Pi PC.

Убедитесь, что у вас есть хорошая и надежная SD-карта, рекомендуется выбрать карту памяти 10-го класса. Архивы могут быть распакованы с 7-Zip на Windows, Keka на OS X и 7z на Linux (sudo apt-get install p7zip-full). RAW образы могут быть записаны с помощью Etcher (для всех ОС).

Как выбрать ОС для Orange Pi?

Записать .img образ Armbian очень легко с утилитой Etcher, она доступна для Windows, Linux и Mac.

Первый запуск ОС Armbian на Orange Pi

Войдите в систему как root через HDMI/последовательную консоль или через SSH и используйте пароль 1234. Вам будет предложено изменить этот пароль при первом входе в систему. Далее вам будет предложено создать учетную запись обычного пользователя.

После создания учётной записи вам вам нужно будет настроить экран с помощью утилиты h3disp.Настроить можно при первом запуске, в таком случае нажмите Y, или потом — нажмите n. После того, как нажали Y, появится список доступных конфигураций;Если у вас HDMI монитор на 1080p и 60Гц, тогда выполняйте следующую команду:

sudo h3disp -m 1080p60

а если DVI монитор, добавьте и параметр -d:

sudo h3disp -m 1080p60 -d

Перезапустите компьютер reboot;После запуска вы увидите чистый рабочий стол;Версия системы lsb_release -a.

Как подключиться к Wi-Fi роутеру

Если у вас плата со встроенным модулем Wi-Fi или USB адаптером, тогда подключиться к сети можно с помощью nmtui-connect.

ROUTER_SSID — это идентификатор сети, или, проще говоря, её название.

Installation of Armbian

I used to copy the image of the operating
system to an SD card. The software is available for Linux, Windows and
OS X and its operation should be similar on all those platforms. Download the
correct version of ETCHER
according to the operating system of the desktop. The application has to be
extracted from the downloaded archive. In 64-bit Linux, it is named
Etcher-1.0.0-linux-x64.AppImage.

Once again, thanks to the developers of for
the simple and effective program.

Installing a MQTT Broker

To replace the Raspberry Pi as a host of my home automation system, I
also verified that can be installed on the
OPiZ.

The clients to subscribe to topics and
to post messages can also be installed at this point.

Once this installation completed, we can see all the messages received by
the broker.

Verification that the MQTT server is working is done by opening a
terminal on the desktop and publishing a message.

Here is what is displayed in the terminal subscribed to the MQTT messages.

The key combination
terminates the subscription to the MQTT broker messages.

Check that works with the local MQTT
broker on the OPiZ by restoring localhost as the remote address of
the MQTT hardware.

How to use Armbian images

The great Armbian documentation is available here and should always be considered:

Yet, consider that there might be some minor differences in our images.

Copy on a microSD card

Get the image from the download page.
Since the target is an Orange Pi Zero, I ended up getting even though is already available.

The downloaded file is a 7z compressed archive so it is necessary to
extract the image file,
Armbian_5.69_Orangepizero_Debian_stretch_next_4.19.13.img in
order to use Balena
Etcher as recommended by Igor Pečovnik et al at
Armbian.com.

Setting Up Domoticz

At this stage, some basic parameters of the system should be defined. At
a minimum, the location (longitude and latitude) must be specified. In
addition, we should add a password and so on.

To verify that the OPiZ can host the home automation system that is
already installed on a Raspberry Pi, I proceeded in another way. I copied
the server database from the Raspberry Pi
to the OPiZ. This operation is done in two steps: copy the database to a
desktop computer and then copy this database to the OPiZ.

Orange Pi Zero + Armbian Setup

Orange Pi Zero + Armbian Setup

Orange Pi Zero + Armbian Setup

Switches and other devices will now be visible. However, if you click on
a lamp to turn it on or off, nothing will happen. The reason is simple, the
address of the MQTT broker is not correct. Here’s how to correct the address.

Now the lamps can be controlled with this
server.

This shows that potentially this home automation software could be used on
an Orange Pi Zero.

Configuring the Orange Pi Zero

I did not change the configuration of the OPiZ much since this was only
a first look. But since I wanted to test the composite video output, I had to
add tv to the modules to load at startup.

That allowed me to verify that the video output of the expansion card is
working in a fashion. However, there is so much overscan that it will be
practically useless without corrections. I found two references on the web
about this and if the need arises I will consider the question later:
PSA: Orange Pi Zero expansion board tv-out not working
solution et Allwinner Composite Video Configuration Tool.

By default, systemd saves logs to files saved on the SD
card. This may not be the best arrangement because there is a limit to the
number of reads and writes that can be made on an SD card. It is better to
write the log in memory.

Edit the journald configuration file, changing three lines as
shown below.

The source of this tip is the wiki. However, it may be best to
wait before taking this advice so as to keep the logs persistent until
everything is stable.

If there is to be more than one Orange Pi Zero on the local network, it is probable a good idea to change the hostname of the system. This can be done with the configuration utility.

Дополнительно:  Gts root r1 сертификат

Select, Personal   TimeZone, languague, hostname and then Hostname   Change your hostname (orangepizero) options. Type in the new host name. It will be necessary to reboot for the change to take effect. Once that is done it is a dood idea to check the /etc/hosts file.

127.0.0.1 localhost orangepizero
::1 localhost orangepizero ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

to make sure that it has been updated and that orangepizero has been replaced by the new host name in the first line.

Operating System — This Time

Because my desktop, portable computer, the Raspberry Pi hosting the home automation system, and other single-board computers that I play with all have based distributions, I wanted to use something similar on the RPiS. There seems to be two flavours, and (which is itself based on ), available from two sources: and .

There’s no point in putting direct links to any of these image files, as they may be replaced with newer versions. Just consult the download pages. The link to the images for unsupported images is not too obvious, so here it is: rockpi-s/archive.

There are at least five ways to access the board’s console but the serial-USB converter is always recommended since it is the most resilient to software misconfiguration.

The first two access methods should always work by default. Also consider that you can interrupt boot process only if using one of these two:

1. serial-USB converter cable over the UART debug pins + personal computer with serial terminal software

2. HDMI monitor

Method that would work out-of-the-box only with newer hardware:

3. LCD display

The two other methods require some more knowledge and experience and might require additional configuration — the USB-OTG connector and via the Ethernet connector. Furthermore, you can’t interrupt boot process since the processes get started during kernel:

4. Serial over USB-OTG connector + personal computer with serial terminal software

You could use the USB_OTG connector as serial port. Connect the board to a host computer via USB-mini cable. Wait some time for the board to boot. In the system log you should see something like:

dmesg

usb 3-2: new high-speed USB device number 5 using xhci_hcd
usb 3-2: New USB device found, idVendor=0525, idProduct=a4a7
usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 3-2: Product: Gadget Serial v2.4
usb 3-2: Manufacturer: Linux 4.19.5-sunxi with musb-hdrc
cdc_acm 3-2:2.0: ttyACM0: USB ACM device

Then use picocom, minicom, etc to login:

picocom -b 115200 /dev/ttyACM0

18.04.1 LTS olinuxino ttyGS0
olinuxino login:

5. SSH over Ethernet connector + personal computer

H2+ Running Hot

Like many, I noticed that the chip
seems to run at high temperatures. The reliability and even the life of the
OPiZ could be at stake.

As can be seen, the temperature of the microprocessor is about 60°C
while it does practically nothing at a frequency less than 1/4 of its
maximum rate. The ambient temperature is about 19°C, the board is
not in its case and the expansion card is not connected.

A utility can be used to reduce power consumption and, in principle, reduce
the temperature.

Since it is almost certain that the OPiZ will be used as a server, there
are no consequences to stopping the graphics processor.

After an hour here is the result

Hard to say that there is a great improvement especially that the
workload of the microprocessor seems weaker. We can reduce the consumption
even more.

Here are the results of this more aggressive approach that stops the
operation of the graphics processor, the Ethernet interface, the USB
connection and which manages the power consumption of the WiFi interface.

There are other ways mentioned in Armbian documentation on how to control a pin. Make sure to explore other options.

First Boot and Necessary Housekeeping

There were three ways to open a bash session on the Rock Pi S running Buster from : an Android Debugging bridge adb over USB, a direct serial connection using a USB-serial converter, and an SSH connection over the local area network. Be aware that in the latter case, it will be necessary to connect the Rock Pi S to the LAN with an Ethernet cable. Furthermore, it will be necessary to ascertain the IP address assigned to the Rock Pi S by the DHCP server on the LAN to connect to the board because the avahi service is not enabled by default in the OS image. In the current focal version of , adb is not installed, so there are two ways of opening a session with the Rock Pi S. Do be careful, in the console input/output are connected to UART2 and not UART0 as in the images. The diagram to the right shows where to connect the Rx, Tx and ground signals of a USB-Serial converter. Below is the amended 26 pin header 1 for version 1.2 of the Rock Pi S board. The orange background identifies the default UART console connection. As far as I can tell, it does not matter which version of the Rock Pi S is used with , UART2 will be on pins 19 and 21.

While I prefer to use SSH, this first boot will be done with a USB-Serial connection in place. From experience I know that the serial converter will be mapped to the ttyUSB0 or ttyUSB1 device, so that is fairly easy to ascertain. I then started a terminal (cu, but miniterm.py, picocom, screen, etc. could be used) connecting to that device at 1500000 baud. The advantage of using the serial link for this initial boot is that the messages from the bootloader (U-boot) and from the boot sequence will be seen, just as if a monitor were connected to the board.

While it would have been possible to continue with the initial configuration of the Rock Pi S through the console, I prefered to start an SSH session as root with the default 1234 password.

I had a quick look at the main services running on the board.

That confirms that avahi-daemon and adbd are not started. Then I looked at the logs and saw that there were quite a few warnings and some errors.

The most ominous seems to be the conflict over a GPIO pin that two peripherals (SPI2 and UART2) are both trying to use. If I understand the error messages, the SPI interface is not created because the serial device has a prior claim on the pin which is what Hiezer reported on October 8, 2021. Since UART2 is obviously working, I would suspect that he is right but I have not tested this.

The bootloadeer does appear to apply the fixup script without raising any error.

Unfortunately, this does not eliminate the conflict between the SPI and serial devices. I cannot say if this «fix» is doing anything useful or is actually causing problems; use it at your own peril.

Usage

There is not much to using this customized image. Copy it to an microSD
card with . Once that is done, just insert
the microSD card in the Orange Pi Zero card reader and power it up. The initial
boot of the Orange Pi Zero can take a very long time, many minutes, so be
patient. Eventually, it will be possible to reach it over a wireless
connection.

Reboots will be much faster. Note how the partition is 2 GiB in size and
slightly more than half is free.

Packages should also be upgraded with the usual commands.

As time goes on, this will take ever longer and it
could become worthwhile to save the updated image as shown in the
previous section for future use.

It is a very good idea to change the host name immediately using
armbian-config. Otherwise, avahi will assign
a different name to a second Orange Pi Zero on which this same image has
been copied because of the common orangepizero host name.
It will be harder to open an SSH session.

Manual board configuration

By default A20 boards manufactured after 01.01.2018 have board IDs stored in the EEPROM memories with automatic detection in mind and these would not require manual board configuration. These «newer» boards get identified and recognized by the information stored on their EEPROMs and proper Linux configuration gets automatically loaded.

The Armbian-based image is universal for all Olimex A20 boards and in order to load proper configuration some additional board configuration might be required. In order to use this image with boards manufactured or purchased before 01.01.2018 a one-time configuration might be required. This procedure is also helpful if you erased or used the EEPROM for other purposes (thus overwritten the information about the board’s ID).

The manual configuration requires interrupting the boot and loading the proper configuration for your board. You would also need either HDMI or serial-USB connection to the board (Ethernet SSH and USB-OTG connection to the board are configured in the kernel and you can’t interrupt the boot soon enough to enter the u-boot configurator). If your board has EEPROM (all boards except for old revisions of A20-SOM should have EEPROM), this configuration can be stored for subsequent boots.

olinuxino config list

Remember the ID number of the board that you have from the list.

olinuxino config write 9604 k

After the hardware revision «k» you can also add custom serial number or custom MAC address. That data would be stored to the EEPROM of the board.

olinuxino config info

Static IP for the Wireless Interface

Reboot the board just to be sure. The sign on message will show the two IP addresses of the two interfaces.

On my LAN, 192.168.3.23 is in the pool of static IP addresses while 192.168.3.145 is in the pool of dynamic addresses assigned by the DHCP server. If the board will most often be connected to the local network using the wireless interface, then it makes sense to assign it a static IP address. This is done in exactly the same way as done with the wired connection. In the main mntui menu (do not forget to invoke the utility with the sudo prefix) chose the Edit a connection option and then select the Wi-Fi connection to edit.

Orange Pi Zero + Armbian Setup

As before set the IPv4 CONFIGURATION to manual and enter the static IP address and the IP addresses of the gateway and DNS servers.

Orange Pi Zero + Armbian Setup

Note that I have again disabled IPv6. Note also that the static IP address given to the Wi-Fi connection is different from the static IP address of the wired interface or any other device on the LAN for that matter. Here are the resulting IP addresses of the two interfaces.

My prefered way of setting up the IP addresses of the two network interfaces is to set a fixed IP address for the interface that is most often used and to let the other interface obtain its IP address from the DHCP server on the local network. Since my Rock Pi S will in all likelihood connect to the LAN with the Wi-Fi interface, I edited the wired connection and set the IPv4 CONFIGURATION back to Automatic. Here is the final network setup of the board.

Дополнительно:  Ремонт залитого ноутбука. Что делать, если пролили воду на ноутбук, залили ноут?

Basically that means that should there be a major change to my LAN such a modification of the subnet used, I should be able to log into the Rock Pi S using a wired connection and fix the static IP address.

Booting Up

I plugged in a network cable and powered the pi up via the micro  port.

I left it for 5 minutes to do its initial setup per the instructions from the
Armbian documentation.

Then I had to figure out what is the address of the pi, so I can ssh into it.

The address is assigned automatically via .

After a few trial/error attepts with ping, nmap, looking at leases at the internet modem web interface and switching the pi off/on, I finally sshed in:

Default root password is 1234.

Orange Pi Zero + Armbian Setup

One way to boot the board is to connect a USB-TTL converter to the UART to
the three pin header near the RJ45 connector on the OPiZ. This is described
in a later post. While I have just
today (November 27) tried this, it will become my favourite method of booting
the OPiZ especially when trying to debug problems at startup.

Another way to boot the board is by using an SSH connection from
another computer while the OPiZ is connected to the LAN with an Ethernet cable. The
only difficulty, is to find out which IP address was assigned by the DHCP
server (typically by the router) on the network.

There are two ways to get the information. One can try to spot the
newcomer on the network by examining the list of devices connected to the
router. Typically, routers display this list in the web interface that is
used to manage them. Unfortunately, the presentation of this interface is
different from one model to another, it is not possible to give
instructions. As an example, here is part of the list displayed by my router
showing an unknown device.

Orange Pi Zero + Armbian Setup

The other way to get this list is to use a network explorer that looks
at all the IP addresses and, for each, searches for open TCP ports. I use

with the GUI (installed from the
repository). Others might prefer
which runs on ,
and as long as a
fairly recent version of is already installed.

The principle is the same, no matter how we want to identify the OPiZ.
An initial scan of the local network is made to obtain the list of devices
already connected to the network. Then insert the SD memory card programmed,
connect the Ethernet cable into the RJ45 socket and connect the power supply
to the OPiZ. If all goes well, will boot and
after thirty seconds it will get an IP address and accept an SSH connection
on port 22. If we then redo the scan of the local network, it should be easy
to identify the new device.

Orange Pi Zero + Armbian Setup

(*) If this is the first time that ssh is used with this
address, there will be a dialogue asking if the security keys are to be
registered. Answer yes («yes» in full).

If security keys have already been registered for this address,
a warning is displayed.

There is probably nothing nefarious going on. As suggested, enter

which will erase the old key and then try to connect again.

Closing Remarks

In case anyone is wondering, the problem with the device tree overlays remains the same in the most recent edge image based on the 5.1.3 kernel.

Enable Wi-Fi

Again the Net Manager utility nmtui can be used to change the network settings to enable the Wi-Fi connection.

When selecting Activate a connection in the main menu, a list of nearby Wi-Fi networks is displayed.

Orange Pi Zero + Armbian Setup

Select the Wi-Fi network to be used, it should be among those with the strongest signal. Above the selected network is playteck. Then click on the Activate button. A pop-up dialog box will be displayed which will ask for the password of the Wi-Fi access point.

Orange Pi Zero + Armbian Setup

Once the OK button is pressed, the utility will attempt to connect to the Wi-Fi network. Assuming the correct password is given, the connection should be completed and then the list of networks will be shown again, but there should be a star beside the selected Wi-Fi network indicating that the connection to it has been established. Back out of the utility. Here is a verification that both network interfaces are operating.

Updating

The initial boot and configuration of the Orange Pi Zero are done with
the serial connection as described before. It could be done with an SSH session over a wired Ethernet connection. I connected a USB to
serial adapter to the header on the Opiz, opened a serial connection using
screen and powered up the Opiz with the microSD card in its
reader of course.

Use the cursor keys to highlight the name of the local Wi-Fi network,
in this case MY_SSID, then press the key to enter the password.

Check that the wireless interface is up. This is a good
time to update all packages.

On January 30, 2019, a total of 22 packages were updated which require
downloading 35.4MB from the archives.

As can be seen below, avahi (zero configuration) is not
installed, so I chose to install it.

Now there remains to shut down the Orange Pi Zero in an
orderly fashion so as to be able to resize the partition and
copy the image on the desktop computer.

With the Orange Pi Zero, it is easy to spot when everything is
stopped; the green LED above the microSD card goes off.

Save the Modified OS Image

Insert the modified microSD card into a reader connected to a box and start . The
latter is not installed by default on so I
used the software library to install. After the utility has scanned all the
storage drives connected to the computer, which can take some time, select
the microSD card containing the modified Armbian image. It was
/dev/sde on my machine and very easy to find as all the other
drives were much bigger than it.

Orange Pi Zero + Armbian Setup

Right click on its ext4 partition, the only partition,
and select unmount in the menu if you see a keys icon to the right of the
partition. Gparted will again read the information, and the keys icon will no
longer be visible. Select the ext4 partition again, and click on the resize
icon which is the orange arrow pointing right. The Partition/Resize Move
menu selection could be used instead.

Orange Pi Zero + Armbian Setup

I chose to set the partition size to 2044 MiB. Given that there was
4 MiB not allocated ahead of the partition, that made for an image size
of 2 GiB on the dot with 826.73 MiB free.

Orange Pi Zero + Armbian Setup

Click on apply button (with the green check icon) and let Gparted do its
thing. All that remains is to copy the first 2 GiB from the microSD card into an
image file. This is easily done with the dd utility. The
partition should not be mounted, but if it is then un mount it as shown below
before saving it.

Update Armbian

I have updated and upgraded

Be aware that this last step can take a considerable amount of time.

Changing the Host Name

If there will be more than on Rock Pi S on the LAN it will be preferable to change the host name. This is especially true if running avahi-daemon. Or one may just prefer a memorable name. Changing the host name can be done with nmtui or with the hostnamectl
utility can be used.

No matter which method is used, I find that the hosts file is not updated and that can cause problems. So after changing the hostname by which ever method desired, edit the file.

Then make sure that the locahost IP refers to the new host name and not to rockpis:

127.0.0.1 localhost
127.0.1.1 nauty
::1 localhost rockpi-s ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

System Update

To finish the setup off, I ran apt get update and upgrade to get the pi up-to-date:

Updating and Upgrading the OS

Before upgrading the operating system, it seemed best to set the time zone. I am situated in the Atlantic (Canada) time zone where the biggest city is Halifax. I first made sure that it was in the database before using it.

Let’s verify that the update/upgrade command brought everything up to date.

While upgrading, I was asked if the content of /etc/issue /etc/issue.net should be changed or not. I let issue be updated and left issue.net unchanged.

Last thing to do while logged in as root: enable the avahi-daemon to make it easy to find the board after reboots should the DHCP server give it a different IP address.

I edited the avahi configuration file in order to enable mDns advertising of the board as a workstation.

All that is required is to change the

Shutdown the Rock Pi S, and then open a session using its local host name instead of its IP address.

Wait until the board is obviously shutdown and then press on the reset button which is the one nearest the USB-C connector. After a while, the board will advertise itself and it is possible to open a session, confirming that the avahi service is working properly.

Finally here are more details about the information shown in the login screen.

Note how the logs are created in a ram disk, which reduces SD card wear but which means that they do not survive a reboot.

Network Configuration

Given my intent to use the Rock Pi S as a server (as an host), it makes more sense to setup a static IP address instead of relying on mDNS to find the machine. I also want to be able to use a Wi-Fi connection to the LAN instead of a wired one, and it should have a fixed IP address also. So here is a procedure that achieves these goals.

Contents

The Orange Pi Zero (now OPiZ), from Shenzhen Xunlong
Software CO., Limited is a very small single-board computer that
nevertheless has a four-core processor. In my opinion, its capabilities place it
between the Raspberry Pi Zero W (ireless) and the Raspberry Pi 3.

There is a slightly cheaper version with only 256MB of memory. There is
also an expansion card adding two USB outputs, a microphone, an infrared
receiver and an audio/video output. I bought Set 6 which adds a
small case that can accommodate the OPiZ and the expansion card. It all cost
just under $ 25 CDN including shipping costs.

Orange Pi Zero + Armbian Setup

A 4GB or greater micro SD card is also needed. I used a 16 GB Verbatim
class 10 card. Finally, a 5V power supply with a microUSB cable is necessary.

Дополнительно:  Mysql password root reset windows password

The OPiZ is fussy about its power supply. It refused to work with a
power supply (1A at 5V) used with Raspberry Pis, smart phones, tablets, etc.
In contrast an old power supply for Nexus 7 (1.3A at 5.2V) bought used and a
generic power supply (1A at 5V) worked without problem.

In addition, some USB cables can not be used. It seems that the microUSB
connector was too short when the OPiZ was in the case because the same
cables worked if the board was out of the case. This is something that I
have already observed with a Raspberry Pi 3 in a tranparent case with thick
plastic walls.

Network Setup

To avoid any further adventures finding the pi’s address, I changed the network configuration and assigned the pi a new static address instead of using .

Here is the new /etc/network/interfaces config:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address .168.1.136
netmask .255.255.0
gateway .168.1.1
dns-nameservers .8.8.8 .8.8.4

Debian documentation has further info about the static setup, here.

Then I rebooted the pi:

After few moments I could ping the pi again at its new address so I sshed back in:

Wi-Fi Connection

The configuration utility can be used to
start a WiFi connection.

Orange Pi Zero + Armbian Setup

Hit the space bar to confirm that you understand the risks associated
with using this utility with the highest privileges and then hit
to go to the main menu.

Orange Pi Zero + Armbian Setup

Select WiFi, then in the list of access points,

Orange Pi Zero + Armbian Setup

select your local WiFi network and enter the password.

Orange Pi Zero + Armbian Setup

Now verify that the wireless interface is active:

Selecting video output

On most boards you can select between HDMI and LCD output

HDMI output always has the highest priority. This means that if you plug an HDMI cable, the output always will be on the HDMI monitor, regardless of other settings.

olinuxino monitor list

Supported video outputs:
—————————————-
LCD-OLinuXino — Video outout to the LCD connector with AUTO detect function
LCD-OLinuXino-4.3TS — Video output to LCD-OLinuXino-4.3TS
LCD-OLinuXino-7 — Video output to LCD-OLinuXino-7
LCD-OLinuXino-5 — Video output to LCD-OLinuXino-5
LCD-OLinuXino-10 — Video output to LCD-OLinuXino-10

olinuxino monitor set LCD-OLinuXino-7

Observations

I remain enthusiastic about this small computer despite some problems. I am
not convinced that the temperature of the microprocessor is a real problem.
However, there may be overheating in the small housing. If the expansion
card is used, it becomes difficult to use a heat sink of sufficient mass
given the limited space between the two cards.

I already mentioned the difficulties I had with the Allwinnner Wi-Fi
module, the XR819. The module is new, the drivers are not necessarily stable. My
first impression is that the Wi-Fi connection is not reliable enough for a
home automation system. At a minimum, a watchdog should be provided, which
would restart the module when necessary.

I will also have to look at other operating systems. Among others, there
is the Debian version of Armbian already mentioned and a clean version of
Debian Jessie offered by dietpi. Knowing a little better Debian because of
Raspbian used on the Raspberry Pi, I may be able to run the network
connections reliably.

Instead of replacing the Raspberry Pi, the OPiZ could be a complement. A
page intrigues me How to Setup an Orange Pi Zero DIY Smart Speaker with
Google Assistant SDK. I’m looking forward to trying to replicate this project
that could be part of a home automation system.

Locale Configuration

I noticed today (July 12 2020) that a locale configuration issue remained after a system update and upgrade. While the locale was en_US.UTF-8, it was impossible to enter Unicode points such as ‘é’ or ‘°’ in the nano editor. Indeed, the Bash command line would not accept these non-ASCII characters. This problem was described in the Armbian Forum in April of 2019 and a simple solution was provided. Edit the /etc/environment file.

If it contains the line

or the line

remove it. Unicode (UTF-8) will be fully supported in new sessions from then on.

The original version of this post dates from October 2017 and the installed system was then Armbian 5.30 with the 3.4.113-sun8i kernel based on Ubuntu 16.04.2 LTS. I am not sure if the problem described above existed in that version. Note that jeanrhum who raised the problem in the forum said that the problem was not present in Armbian Strech 5.75 but appeared in version 5.77. I can confirm that the locale configuration problem had to be resolved as explained above in Armbian 5.90 based on Debian Stretch with the 4.19.62-sunxi Linux kernel.

Static IP Addresses

The home automation program contains a
web server that is accessed with a web browser such as , , or . This means that the web server must be at a fixed IP address.
However, by default, the Orange Pi Zero uses DHCP to obtain a variable IP
address from a DHCP server on the local network.

This will require changes to the network configuration.
It also means that a decision must be made as to which interface will be
used. The OPiZ contains two network interfaces: a wired Ethernet link (Cat5
or Cat6 cable with RJ45 connectors already in use) and a wireless WiFi
connection. The wireless interface is obviously more flexible, because it
allows me to place the single board computer almost anywhere.

Typically, there are two ways to assign a static IP address. You can
change the network configuration of the OPiZ or you can change the settings
of the DHCP server so that it always assigns the same address to
the network interface of the OPiZ. Previously I used both approaches
simultaneously (suspenders and belt to be safe!). But if the limit on the
number of DHCP reservations in the router is reached then there is no other
choice, the network settings of the OPiZ must be changed.

Orange Pi Zero + Armbian Setup

Orange Pi Zero + Armbian Setup

Since the connection with the OPiZ was wired (Ethernet), I started by
editing the Wi-Fi connection.

Orange Pi Zero + Armbian Setup

Orange Pi Zero + Armbian Setup

Unfortunately, it seems that the WiFi connection will only be
established if the OPiZ is connected by Ethernet cable to the local network.
However, if we return the IPv4 configuration of eth0 to
automatic then it becomes possible to open a ssh
session via WiFi without a concurrent Ethernet connection. That’s a little
disconcerting. This is the first time I use so it may well be that I made a mistake. The definitions
of the interfaces are located in the folder /etc/NetworkManager/
system-connections/. I will examine the files it contains and the whole
question later.

Finally, I used nmtui to change the name of the host that is
now domopiz.

Where to get the Armbian images

All official Armbian-based images are available at this FTP location, refer to the README.txt file inside if you are not sure what to download:

You can download these images either directly from the FTP.

Updating via USB

You can write the new u-boot to MMC, eMMC, SPI Flash or NAND (not fully supported) using DFU
protocol.

Boot the board and stop at u-boot console. Connect USB-mini cable to a host PC.

Update SPI flash

Check the available partitions with:

Activate DFU protocol with:

Next, on the host PC run:

Update u-boot binary with:

dfu-util -D spl/u-boot-spl.bin -a SPI.u-boot

Update SD/eMMC card

Stop loading in the u-boot. To check available MMC devices run:

If the board is booted from SD card and you also have eMMC, the output will be:

Connect USB-mini cable enter:

ums 0 mmc 0

ums 0 mmc 1

New mass storage device will show-up on the host computer. To write u-boot use:

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX seek=16 conv=sync

where /dev/sdX should be replaced with the new device, /dev/sdb, /dev/sdc, etc.

Static IP for the Ethernet Interface

The interactive utility nmtui and the command line utility nmcli can be used to control the network management service NetworkManager. All are installed together in the same package.

I will use nmtui to edit the default wired (Ethernet) interface configuration.

Orange Pi Zero + Armbian Setup

Change the IPv4 CONFIGURATION from Automatic to Manual and then press on the Show button to the right to see the details.

Orange Pi Zero + Armbian Setup

Enter the desired static IP address, the IP address of the gateway (my LAN router) and the desired DNS servers. Below I show the servers, but there are others that may be preferable.

Orange Pi Zero + Armbian Setup

There is no need for IPv6 on my simple LAN so I set the IPv6 CONFIGURATION to Disabled, but there is no harm in leaving it to the default Automatic. Finally, click on the OK at the bottom.

When back into the start screen of the utility, select Quit and click on OK or press the Enter key.

So the desired result was obtained: the Rock Pi S has a fixed IP address. But don’t think that is all there is to setting up a network inteface.

Card Preparation

I used card for the Armbian installation.

In a terminal, I:

7z e Debian_jessie_default.7z

rm sha256sum.sha armbian.txt.asc armbian.txt
rm Armbian_5.24_Orangepizero_Debian_jessie_3.4.113.img.asc

sudo dd 4M Armbian_5.24_Orangepizero_Debian_jessie_3.4.113.img /dev/mmcblk0

Installing Domoticz

As the download page explains, a
one-line script installs the program.

There is a little more to do obviously. Some questions need to be
answered, but the default answers are acceptable:

This is the end of the installation:

Start a web browser on your desktop and connect to the server site on the Raspberry Pi at
http://192.168.1.31:8080. There will not be much to see; a black
screen for the most part, since nothing is installed yet. At least that confirms
that the software is installed correctly.

Table of contents

The manufacturer’s website dedicated to the Orange Pi Zero is
the obvious starting point when looking for documentation about this
single-board-computer.

Many have videos on YouTube or sites with information that may be
useful. I subscribed to MickMake who tested the OPiZ Orange Pi Zero:
Better than the Raspberry Pi Zero? // Review. Perhaps it was because of this
video that the idea of buying OPiZ sprouted in my mind. The video is almost a
year old and I think some of the issues listed (about SPI for example) seem to be
resolved if we can trust Kaspars Dambis’s video, Display for Orange
Pi Zero. The video Orange Pi Zero Setup and Setting up of Orange Pi Zero using an Armbian/Debian Jessie
distro by Brian Greul have proved to be useful when it came to the TV
output. I also appreciated two videos by Richard Hughes,
Orange’s Pi Zero Review accessories & comparison
and Orange Pi zero update.

Finally, let us mention that according to we can do almost what we want with the OPiZ because it is
«open source». Indeed, we can find the schematic of the board.

Selecting bootlog console

You can select the bootlog to be displayed on HDMI/LCD or on the debug serial port.
This is done via armbianEnv.txt file.

Open the file:

For bootlog on the serial port use:

For bootlog on HDMI/LCD console:

Save the file and reboot the board.

Оцените статью
Master Hi-technology
Добавить комментарий