Skip to content
Snippets Groups Projects
Commit fdace385 authored by Eilís Ní Fhlannagáin's avatar Eilís Ní Fhlannagáin
Browse files

Initial commit to kirkstone port


This is taken from the old meta-oniro-blueprints layer for the new
blueprints layout

Signed-off-by: default avatarEilís Ní Fhlannagáin <pidge@pidge.org>
parents
Branches main
No related tags found
No related merge requests found
Showing
with 1414 additions and 0 deletions
assets/vending-machine-matrix.jpg

2.72 MiB

SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
assets/vending-machine-rpi-bom.jpg

3.4 MiB

SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
assets/vending-machine-rpi-hw-setup.jpg

3.36 MiB

SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
assets/vending-machine-rpi-i2c.png

34.4 KiB

SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
conf.py 0 → 100644
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# Workaround to install and execute git-lfs on Read the Docs
# See: https://github.com/readthedocs/readthedocs.org/issues/1846
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd and not os.path.exists('./git-lfs'):
def system_check_fail(cmd):
e = os.system(cmd)
if e != 0:
raise Exception('Failed cmd: {}.'.format(cmd))
lfs_version = 'v3.0.2'
lfs_arch = 'amd64'
system_check_fail('wget -nc https://github.com/git-lfs/git-lfs/releases/download/{v}/git-lfs-linux-{a}-{v}.tar.gz'.format(v = lfs_version, a = lfs_arch))
if not os.path.exists('git-lfs-{}'.format(lfs_version)):
os.mkdir('git-lfs-{}'.format(lfs_version))
system_check_fail('tar -C git-lfs-{v} -xvzf git-lfs-linux-{a}-{v}.tar.gz'.format(v = lfs_version, a = lfs_arch))
system_check_fail('./git-lfs-{}/git-lfs install'.format(lfs_version))
system_check_fail('./git-lfs-{}/git-lfs fetch'.format(lfs_version))
system_check_fail('./git-lfs-{}/git-lfs checkout'.format(lfs_version))
# -- Project information -----------------------------------------------------
project = 'Oniro Project Blueprints'
copyright = '2021'
author = 'Oniro Project'
version = 'dunfell'
release = version
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinxcontrib.plantuml']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']
html_logo = "ONIRO.svg"
html_theme_options = {
'logo_only': True,
'display_version': False,
}
# The file custom.css added to adjust the logo width.
html_css_files = [
'css/custom.css',
]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_show_sourcelink = False
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. |main_project_name| replace:: Oniro Project
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ./definitions.rst
##################
DoorLock Blueprint
##################
.. contents::
:depth: 4
********
Overview
********
The DoorLock Blueprint provides support for building a PoC smart door lock to demonstrate:
* Operating several types of locks
* Keypad input to operate the lock locally
* Secure wireless communication to operate the lock locally (TBD)
* Secure communication with the lock remotely (TBD)
* Secure OTA (TBD)
************
The Hardware
************
Needed components
=================
Common to all variants
----------------------
* A breadboard (e.g. http://adafru.it/239)
* Some breadboarding wires (e.g. http://adafru.it/153)
* Arduino Nano 33 BLE Sense board with headers (e.g. https://store.arduino.cc/arduino-nano-33-ble-sense-with-headers)
Lock Variant 1: Using a lock-style solenoid
-------------------------------------------
* A lock-style solenoid (e.g. http://adafru.it/1512)
* DC barrel jack (e.g. http://adafru.it/373)
* Power supply matching the DC barrel jack (e.g. http://adafru.it/1448)
* Possibly plug adapter for the power supply (e.g. http://adafru.it/990)
* DRV8871 motor driver breakout (e.g. http://adafru.it/3190)
* Solder iron, some solder
Lock Variant 2: Using a rotating motor
--------------------------------------
* L9110 H-Bridge (e.g. http://adafru.it/4489)
* Rotating door lock motor (e.g. http://adafru.it/3881)
* Solder iron, some solder
Control Variant 1: Number keypad
--------------------------------
* Number keypad (e.g. http://adafru.it/419)
Control Variant 2: Touch sensors (TBD)
--------------------------------------
* Touch sensors (e.g. http://adafru.it/4830)
* STEMMA QT/QWIIC connector (e.g. http://adafru.it/4209)
Control Variant 3: Fingerprint sensor (TBD)
-------------------------------------------
* Fingerprint sensor (e.g. http://adafru.it/751)
Wiring up the breadboard
========================
There are multiple ways to wire the breadboard. Locations of various components don't matter as long as the connections between the components are correct. We'll give an example that will get you going even if you don't know anything about electronics.
When talking about holes on the breadboard, we're assuming the breadboard is labeled like http://adafru.it/239 - A to J is left to right, 1 to 63 is top to bottom. Some breadboards are labeled differently.
.. image:: assets/doorlock/000_empty_breadboard.jpg
Common to all variants
----------------------
#.
Insert the Arduino Nano 33 BLE Sense into the breadboard, USB port up, pin 1 (top left) in hole C1.
.. image:: assets/doorlock/001_arduino.jpg
#.
Connect the Arduino's power output to the breadboard: +3.3V (pin 2, hole B2) to the left hand + strip (hole +1 on the left), GND (pin 14, hole B14) to the left hand - strip (hole -1 on the left). It is customary (but not required) to use a red wire for + and a black wire for -.
.. image:: assets/doorlock/002_power.jpg
#.
Connect the left hand + strip to the right hand + strip (hole +61 on the left to +61 on the right, -61 on the left to -61 on the right). Again it is customary to use a red wire for + and a black wire for -.
.. image:: assets/doorlock/003_sides.jpg
Lock Variant 1: Using a lock-style solenoid
-------------------------------------------
#.
Add the DC power barrel to the breadboard. Pin 1 (the one on the opposite side of the plug) goes to hole H60, pin 2 (under the plug) to H63, pin 3 (on the side) to J61. Make sure the power supply is set up for center positive.
.. image:: assets/doorlock/004_barrel.jpg
#.
Prepare the DRV8871 breakout board. This requires some soldering.
Cut the header strip to 4 pins (usually the board comes with a 6 pin strip).
.. image:: assets/doorlock/005_drv_cutstrip.jpg
Solder the 4 pins (short side up, inserted from the bottom side) to the 4 holes in the breakout board labeled "IN2", "IN1", "UM" and "GND".
Insert the 2 terminal blocks from the top and solder them to the board from the bottom.
.. image:: assets/doorlock/006_prepare_drv8871.jpg
More detailed instructions on preparing the DRV8871 breakout board, including some extra pictures, can be found at https://cdn-learn.adafruit.com/downloads/pdf/adafruit-drv8871-brushed-dc-motor-driver-breakout.pdf
#.
Connect the DRV8871 breakout board. The terminal blocks go to the right, the pins you soldered on go to holes E25, E26, E27 and E28.
.. image:: assets/doorlock/007_connect_drv8871.jpg
#.
Connect the DC barrel jack to the DRV8871 board. Pin 1 (hole F60) to the VM pin on the DRV8871 board (hole C27), and pin 2 (hole F63) to the GND pin on the DRV8871 board (hole C28).
.. image:: assets/doorlock/008_power_drv8871.jpg
#.
Connect the GND pins of the barrel jack to the GND pin of the board to have a common GND level (e.g. hole G63 or B28 to - terminal)
.. image:: assets/doorlock/009_gnd_gnd.jpg
#.
Connect the DRV8871's IN1 port to the Arduino's digital pin D6: Hole B26 to I7.
.. image:: assets/doorlock/010_drv8871_control1.jpg
#.
Connect the DRV8871's IN2 port to the Arduino's digital pin D7: Hole B25 to I6.
.. image:: assets/doorlock/010_drv8871_control2.jpg
#.
Connect the lock-style solenoid to the DRV8871's MOTOR terminal block (the one facing the Arduino). The wire facing the Arduino board goes to the blue wire on the solenoid, the wire closer to the power barrel goes to the red wire on the solenoid.
.. image:: assets/doorlock/011_solenoid.jpg
#.
Note that the Arduino board is not connected to the barrel power plug. You need to power the lock with the barrel power plug and the Arduino board with its USB port, at the same time.
Lock Variant 2: Using a rotating motor
--------------------------------------
#.
Connect the L9110H driver to the breadboard. The side with the notch faces the Arduino board, pins go into holes E22 to E25 and F22 to F25.
#.
Connect the power supply to the L9110H: The VCC pins (pins 2 and 3 on the L9110H, holes D23 and D24) must be connected to the + terminal (e.g. hole D23 to +23 and D24 to +24). The GND pins (pins 5 and 8 on the L9110H, holes G22 and G25) must be connected to the - terminal (e.g. hole G22 to -22 and G25 to -25).
#.
Connect the L9110H's control ports (IA and IB, pins 6 and 7) to the Arduino's digital outputs D6 and D7 (hole H23 to J6, H24 to J7).
.. image:: assets/doorlock/rotating_motor_L9110H.jpg
#.
Add breadboard friendly connectors to the motor's wires, for example by soldering breadboarding wires to the motor's wires.
.. image:: assets/doorlock/rotating_motor_solder.jpg
#.
Connect the L9110H's output pins (OA and OB, pins 1 and 4) to the lock motor. Connect the black wire to hole A22, and the red wire to hole A25.
.. image:: assets/doorlock/rotating_motor_completed.jpg
Control Variant 1: Number keypad
--------------------------------
#.
Connect the 7 pins of the keypad to the Arduino's digital pins 2, 3, 4, 5, 8, 9 and 10. From left to right:
* Pin 1 to D9 (hole H4)
* Pin 2 to D2 (hole H11)
* Pin 3 to D8 (hole H5)
* Pin 4 to D5 (hole H8)
* Pin 5 to D10 (hole H3)
* Pin 6 to D4 (hole H9)
* Pin 7 to D3 (hole H10)
.. image:: assets/doorlock/012_complete.jpg
Wiring diagram using the lock solenoid and the number keypad
------------------------------------------------------------
#.
A wiring diagram of the doorlock blueprint board, with the solenoid lock and the number keypad connected:
.. image:: assets/doorlock/doorlock_drv8871_fritzing.png
The wiring diagram was made with `Fritzing <https://fritzing.org/>`_. The source file can be found `here <assets/doorlock/doorlock_solenoid.fzz>`_.
************
The Software
************
Get sources
===========
#.
Get |main_project_name| sources as described in the :ref:`blueprints workspace documentation <Workspace>`.
#.
If you already have sources cloned, update them to the most recent revision
.. code-block:: bash
user@pc:~/oniroproject$ repo sync -d
Also, update the `meta-oniro-blueprint` git checkout.
Build the software
==================
#. To build the image for this blueprint, you need to set the corresponding distro in the conf/local.conf file or on the command line as seen below:
.. code-block:: bash
$ TEMPLATECONF=../oniro/flavours/zephyr . ./oe-core/oe-init-build-env build-oniro-doorlock
#. Add the meta-homeassistant & meta-oniro-blueprints layers to the build.
This is only needed once after initializing a new build.
.. code-block:: bash
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-homeassistant
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-oniro-blueprints
#. Start building the image
.. code-block:: bash
$ DISTRO="oniro-zephyr-blueprint-doorlock" MACHINE=arduino-nano-33-ble bitbake zephyr-blueprint-doorlock
Flash the software when built with bitbake
==========================================
#. After building the image, prepare the board by connecting the board's USB port to your computer and putting the board into flashing mode by double-pressing the reset button.
#. Use `BOSSA <https://github.com/arduino/BOSSA>`_ to flash the image to the board. You can build BOSSA from source (use the nrf branch), or you can try a prebuilt version of BOSSA for many Linux distributions in `The Oniro Project OBS repository <https://build.opensuse.org/repositories/home:oniroproject:tools>`_. If you're using OpenMandriva, you can ``dnf install bossa`` from the distribution's repositories.
#. You also need the python serial module (which may or may not be installed in your distribution by default). Most if not all Linux distributions have a package for this module, typically called python-serial or python3-serial. Use the distribution's package manager to install this package.
#. Flash the door lock software to the board:
.. code-block:: bash
$ DISTRO="oniro-zephyr-blueprint-doorlock" MACHINE=arduino-nano-33-ble bitbake zephyr-blueprint-doorlock -c flash_usb
Alternative way of building the software (using west)
=====================================================
#. You can also use Zephyr's build system to build the image, e.g. to try working with a git snapshot of the Zephyr OS. To do that (assuming you have the Zephyr toolset, consisting of west and the Zephyr SDK, installed):
.. code-block:: bash
$ mkdir doorlock
$ cd doorlock
$ west init --mr v2.7.0
$ west update
$ git clone https://booting.oniroproject.org/distro/blueprints/doorlock/doorlock-zephyr
$ west build -p auto -b arduino_nano_33_ble doorlock-zephyr
Flashing the software when built with west
==========================================
#. After building the image, prepare the board by connecting the board's USB port to your computer and putting the board into flashing mode by double-pressing the reset button.
#. Use `BOSSA <https://github.com/arduino/BOSSA>`_ to flash the image to the board. You can build BOSSA from source (use the nrf branch), or you can try a prebuilt version of BOSSA for many Linux distributions in `The Oniro Project OBS repository <https://build.opensuse.org/repositories/home:oniroproject:tools>`_. If you're using OpenMandriva, you can ``dnf install bossa`` from the distribution's repositories.
#. If BOSSA is not provided for your distribution, use:
.. code-block:: bash
$ git clone -b nrf https://github.com/arduino/BOSSA
$ cd BOSSA
$ make bossac
$ sudo cp bin/bossac /usr/local/bin # (or any other place in your PATH)
#. Use west to flash the software
.. code-block:: bash
$ west flash
Resources
=========
.. _ResourcesDL:
- See `Door lock's requirement <https://git.ostc-eu.org/OSTC/requirements/-/issues/12>`_
*******************
Using the door lock
*******************
Initial setup
=============
After initial flashing, you get to select the pin that will unlock the lock.
The red LED on the Arduino board flashes quickly while waiting for your new pin.
Setting a pin
=============
You can use any combination of keys, including pressing multiple keys simultaneously.
Enter the pin you would like to use, and finish by holding the "*" key and pressing "#".
For example, if you want to use pin 1 23 4 (where 3 has to be pressed while 2 is still being held down), press and release 1, press and hold 2, press 3, release 2 and 3, press and release 4, press and hold * , press #, release * and #.
Driving the lock
================
Simply enter your pin using the matrix keypad to unlock the lock.
Changing the pin
================
Within 10 seconds of entering your pin to unlock the lock, hold the "*" key and press "#".
At this point, the red LED on the board will flash quickly, and you can enter a new pin
as described in "Setting a pin".
Forgotten pin
=============
There is no "master key". If you've forgotten your pin, flash the separate `factory reset app <https://booting.oniroproject.org/distro/blueprints/doorlock/doorlock-factoryreset>`_, boot it, then reflash the doorlock app.
Build the factory reset firmware
================================
#. Make sure you have the Zephyr toolset, consisting of west and the Zephyr SDK, installed, then run:
.. code-block:: bash
$ mkdir doorlock-factoryreset
$ cd doorlock-factoryreset
$ west init --mr v2.7.0
$ west update
$ git clone https://booting.oniroproject.org/distro/blueprints/doorlock/doorlock-factoryreset
$ west build -p auto -b arduino_nano_33_ble doorlock-factoryreset
Flashing the factory reset firmware
===================================
#. After building the image, prepare the board by connecting the board's USB port to your computer and putting the board into flashing mode by double-pressing the reset button.
#. Use `BOSSA <https://github.com/arduino/BOSSA>`_ to flash the image to the board. You can build BOSSA from source (use the nrf branch), or you can try a prebuilt version of BOSSA for many Linux distributions in `The Oniro Project OBS repository <https://build.opensuse.org/repositories/home:oniroproject:tools>`_. If you're using OpenMandriva, you can ``dnf install bossa`` from the distribution's repositories.
#. If BOSSA is not provided for your distribution, use:
.. code-block:: bash
$ git clone -b nrf https://github.com/arduino/BOSSA
$ cd BOSSA
$ make bossac
$ sudo cp bin/bossac /usr/local/bin # (or any other place in your PATH)
#. Use west to flash the software
.. code-block:: bash
$ west flash
faq.rst 0 → 100644
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ./definitions.rst
.. _BlueprintsFAQ:
FAQ
###
Why does my build fail with random error?
*****************************************
If the `bitbake` (build) command fails, most of the time it is due to an
outdated set of sources. Make sure you update both your `repo` (`repo sync`)
workspace and the all the other layers detailed in the :ref:`blueprints
workspace documentation <Workspace>`.
If updating the sources doesn't fix the issue in an existing build, create a
new build environment and retry. `sstate` and `downloads` can be shared or
migrated from the old build if wanted.
My build fails with `DISTRO 'YYY' not found.`. What do I do?
************************************************************
Builds require the path of the `meta-oniro-blueprints` checkout in
`bblayers.conf`. This means that when a build is initialized, this layer needs
to be included in the build's configuration:
.. code-block:: bash
bitbake-layers add-layer $CHECKOUT_DIR/meta-oniro-blueprints
The general rule is, once you create a new blueprint build directory, make sure
you have cloned/updated and included all the layers mentioned in the
:ref:`blueprints workspace documentation <Workspace>`.
My build fails with `ERROR: Nothing PROVIDES 'YYY'`. What do I do?
******************************************************************
This most probably has the same roots as the one above: missed adding the
`meta-oniro-blueprints` layer path to build's configuration. Make sure you have
run the `bitbake-layers add-layer` commands advertised in the :ref:`blueprints
workspace documentation <Workspace>`.
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ./definitions.rst
|main_project_name| Blueprints Documentation
############################################
|main_project_name|
*******************
This documentation is part of the |main_project_name| documentation. You can
learn more about |main_project_name| by going to https://oniroproject.org. The
main project's documentation is available at https://docs.oniroproject.org.
.. note::
Oniro™ is a registered trademark of Eclipse Foundation.
Blueprints Overview
*******************
|main_project_name| integrates its various components into a representative use-case called a `Blueprint`. A blueprint shows off the OS capabilities and best practices in building software-based products.
To this end, blueprints are a way to distill real-world products into a ``minimum viable product`` to demonstrate how partners and users may adopt |main_project_name| securely in their own products.
What is a Blueprint?
--------------------
#. It shows off a key feature or two of the product it is trying to emulate.
#. It focuses on reproducing a representative user interaction for a use case.
.. note::
Examples include:
* A secure network link, e.g., a TLS connection to avoid transmitting plain-text data.
* Wireless communication, e.g., via Bluetooth, OpenThread or NFC.
* Keypad input, e.g. via touchscreen.
* Display, e.g., showing useful messages on a display.
* Autonomous communication between two devices over a wireless link.
#. It is implemented on the closest appropriate reference HW platform from |main_project_name|.
What a Blueprint Isn't?
-----------------------
#. It doesn't try to implement every feature of a contemporary product category in the market.
#. It isn't optimized for cost, size, or physical looks.
#. It doesn't try to replicate the physical form-factor of a contemporary product category. Do not expect to see everything hidden away in a pretty enclosure. Expect to see boards and wires connecting to peripherals.
Blueprints Workspace
********************
.. toctree::
:maxdepth: 1
workspace
faq
Blueprints
**********
This section details the available blueprints provided as part of the |main_project_name| environment.
.. toctree::
:maxdepth: 1
smart-panel
doorlock
keypad
transparent-gateway
vending-machine
Blueprint Hardware
******************
This section details some of the hardware modules that will be used to create a blueprint.
.. toctree::
:maxdepth: 3
peripherals/index
|main_project_name| Main Documentation
**************************************
.. toctree::
:maxdepth: 3
Oniro Project Documentation <https://docs.oniroproject.org>
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ./definitions.rst
KeyPad Blueprint
#####################
.. contents::
:depth: 4
.. attention::
The `TouchPannel` blueprint is still a work in progress (WIP). For more
information, see the :ref:`resources <Resources>` section.
Overview
********
The KeyPad Blueprint provides support for building a PoC smart touch panel that can be used in other smart devices to accept input and display status. Some features to demonstrate include:
#. Accepting input from a keypad
#. Accepting input from UI icons on a touch panel
#. Ability to send input data securely over the network
.. image:: assets/keypad-nRF52840.jpg
:alt: Keypad on nRF52840-DK
Hardware Setup - Bill of Materials
**********************************
The current version of keypad can be deployed to Nordic's nRF52840-DK
- 1 x `nRF52840-DK
<https://www.nordicsemi.com/Products/Development-hardware/nRF52840-DK>`_
- 1 x `2.8" TFT Touch Shield for Arduino w/Capacitive Touch
<https://www.adafruit.com/product/1947>`_
- 1 x Micro USB cable
Get sources
***********
Get or update the |main_project_name| sources as described in the
:ref:`blueprints workspace documentation <Workspace>`.
The quick steps are detailed as follows:
.. code-block:: bash
$ export CHECKOUT_DIR=~/oniroproject
$ mkdir -p "${CHECKOUT_DIR}" ; cd "$CHECKOUT_DIR"
$ # Download sources
$ repo init -u https://booting.oniroproject.org/distro/oniro -b dunfell
$ git clone https://booting.oniroproject.org/distro/meta-oniro-blueprints --branch dunfell --depth 1
$ git clone https://github.com/meta-homeassistant/meta-homeassistant --branch dunfell --depth 1
$ repo sync
$ # Configure environement and build directory for supported hardware
$ TEMPLATECONF=../oniro/flavours/zephyr . ./oe-core/oe-init-build-env build-oniro-zephyr
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-homeassistant
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-oniro-blueprints
$ export MACHINE=nrf52840dk-nrf52840
$ # Build firmware image
$ bitbake zephyr-blueprint-keypad
$ du -hs ./tmp-newlib/deploy/images/nrf52840dk-nrf52840/zephyr-blueprint-keypad.bin # 148K
Then plug the board to USB connector (the one near the battery), then it should be detected by Linux system:
.. code-block:: bash
$ sudo dmesg
[...] usb 2-1.7: Product: J-Link
[...] usb 2-1.7: Manufacturer: SEGGER
(...)
$ ls /dev/disk/by-id/usb-SEGGER_MSD_Volume_*
$ sudo mkdir /tmp/usb
$ sudo mount /dev/disk/by-id/usb-SEGGER_MSD_Volume_*-0\:0 /mnt/usb
$ sudo cp -v /tmp-newlib/deploy/images/nrf52840dk-nrf52840/zephyr-blueprint-keypad.bin /mnt/usb
Display should show the keypad on reset.
Resources
=========
.. _Resources:
- See `KeyPad's requirement <https://git.ostc-eu.org/OSTC/planning/blueprints/-/issues/1>`_
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ../definitions.rst
Peripherals used in implementing blueprints
###########################################
This section lists some of the peripherals proposed to be used (and supported) as part of |main_project_name| Blueprints.
Peripheral Categories
*********************
.. toctree::
:maxdepth: 2
io-devices/index
lock-devices/index
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ../../definitions.rst
Input/Output Peripherals used in blueprints
###########################################
This section lists some of the peripherals used for input and output used as part of |main_project_name| Blueprints.
.. toctree::
:maxdepth: 3
Touch-based input
*****************
Smart devices accept a variety of input, typically through different types of touch interfaces. Here are a few that are used to produce |main_project_name| Blueprints.
Capacitive Touch Sensor
-----------------------
A capacitive touch sensor is used in various use cases with many different touch finishes, including glass, acrylic, polyester films, etc. It supports multi-touch use cases but needs direct skin contact to work.
Raw Capacitive Touch Sensor
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- `Raw touch sensor<https://www.adafruit.com/product/4830>`
Glass Smart Switches
^^^^^^^^^^^^^^^^^^^^
For switches connected to a wifi network.
- `Sonoff <https://www.sonoff.in/product/sonoff-t3eu-tx-smart-wifi-black-wall-touch-switch-with-smart-home-edge-3-gang-433-rf-remote-control-works-with-alexa-ifttt/>`
Resistive Touch Sensor
----------------------
If a pressure-based touch experience is required (to prevent stray touches), or if it is a low-cost, single-touch application, a resistive touch sensor may be used. These sensors also work with gloves and styluses and are generally more rugged and more resistant to water, dust, and debris.
Matrix Keypad
-------------
Usecases such as PIN entry for payment or alarm system require a numeric keypad. Matrix 3x4 or 4x4 keypads are useful in such cases, with a generic gpio keypad driver able to read the input.
- `Adafruit <https://www.adafruit.com/product/419>`
- `Wider selection at Adafruit <https://learn.adafruit.com/matrix-keypad/featured_products>`
Finger-print sensor
-------------------
For authentication use cases, a fingerprint module might be required.
- `Adafruit fingerprint sensor <https://www.adafruit.com/product/751>`
Combined display and Touch panel
--------------------------------
For applications needing a custom UI, a touch panel might be used. These can be categorized into two:
Touch Panel (Lite)
^^^^^^^^^^^^^^^^^^
.. note::
Needs experimental verification with our boards
- `Adafruit 2.8" PiTFT for Arduino <https://www.adafruit.com/product/1947>`
- `Generic SPI display <https://www.buydisplay.com/2-8-inch-tft-touch-shield-for-arduino-w-capacitive-touch-screen-module>`
- `Monochrome 2.4" OLED Display with touch <https://www.winstar.com.tw/products/oled-module/oled-touch-display/weo012864j-ctp.html>`
Touch Panel (Rich)
^^^^^^^^^^^^^^^^^^
.. note::
Needs experimental verification with our boards
- `Adafruit 2.8" PiTFT for RPi <https://www.adafruit.com/product/1983>`
- `Generic SPI display <https://www.buydisplay.com/2-8-inch-tft-touch-shield-for-arduino-w-capacitive-touch-screen-module>`
- `Adafruit 7" touchscreen display for RPi with DSI interface <https://www.adafruit.com/product/2718>`
Display output
**************
Several devices have a display component to reflect the device's status, provide feedback to user input or show other useful information. Depending on the application, you might choose just a display or a display with a touch panel that allows input.
Display-only
------------
A simple SPI display might be used for applications only needing a display with no touch input.
.. note::
Needs experimental verification with our boards
- `Adafruit 2.0" 320x240 Color IPS TFT Display <https://www.adafruit.com/product/4311>`
Combined display and Touch panel
--------------------------------
See `Combined display and Touch panel above`
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ../../definitions.rst
Lock Peripherals used in blueprints
###################################
Smart devices might need keyless locking functionality, e.g., a vending machine, a post box, or a smart door lock. Here are a few that are used in |main_project_name| Blueprints.
.. toctree::
:maxdepth: 3
Solenoids
*********
Solenoids are electromagnets. When the coil is energized, it pulls the lock cylinder to unlock. In the non-energized (unpowered) state, the lock is engaged.
- `Adafruit Lock-style Solenoid - 12VDC <https://www.adafruit.com/product/1512>`
Solenoids with key and button backup
************************************
For applications where you want to be able to disengage the lock in the absense of electricity.
- `Sonoff <https://www.sonoff.in/product/electric-control-rim-lock/>`
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: CC-BY-4.0
sphinxcontrib_plantuml
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ./definitions.rst
Smart Panel Blueprint
#####################
.. contents::
:depth: 4
Overview
********
The Smart Panel Blueprint provides support for building a PoC for a home
automation system with components showing the capabilities of the build
infrastructure in leveraging different kernels for building an end to end
solution.
The setup is composed of an Avenger96 board acting as a gateway and running
HomeAssistant. The gateway also provides UI as a browser connected to the
localhost HomeAssistant server. The gateway is connected over Bluetooth to two
Nitrogen boards exposing sensors and/or actuator (e.g. controlled light source).
.. image:: assets/smart-home-blueprint-arch.png
.. uml::
title
<b>High level connection diagram
end title
node "Avenger96" #11AAFF {
[Linux]
}
node "Nitrogen #1" #116699 {
[Zephyr#1]
}
node "Nitrogen #2" #116699 {
[Zephyr#2]
}
[LED] #3BB300
[LCD] #3BB300
[MotionSensor] #3BB300
[HumidityTemperature] #3BB300
[Display]
[Linux] --> [Display] : HDMI
[Zephyr#1] --> Linux : BLE
[Zephyr#1] --> LCD : I2C
[Zephyr#1] <-- MotionSensor : I2C
[Zephyr#1] <-- HumidityTemperature : GPIO
[Zephyr#2] <-- Linux : BLE
[Zephyr#2] --> LED : GPIO
legend
|= Legend: |
|<back:#11AAFF>Avenger96:96Boards</back>|
|<back:#116699>Nitrogen:96Boards</back>|
|<back:#3BB300>Grove sensors</back>|
endlegend
[Human] --> [Display]
Bill of materials
*****************
IoT controller (Avenger96)
--------------------------
Equipment
^^^^^^^^^
* 1x 96Boards Avenger96
* 1x Power supply 12 V minimum 2 A,
* 1x microSD card at least 8 GB,
* 1x HDMI touch screen,
Cables and connectors
^^^^^^^^^^^^^^^^^^^^^
* 1x HDMI-HDMI.
* 1x microUSB-USB type A cable.
* 1x Ethernet cable.
IoT devices (Nitrogens)
-----------------------
Equipment
^^^^^^^^^
* 2x 96Boards Nitrogen,
* 2x Grove Mezzanine board,
* 1x Grove LED module,
* 1x Grove DHT11 temperature and humidity sensor,
* 1x Grove AK9753 human presence sensor,
* 1x Grove LCD RGB Backlight screen,
Cables and connectors
^^^^^^^^^^^^^^^^^^^^^
* 4x Grove connector cables,
* 2x microUSB cable.
Assembly
********
IoT controller
--------------
#. Connect the screen's display output with the board using HDMI cable.
#. Connect the screen's touch controller with the board using USB cable.
#. The board to a network with DHCP server configured using the Ethernet cable.
#. Do not insert the microSD card into the board's slot. It will be needed for
flashing.
#. Connect power supply to the power jack.
.. image:: assets/smarthome-blueprint-assembled.jpg
:alt: The whole assembled setup with labels
IoT devices
-----------
#. Connect Grove Mezzanine boards to both Nitrogen boards. One of them will act
as a light switching device, the other as sensors device.
#. Assemble the light switching device:
* Connect Grove LED module to GPIO IJ port on the Mezzanine board.
#. Assemble the sensors device:
* Connect Grove DHT11 module to GPIO GH port on the Mezzanine board,
* Connect Grove AK9753 module to GPIO KL port on the Mezzanine board,
* Connect Grove LCD module to I2C0 port on the Mezzanine board,
#. Connect Nitrogens to your computer with microUSB cables.
Get sources
***********
Get or update |main_project_name| sources as described in the :ref:`blueprints
workspace documentation <Workspace>`.
.. note::
Mind the `CHECKOUT_DIR` variable in the workspace documentation as you will
need them below.
Prepare IoT devices (Nitrogen/Zephyr flavour)
*********************************************
Build
-----
#.
Create build directory
.. code-block:: bash
$ TEMPLATECONF=../oniro/flavours/zephyr . ./oe-core/oe-init-build-env build-oniro-zephyr-96b-nitrogen
#.
Edit ``conf/local.conf``, and uncomment the following line:
.. code-block:: bash
#MACHINE ?= "96b-nitrogen"
#.
Add the `meta-oniro-blueprints` layer to the build. This is only needed once
after initializing a new build:
.. code-block:: bash
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-homeassistant
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-oniro-blueprints
#.
Build ``zephyr-blueprint-smarthome-sensors`` image using ``bitbake``,
with the following override:
.. code-block:: bash
$ DISTRO=oniro-zephyr-blueprint-dashboard bitbake zephyr-blueprint-smarthome-sensors
.. note::
* The build will configure the MAC address with sane defaults. If you
want a custom MAC address, you can prepend to the command above the
following:
BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SMART_HOME_SENSORS_MAC" SMART_HOME_SENSORS_MAC="<custom_mac_address>"
* The MAC address can have any value provided it starts with ``C0`` and
is unique in your environment.
#.
Make sure you have at least 3 GB of free space on the partition
where the build directory is located.
#.
Build ``zephyr-blueprint-smarthome-switch`` image using ``bitbake``,
with the following override:
* ``SMART_HOME_SWITCH_MAC`` set to MAC address of the IoT device.
**It must be different than the MAC address used in the previous step**.
.. code-block:: bash
$ DISTRO=oniro-zephyr-blueprint-dashboard bitbake zephyr-blueprint-smarthome-switch
.. note::
* The build will configure the MAC address with sane defaults. If you
want a custom MAC address, you can prepend to the command above the
following:
BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SMART_HOME_SWITCH_MAC" SMART_HOME_SWITCH_MAC="<custom_mac_address>"
* The MAC address can have any value provided it starts with ``C0`` and
is unique in your environment.
Flash
-----
#.
Connect 96Boards Nitrogen boards to your computer.
#.
Assuming both boards are connected simultaneously, retrieve their IDs
.. code-block:: bash
$ pyocd list
# Probe Unique ID
---------------------------------------------------
0 Arch BLE [nrf51] 9009022103BB2A02FE6545F3
1 Arch BLE [nrf51] 9009022103BB3A2DFE6555DC
If you do not have PyOCD in your system, follow the guide in the PyOCD section of the
`Nitrogen documentation <https://docs.oniroproject.org/en/latest/oniro/hardware-support/boards/96b-nitrogen.html#supportedboardnitrogenpyocd>`_.
#.
Flash the first board with ``zephyr-blueprint-smarthome-sensors`` image. Use the same
command you used for build, with the following changes:
* add ``-c flash_usb`` suffix,
* remove the MAC address override (it is only effective at build time),
* add board ID override in the form of:
``BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE PYOCD_FLASH_IDS" PYOCD_FLASH_IDS="<id>"``
.. code-block:: bash
$ BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE PYOCD_FLASH_IDS" \
PYOCD_FLASH_IDS="9009022103BB2A02FE6545F3" bitbake zephyr-blueprint-smarthome-sensors -c flash_usb
#.
Flash the other board with ``zephyr-blueprint-smarthome-switch`` image
.. code-block:: bash
$ BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE PYOCD_FLASH_IDS" \
PYOCD_FLASH_IDS="9009022103BB3A2DFE6555DC" bitbake zephyr-blueprint-smarthome-switch -c flash_usb
Prepare IoT controller (Avenger96/Linux flavour)
************************************************
Build
-----
#.
Create build directory
.. code-block:: bash
$ TEMPLATECONF=../oniro/flavours/linux . ./oe-core/oe-init-build-env build-oniro-linux-stm32mp1-av96
#.
Edit ``conf/local.conf``, and uncomment the following line:
.. code-block:: bash
#MACHINE ?= "stm32mp1-av96"
#.
Add the `meta-oniro-blueprints` layer to the build. This is only needed once
after initializing a new build:
.. code-block:: bash
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-homeassistant
$ bitbake-layers add-layer $CHECKOUT_DIR/meta-oniro-blueprints
#.
Make sure you have at least 25 GB of free space on the partition
where the build directory is located.
#. Build ``blueprint-dashboard-gateway-image`` image using ``bitbake``,
with the following overrides:
* ``DISTRO`` set to ``oniro-linux-blueprint-dashboard`` --
this distribution configuration enhances the regular distribution
with dependencies necessary for this demonstration scenario,
* ``SMART_HOME_SENSORS_MAC`` and ``SMART_HOME_SWITCH_MAC`` set to MAC
addresses of IoT devices, as set in the previous section.
.. code-block:: bash
$ DISTRO=oniro-linux-blueprint-dashboard \
BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SMART_HOME_SENSORS_MAC SMART_HOME_SWITCH_MAC" \
SMART_HOME_SENSORS_MAC="C0:BA:DD:06:F0:0D" \
SMART_HOME_SWITCH_MAC="C0:BA:DD:06:F0:0E" \
bitbake blueprint-dashboard-gateway-image
Flash
-----
#.
Build artifacts are located in ``./tmp/deploy/images/stm32mp1-av96/`` relative
to the build directory. Flashing script is located in
``./scripts/create_sdcard_from_flashlayout.sh`` relative to the build artifacts
directory. FSD card flash layout used to convert build artifacts to the image is
located in ``flashlayout_<image name>/extensible/FlashLayout_sdcard_stm32mp157a-av96-extensible.tsv``
relative to the build artifacts directory.
#.
Go to the build artifacts directory and convert flash layout into a build image
.. code-block:: bash
$ cd tmp/deploy/images/stm32mp1-av96
$ ./scripts/create_sdcard_from_flashlayout.sh \
flashlayout_blueprint-dashboard-gateway-image/extensible/FlashLayout_sdcard_stm32mp157a-av96-extensible.tsv
#.
Lots of text will appear, but the most important part are the two commands
.. code-block:: bash
WARNING: before to use the command dd, please umount all the partitions
associated to SDCARD.
sudo umount `lsblk --list | grep <sd card name> | grep part | gawk '{ print $7 }' | tr '\n' ' '`
To put this raw image on sdcard
sudo dd if=<image>.raw of=<sd card node> bs=8M conv=fdatasync status=progress
#. Put a microSD card in your card reader. Copy the commands above and paste them
into your terminal. Do not remove the microSD card from the reader just yet.
Add Bluetooth firmware
----------------------
Due to licensing details, |main_project_name| cannot provide the firmware file for
the on-board Bluetooth controller. However, user may download and install it
manually.
#. Download the `Bluetooth firmware file from GitHub <https://github.com/dh-electronics/meta-av96/raw/9d2a3fdacf49aebc9298a7c444f5a021d3e99e13/recipes-bsp/firmware-files/files/lib/firmware/brcm/BCM4345C0.hcd>`_.
#. Create directory ``lib/firmware/brcm`` on the ``rootfs`` partition of the
microSD card and copy the downloaded file into that directory. Assuming your
card's mount point is ``/mnt/rootfs``, you may use the example commands to
accomplish that:
.. code-block:: bash
$ sudo mkdir /mnt/rootfs/lib/firmware/brcm
$ sudo cp ~/Downloads/BCM4345C0.hcd /mnt/rootfs/lib/firmware/brcm
$ sudo chmod 755 /mnt/rootfs/lib/firmware/brcm
#. Unmount all microSD card partitions, remove them from the reader and put
it in Avenger96 card slot. Power up the board.
Home Assistant
**************
Set up
------
#. Put ths SD card into Avenger96 and press power on button.
#. On start up, Avenger96 will try to contact a DHCP server. Be sure to
have one in your network, where you can see the IP address assigned to
the board. Alternatively, you can use UART-USB adapter, log in to the
system and set IP address manually.
#. Using a web browser, go to the IP address of Avenger96, port ``8123``.
E.g. if you find out the Avenger's IP address is ``192.0.2.137`` , go to
``http://192.0.2.137:8123``.
#. Create a user account and click your way through the basic settings.
#. You should find yourself in Home Assistant dashboard. Three circular
icons on top show temperature, humidity and human presence.
.. image:: assets/smarthome-blueprint-dashboard.png
:alt: Home Assistant dashboard
Customizing the Dashboard
-------------------------
#. Click three vertical dots in the top-right corner of the dashboard
and select ``Configure UI``.
#. Agree to take control over the UI, remove the default widgets and
click the yellow ``+`` button in the bottom-right corner of the dashboard.
#. Choose widgets according to your taste. They are already pre-configured,
connected to the existing sensors (temperature, humidity, human presence)
and light controls.
#. Adjust widgets configuration according to your taste. Most notable
possibility is that you can combine multiple entities in one widget,
e.g. creating a single widget with all the sensors and a light control
switch.
.. image:: assets/smarthome-blueprint-dashboard-config.png
:alt: Home Assistant dashboard configuration
.. image:: assets/smarthome-blueprint-dashboard-config-done.png
:alt: Home Assistant dashboard finished configuration
Set up automations
------------------
Home Assistant can do things for you based on state sensors. This is how
Home Assistant can be configured to turn the light on/off based on
user presence nearby the human presence sensor. Imagine it is a kitchen
light turning on every time it detects you are about to prepare a meal!
#. Go to Configuration menu using the cog button located on the left-hand
sidebar, then to Automations.
#. Click the yellow ``+`` button in the bottom-right corner of the screen, then
skip the smart automations generator.
#. Name your automation accordingly, e.g. *Lights on when somebody in the room*.
#. Set the trigger as follows:
* Trigger type: ``State``,
* Entity: ``sensor.all_scenarios_os_smarthome_device_presence``,
* From: ``False`` (*person not detected*).
* To: ``True`` (*person detected*)/
.. image:: assets/smarthome-blueprint-dashboard-automations-trigger.png
:alt: Home Assistant dashboard automations trigger
#.
Set the action as follows:
* Action type: ``Call service``,
* Service: ``switch.turn_on``,
* Name(s) of entities to turn on: ``switch.all_scenarios_os_smarthome_device_light``.
.. image:: assets/smarthome-blueprint-dashboard-automations-action.png
:alt: Home Assistant dashboard automations action
#.
Click the yellow save button in the bottom-right corner of the screen.
#. Repeat steps 2-6 for the opposite automation, i.e. turning the light off,
when human presence state switches from ``True`` to ``False``.
Verify operations
*****************
#. Temperature and humidity readings should show temperature and humidity
in the room where the Nitrogen with sensors is located. Try to blow
hot/cold air on the sensor to see values changing
#. Human presence state should change when you move your hand close to
the sensor.
#. The light switch should control the LED.
#. The LED should turn on/off automatically when human presence is detected.
#. The LCD screen should display the current temperature, humidity
and the connection state marked with a ``<B>`` symbol.
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
Transparent Gateway Blueprint Details
#####################################
The following section details about various specifics of the Transparent Gateway Blueprint. The details include the basic networking subnet, configuration, Wi-Fi, and OpenThread connectivity details.
.. _MDK-rcp-flash:
Build and Flash the Radio Co-Processor Firmware
***********************************************
To allow the Raspberry Pi 4 to participate in an OpenThread wireless network, add a radio interface, as the Raspberry Pi 4 lacks on-board radio hardware to support it.
In this blueprint, the Makerdiary nrf52840 MDK USB dongle is used to provide the radio functionality. To enable our use case of an OpenThread border router, you need to compile and flash a fitting firmware image to the device.
The current manual process is quite intricated, but expect vast improvements in future iterations of the blueprint.
- Setup the OpenThread environment as follows:
.. code-block:: bash
$ docker pull openthread/environment:latest
$ docker run -it --rm openthread/environment bash
- Inside the docker container prepare the build as follows:
.. code-block:: bash
$ rm -rf openthread/
$ git clone --recursive https://github.com/openthread/openthread.git
$ cd openthread
$ git checkout thread-reference-20191113-1633-g4d50cbadb -b mdk-rcp
$ ./bootstrap
- Build the radio co-processor (RCP) firmware image as follows:
.. code-block:: bash
$ make -f examples/Makefile-nrf52840 USB=1 BOOTLOADER=USB JOINER=1
- Convert the firmware into the correct format for flashing as follows:
.. code-block:: bash
$ arm-none-eabi-objcopy -O ihex output/nrf52840/bin/ot-rcp output/nrf52840/bin/ot-rcp.hex
$ wget https://raw.githubusercontent.com/makerdiary/nrf52840-mdk-usb-dongle/master/tools/uf2conv.py
$ python3 ./uf2conv.py output/nrf52840/bin/ot-rcp.hex -c -f 0xADA52840
The process creates a new file `flash.uf2`, which is the final firmware file needed.
The following two commands need to be executed in a new shell while the docker instance is still running.
- Get container ID for the running instance as follows:
.. code-block:: bash
$ docker container list
- Insert the container ID from above into the command below to copy the firmware file out of the container into your current directory:
.. code-block:: bash
$ docker cp $CONTAINER_ID:/openthread/flash.uf2 .
- Flash firmware onto the device as follows:
#. Switch the device into flash mode by holding down the button, while inserting the device into the USB port (a steady green LED next to the button indicates the device is in flash mode).
#. A new USB storage device appears (with name MDK-DONGLE).
#. Copy the `flash.uf2` file into the root folder of the USB storage.
#. Once copied, the bootloader writes the new firmware, and resets the device.
#. After the reset, only the main LED next to the USB plug remains steady green, which signifies that, it is now ready to be placed into the Raspberry Pi 4.
.. _QR-gen:
Generate Onboarding QR Code
***************************
During the OpenThread onboarding process of the mesh node onto the OpenThread network, a QR code is used. The QR code holds the joiner credential, and the unique EUI64 address of the device to join.
The joiner credential can be chosen freely, but ensure that it is identical in the firmware of the node to join, as well as in the QR code.
In this blueprint the joiner credential is: J01NU5
The EUI64, basically the MAC address of the device, is hardware dependent and needs to be fetched from the device after flashing the generated firmware image. After accessing the serial console of the Arduino Nano 33 BLE, issue the *ot eui64* command to receive the address as follows:
.. code-block:: bash
$ screen /dev/ttyACM0 115200
uart:~$ ot eui64
The full string needed to be encoded in the QR code looks as follows:
`v=1&&eui=00124b001ca77adf&&cc=J01NU5`
The value for the EUI parameter needs to be replaced with the one received from
the device. The QR code needs to be generated in text format (not as an URL). A simple online QR generator can be found here: https://qrd.by/#text
Network Subnets and Configuration
*********************************
On the basis of the board you use, and its hardware configuration, the available network interfaces and their names may vary. In order to avoid confusion, the following interfaces are assumed to be available:
- **Ethernet interface eth0:** assumed to be uplink with DHCP enabled.
- **Wi-Fi interface wlan0:** Wi-Fi access point interface serving the Wi-Fi subnet.
- **OpenThread interface wpan0:** OpenThread border router interface serving the mesh network.
In terms of IP subnets, use the private 172.16.47.0/24 range on the Wi-Fi subnet. The Access point(AP) has 172.16.47.1/24 assigned to it. Clients are served DHCP leases in the range of 172.16.47.100 - 172.16.47.150. The default DNS servers are 9.9.9.9 (primary) and 8.8.8.8 (secondary) respectively. For IPv6, you can rely on address auto-configuration for the time being.
On the OpenThread mesh network subnet, no IPv4 is available, and again you can rely on address auto-configuration for the time being.
Forwarding for IPv4 and IPv6 is enabled on all interfaces with `sysctl`.
Wi-Fi Access Point Configuration
********************************
Using the default Wi-Fi access point configuration, create an AP on channel 6 in the 2.4 GHz band with WPA2 pre-shared key configuration as:
.. code-block:: bash
`SSID: "Oniro Project WiFi"`
`Passphrase: "12345678"`
For more details, refer to the `NetworkManager configuration file <https://booting.oniroproject.org/distro/oniro/-/blob/dunfell/meta-oniro-blueprints/recipes-connectivity/networkmanager/networkmanager-softap-config/SoftAP.nmconnection>`_ to get more clarity.
OpenThread Border Router Configuration
**************************************
In our default OpenThread border router configuration, we create an OpenThread mesh network on channel 26 in the 2.4 GHz band with panid 0x1357:
.. code-block:: bash
`Networkname "OniroThread"`
`OpenThread masterkey: 00112233445566778899aabbccddeeff`
For more details, refer to the `OpenThread configuration script <https://booting.oniroproject.org/distro/oniro/-/blob/dunfell/meta-oniro-blueprints/recipes-connectivity/openthread/ot-br-posix/otbr-configuration>`_ for getting more clarity.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment