NanoPi M1 Plus

The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.

Board description

The NanoPi M1 Plus is designed and developed by FriendlyElec for professionals, enterprise users, makers and hobbyists. It is only two thirds the size of a Raspberry Pi.

The NanoPi M1 Plus uses the Allwinner H3 Soc. It integrates Gbps Ethernet, IR receiver, video/audio output, WiFi & Bluetooth, onboard microphone and supports DVP/Camera/HDMI and CVBS. It has a serial debug port. Its GPIO pins are compatible with those of a Raspberry Pi.

URL: https://www.friendlyarm.com
Wiki: http://wiki.friendlyarm.com/wiki/index.php/NanoPi_M1_Plus

Test results

The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other Yocto Project releases:

Yocto Project Build Runtime
sumo (2.5) :test_works: :test_works:

Build Means that the Yocto Project build using this Mender integration completes without errors and outputs images.
Runtime Means that Mender has been verified to work on the board. For U-Boot-based boards, the integration checklist has been verified.

Getting started

Prerequisites

  • A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
    • NOTE. Instructions depend on which Yocto version you intend to use.
  • Google repo tool installed and in your PATH .

Configuring the build

Setup Yocto environment

Set the Yocto Project branch you are building for:

# set to your branch, make sure it is supported (see table above)
export BRANCH="sumo" 

Create a directory for your mender-nanopi setup to live in and clone the
meta information.

mkdir mender-nanopi && cd mender-nanopi

Initialize repo manifest:

repo init -u https://github.com/mendersoftware/meta-mender-community \
           -m meta-mender-sunxi/scripts/manifest-sunxi.xml \
           -b ${BRANCH}

Fetch layers in manifest:

repo sync

Setup build environment

Initialize the build environment:

source setup-environment sunxi

Configure Mender server URL (optional)

This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in Standalone deployments, due to lack of server configuration.

You can edit the conf/local.conf file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. There should already be a commented section in the generated conf/local.conf file and you can simply uncomment the relevant configuration options and assign appropriate values to them.

Build for Hosted Mender:

# To get your tenant token:
#    - log in to https://hosted.mender.io
#    - click your email at the top right and then "My organization"
#    - press the "COPY TO CLIPBOARD"
#    - assign content of clipboard to MENDER_TENANT_TOKEN
#
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"

Building the image

You can now proceed with building an image:

MACHINE=nanopi-m1-plus bitbake core-image-base

Replace core-image-base with your desired image target.

Using the build output

After a successful build, the images and build artifacts are:

  • tmp/deploy/images/nanopi-m1-plus/core-image-base-nanopi-m1-plus.sdimg
  • tmp/deploy/images/nanopi-m1-plus/core-image-base-nanopi-m1-plus.mender

The disk image (with .sdimg suffix) is used to provision the device storage for devices without Mender running already. Please proceed to the official documentation on provisioning a new device for steps to do this.

On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the Mender Artifact files, which have .mender suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client standalone mode.

eMMC

The default settings assume that you will be booting using an uSD card. To prepare an image that can be written to the on-board eMMC, replace the following in your local.conf

MENDER_STORAGE_DEVICE_nanopi-m1-plus = "/dev/mmcblk1"
MENDER_UBOOT_STORAGE_DEVICE_nanopi-m1-plus = "0"

with

MENDER_STORAGE_DEVICE_nanopi-m1-plus = "/dev/mmcblk3"
MENDER_UBOOT_STORAGE_DEVICE_nanopi-m1-plus = "1"

References

  • The Mender integration layer for NanoPi M1 Plus and template files can be found in meta-mender-community.

Known issues

  • NanoPi M1 Plus is actually not yet supported in the official upstream layer (meta-sunxi) and we carry two patches [1] [2] in meta-mender-community to be able to use it. Help wanted with up-streaming the NanoPi M1 Plus support to meta-sunxi.

If this post was useful to you, please press like, or leave a thank you note to the contributor who put valuable time into this and made it available to you. It will be much appreciated!

@mirzak I want to build a custom image for NanoPi duo.
I think it’s not officially available, is there any way to make it work??

If there is a working Yocto BSP for that platform then yes it can be made to work but you may need to do some of the integration steps.

Drew

1 Like

I tried modifying the local.conf file and I got the image, but on booting it few files are missing from root folder which are supposed to be there also wifi is not getting connected.
It’s because there is no support for nanopi duo2 yet.
I tried it just to get an overview and verify if it can work through any modifications, but not yet I guess

That may be a result of the image you are using. If you try core-image-full-cmdline you may get different results. Things like wifi firmware blobs are not installed by default on all standard Yocto images.