IQD-GW-01 Documentation · IQD-GW-01 Documentation, Release v1.0.0 2.1.3USB HOST port Do not use...

43
IQD-GW-01 Documentation Release v1.0.0 MICRORISC s.r.o. Mar 24, 2020

Transcript of IQD-GW-01 Documentation · IQD-GW-01 Documentation, Release v1.0.0 2.1.3USB HOST port Do not use...

  • IQD-GW-01 DocumentationRelease v1.0.0

    MICRORISC s.r.o.

    Mar 24, 2020

  • CONTENTS

    1 Device 3

    2 Contents 52.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 News . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 Device services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.4 Start - Gateway information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.5 Start - Gateway configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.6 Start - Gateway IQRF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.7 Start - Gateway clouds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.8 Start - Gateway users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.9 Advanced setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    3 PDF manual 37

    4 Indices and tables 39

    i

  • ii

  • IQD-GW-01 Documentation, Release v1.0.0

    Ready-to-use IQRF Gateway with Ethernet connection.

    CONTENTS 1

  • IQD-GW-01 Documentation, Release v1.0.0

    2 CONTENTS

  • CHAPTER

    ONE

    DEVICE

    3

  • IQD-GW-01 Documentation, Release v1.0.0

    4 Chapter 1. Device

  • CHAPTER

    TWO

    CONTENTS

    2.1 Introduction

    IQD-GW-01 is a demonstration and evaluation device consisting of the module as a DPA coordinator, a developmentboard, a pre-configured SD-card and a protective plastic housing.

    This device enables IQRF® customers to demonstrate and evaluate IQRF® features, and can be easily connected toexisting servers (e.g. IBM Cloud, Microsoft Azure, AWS IoT, Hexio IoT). The source code of and is provided by theopen source gitlab projects.

    2.1.1 Device

    2.1.2 Parts

    • H2 Quad Core Open Source 512MB Development Board

    • IQRF TR-76D extension board

    • White protective plastic box

    • Kingston 8GB SD card

    • Power supply 2A at 5V with micro USB connector

    5

  • IQD-GW-01 Documentation, Release v1.0.0

    2.1.3 USB HOST port

    Do not use it. For your awareness eventual short circuit on USB socket can cause excessive overheating of the device.

    2.1.4 SD card

    Do not remove the SD card when the device is in operation! Use Gateway button to power-off the device first, unplugthe power supply and then remove the SD card safely.

    2.1.5 Technical data

    • Operating Voltage: 5 V

    • RF Output Power (max.): 10 dBm

    • Operating Temperature: -10 ~ 40 °C

    • Interfaces: micro USB

    • RJ45 Ethernet

    • USB (1x)

    • Dimension (LxWxH): 50 x 54 x 36 mm

    • Coordinator: Contains DPA-SPI plugin

    2.2 News

    2.2.1 Known issues

    • Webapp

    • Login fails on the first time when browser cache is cleared

    2.2.2 Releases

    1.0.0-rc1 RELEASED; urgency=medium

    [ Roman Ondracek ] [ Rostislav Spinar ]

    • iqrf-gateway-daemon (2.2.0-rc4)

    • iqrf-gateway-webapp (2.0.0-rc6)

    • iqrf-gateway-controller (1.0.0-rc2)

    —Rostislav Spinar Thu, 19 Mar 2020 15:00:00 +0100

    6 Chapter 2. Contents

    start-ginfo.html#buttonmailto:[email protected]

  • IQD-GW-01 Documentation, Release v1.0.0

    2.3 Device services

    The gateway image is based on Linux for ARM development boards called Armbian. Many thanks to Armbian teamfor the great work.

    What is Armbian?

    • Lightweight Debian or Ubuntu based distribution specialized for ARM developing boards.

    • Compiled from scratch.

    • It has powerful build and software development tools.

    • A vibrant community.

    Knowing basics about the gateway’s content and its configuration.

    2.3.1 Default coordinator setting

    • DPA SPI coordinator plugin

    • LP networks enabled

    • Tx power 7

    • Rx filter 7 (Advised for ANY IQRF Linux gateway)

    2.3.2 Default services setting

    • IQRF Gateway daemon

    • IQRF Gateway webapp

    • IQRF Gateway controller

    • Mosquitto MQTT broker

    • Websocket client

    • Pixla remote management client

    • SSH server

    • Auto updates

    • Zeroconf Avahi daemon

    • Network manager

    • NTP client

    IQRF Gateway daemon

    • MQTT client connected to port 1883

    • WebSocket server ports 1338, 1438

    • UDP ports 55000 and 55300

    • Tip: Explore more about its configuration via web interface.

    • Tip: Explore more about daemon API.

    2.3. Device services 7

    https://docs.armbian.com/https://docs.iqrf.org/iqrf-gateway/configure.htmlhttps://docs.iqrf.org/iqrf-gateway/api.html

  • IQD-GW-01 Documentation, Release v1.0.0

    sudo systemctl status iqrf-gateway-daemon.service

    IQRF Gateway webapp

    • HTTP server is running port 80.

    • Action: Create your own user once logging for the first time, there is a guide.

    • Tip: Explore IQRF Gateway daemon’s posibilities using web interface.

    sudo systemctl status nginx.service

    IQRF Gateway controller

    Controls gateway’s button and led.

    • 1-10s button press poweroff the gateway gracefully.

    • 10s button press restores default IQRF Gateway daemon’s and IP configuration and restarts the daemons.

    • Green led slow flashing means that the daemon is running in operational/forwarding mode.

    • Green led fast flashing means that the daemon is running in service mode.

    • Red led slow flashing means that the daemon service is not running.

    • Red led fast flashing means that the daemon interface is not correctly configured.

    sudo systemctl status iqrf-gateway-controller.service

    Mosquitto MQTT broker

    MQTT broker is running on port 1883.

    • Tip: IQRF Gateway daemon is already configured and connected to it.

    • Tip: Check simple examples for bash.

    sudo systemctl status mosquitto.service

    Websocket client

    Test IQRF Gateway daemon API from bash directly.

    • Tip: Check simple examples for bash.

    Pixla remote management client

    Having all the gateways at one place with monitoring and management capabilities?

    • Login at https://www.pixla.online

    • Action: Register your gateway’s token as printed on the label to your user account.

    • Tip: You can also scan printed QR code to get the token.

    8 Chapter 2. Contents

    https://gitlab.iqrf.org/open-source/iqrf-gateway-daemon/tree/master/examples/bashhttps://docs.iqrf.org/iqrf-gateway/api.htmlhttps://gitlab.iqrf.org/open-source/iqrf-gateway-daemon/tree/master/examples/bashhttps://www.pixla.online

  • IQD-GW-01 Documentation, Release v1.0.0

    • The client service can be disabled/enabled using web interface.

    sudo systemctl status gwman-client.service

    SSH server

    SSH server is by default disabled. When enabled it runs on port 22.

    • Default credentials: root/1234

    • Tip: Use gateway web (/gateway/ssh) page to enable SSH service if required.

    • Tip: Use e.g. Putty client to login to the gateway.

    • Action: Create your own user once login for the first time, there is a guide upon login.

    sudo systemctl status ssh.service

    Auto updates

    Unattending updates for the system and IQRF packages are configured and enabled by default.

    • Tip: The updates can be disabled/enabled using web interface.

    sudo systemctl status unattended-upgrades.service

    Zeroconf Avahi daemon

    Do not know your IP address from DHCP server within your network?

    • Action: Zeroconf for Win

    • Tip: Ping your device using: ping -4 your-gw-hostname.local

    The hostname can be found either on the gateway label or via web interface in the information page.

    sudo systemctl status avahi-daemon.service

    Network manager

    GW ETH is configured for DHCP IP by default.

    • Tip: It is possible to switch to static IP using console armbian-config interface.

    GW WiFi is not configured by default.

    • Tip: WiFi can be enabled and configured by the customer also via console armbian-config interface.

    sudo armbian-config

    2.3. Device services 9

    https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.htmlhttps://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux/overviewhttps://docs.armbian.com/User-Guide_Armbian-Config/https://docs.armbian.com/User-Guide_Armbian-Config/

  • IQD-GW-01 Documentation, Release v1.0.0

    NTP client

    Keep gateway time in sync.

    • Tip: Configure your local timezone.

    sudo dpkg-reconfigure tzdata

    sudo systemctl status ntp.service

    2.4 Start - Gateway information

    2.4.1 Knowing IP address

    Using any IP scanner to search your network subnet and locate the gateway IP address. The gateway hostname isconfigured to following: iqdgw01-{GWID}.

    2.4.2 Boot and power-off

    The gateway boot process takes about 30s and it takes additonal 10s before Gateway led described in below chapterLed operation is stabilized.

    It is recommended to power-off the gateway using Gateway button described in below chapter Button and thenunplug the power supply. This ensures correct power-off of the device.

    10 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.4.3 Led operation

    There are 2 two-colour leds available on the gateway. IQRF led and Gateway led. Gateway led follows these rules:

    • Green led slow flashing means that IQRF Gateway daemon is running in operational/forwarding mode.

    • Green led fast flashing means that IQRF Gateway daemon is running in service mode.

    • Red led slow flashing means that IQRF Gateway daemon service is not running.

    • Red led fast flashing means that IQRF Gateway daemon interface is not correctly configured.

    2.4.4 Button

    Short 1-10s button press poweroff the gateway gracefully.

    • Push and release the button. An action is indicated by Gateway led, 3x yellow flashing.

    Long 10+s button press restores default IQRF Gateway daemon’s and IP configuration and restarts the daemons.

    • Hold the button until an action is indicated by Gateway led, 3x yelow flashing.

    Tip: Use the button to poweroff the gateway gracefully in order to preserve the SD card.

    2.4.5 Login

    Web server is running on default port 80 by default. Create your username and password when login for the firsttime or after restoring default setting using Gateway button.

    2.4. Start - Gateway information 11

  • IQD-GW-01 Documentation, Release v1.0.0

    2.4.6 Information

    Information about installed software, resources and TR module is well displayed on the page.

    12 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    Download diagnostics button saves all necessary logs for the detailed analysis.

    2.4.7 Log

    IQRF Gateway daemon log is displayed and can be downloaded on the page.

    2.4. Start - Gateway information 13

  • IQD-GW-01 Documentation, Release v1.0.0

    2.4.8 Modes

    IQRF Gateway daemon can be switched to different modes.

    • Operational: IQRF JSON API via MQ/MQTT/WS channels are enabled

    • Service: IQRF via UDP channel is enabled, ready to connect IQRF IDE software to the gateway

    • Forwarding: IQRF JSON API via MQ/MQTT/WS channels are enabled with forwarding via UDP as well

    14 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    IQRF IDE connection.

    • Switch the gateway to the service mode

    • Configure IDE UDP channel, select IQRF gateway

    2.4. Start - Gateway information 15

  • IQD-GW-01 Documentation, Release v1.0.0

    2.4.9 IQRF service

    IQRF Gateway daemon service can be controled via Service control page.

    16 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.4.10 SSH service

    SSH service can be controled via SSH service page.

    2.4.11 Upgrades

    Linux packages can be installed automatically by the system itself. This also updates any new packages related toIQRF Gateway SW such as iqrf-gateway-{daemon, webapp, controller} in stable version.

    2.4. Start - Gateway information 17

  • IQD-GW-01 Documentation, Release v1.0.0

    2.4.12 Power control

    The gateway can be restarted or powered off gracefully via Power control page.

    18 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.5 Start - Gateway configuration

    Editing other parameters than listed below are not necessary!

    Most parameters are already well tuned for this gateway.

    2.5.1 IQRF Repository

    IQRF Gateway daemon periodically downloads state of IQRF and caches all the data.Download period can be configured via this page.

    2.5.2 MQTT messaging

    IQRF Gateway daemon MQTT client configuration. Multiple MQTT connections are possible.A configuration for the well-known cloud platforms are handled in Webapp menu Clouds.

    2.5. Start - Gateway configuration 19

  • IQD-GW-01 Documentation, Release v1.0.0

    2.5.3 Websocket messaging

    IQRF Gateway daemon Websocket server configuration. Default port matches setting in Webapp.

    20 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.5.4 UDP messaging

    IQRF Gateway daemon UDP ports configuration. Default ports match setting in IQRF IDE.

    2.5.5 Scheduler

    Using Add button any gateway is added as scheduler’s task. The daemon restart is needed in order to activate addedtask.

    There are 3 options to schedule task:

    • Cron format (e.g. every 5s -> */5 * * * * * *)

    • Exact time (one shot task at specific time in format dd.mm.rrrr mm:ss)

    • Period (periodic task at defined period)

    There are 3 options to direct JSON response (result of scheduled JSON request task) to:

    • MqMessaging

    • MqttMessaging

    • WebsocketMessaging

    2.5. Start - Gateway configuration 21

  • IQD-GW-01 Documentation, Release v1.0.0

    There is also possibility to export and then import exported tasks. The daemon restart is needed after the import.

    Task JSON file example 1551266261.json for the import:

    22 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    {"taskId": 1551266261,"clientId": "SchedulerMessaging","timeSpec": {

    "cronTime": ["*/5","*","*","*","*","*","*"

    ],"exactTime": false,"periodic": false,"period": 0,"startTime": ""

    },"task": {

    "messaging": "MqttMessaging","message": {

    "mType": "iqrfEmbedLedr_Pulse","data": {

    "msgId": "testEmbedLedr","req": {

    "nAdr": 0,"param": {}

    },"returnVerbose": true

    }}

    }}

    Read more about the scheduler and its tasks .

    2.5.6 Tracer

    IQRF Gateway daemon logging can be configured via Tracer page. A communication with IQRF repository has beenseparated into its own log file.

    It is possible to set log verbosity, sizes and names with or without timestamps. Logs without timestampsoverwrite itself after reaching set size.

    2.5. Start - Gateway configuration 23

  • IQD-GW-01 Documentation, Release v1.0.0

    2.5.7 Migration

    It is possible to handle export/import of IQRF Gateway daemon configuration and Scheduler tasks setting.

    24 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.6 Start - Gateway IQRF

    2.6.1 Send DPA packet

    Any IQRF DPA packet can be sent using this page. There are predefined macros to select particular DPA packet.

    The user can select device address by enabling Set own NADR.An user timeout to wait for DPA response can be selected by enabling Set own DPA timeout.

    2.6.2 Send JSON request

    Any IQRF JSON request can be sent using this page. The best is to open another tab in browser using button ShowAPI documentation and copy any request from displayed examples on API page.

    2.6. Start - Gateway IQRF 25

  • IQD-GW-01 Documentation, Release v1.0.0

    2.6.3 Coordinator upload

    IQRF DPA custom handler (.hex) and plugin (.iqrf) can be uploaded to the coordinator TR module in the gateway.IQRF DPA plugin is automatically preselected for the given IQRF OS version and downloaded from IQRF repository.

    To upload any IQRF DPA handler or plugin to the devices in the network DPA Over The Air upload must be usedalong with the wizard in IQRF IDE. Switch gateway to service mode, connect IQRF IDE via UDP and follow the .

    Be aware that DPA plugin upload takes tens of seconds!

    26 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.6.4 TR configuration

    TR module configuration can be shown/changed using this page.

    The coordinator address 0 is selected by default. Using Read button address configuration is read from the givendevice address 0-239. The Write button writes new configuration to previously selected device or to coordinator bydefault.

    2.6. Start - Gateway IQRF 27

  • IQD-GW-01 Documentation, Release v1.0.0

    2.6.5 Network manager

    The network manager can be used to perform necessary tasks in order to create IQMESH network such as devicebonding, discovery, ping and enumeration. There is a support for the Local bonding e.g. via button and for the Smartconnect via code.

    28 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.6.6 Standard manager

    The standard manager can be used to work with IQRF Standard devices such as IQRF Sensor, BO, Light and Dali.

    2.7 Start - Gateway clouds

    2.7.1 Cloud platforms

    Prepared wizards to connect selected cloud platforms such as IBM cloud, MS Azure, Amazon AWS, Hexio orInteliments are ready. The connection to the clouds is done using MQTT client.

    The wizards configure MQTT client in IQRF Gateway daemon for the selected cloud. There is also a link to detailedPDF step by step document and the video on the page.

    2.7. Start - Gateway clouds 29

  • IQD-GW-01 Documentation, Release v1.0.0

    2.7.2 Device management

    management platform allows to register multiple gateways and perform system’s as well as IQRF tasks across singleor more gateways. There is a need to register the your gateway token to your user account.

    30 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.8 Start - Gateway users

    2.8.1 User manager

    There is posibility to add new or edit/delete already existing user for the gateway web interface.

    2.9 Advanced setup

    2.9.1 SSH login

    Initial credentials for the login are user: root with password: 1234.There is a guide to create your own user and password during initial login.

    2.8. Start - Gateway users 31

  • IQD-GW-01 Documentation, Release v1.0.0

    2.9.2 Static IP address

    Static IP address can be configured via console utility .Once configured IP is changed and the user must reconnect using new IP address.

    32 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.9. Advanced setup 33

  • IQD-GW-01 Documentation, Release v1.0.0

    2.9.3 Webapp’s User password

    In case of forgotten user password it is possible to change the password to already existing user via console utility.

    34 Chapter 2. Contents

  • IQD-GW-01 Documentation, Release v1.0.0

    2.9.4 WiFi configuration

    WiFi can be also configured via console utility .

    2.9. Advanced setup 35

  • IQD-GW-01 Documentation, Release v1.0.0

    36 Chapter 2. Contents

  • CHAPTER

    THREE

    PDF MANUAL

    Here is a pdf file IQD-GW-01.pdf.

    37

  • IQD-GW-01 Documentation, Release v1.0.0

    38 Chapter 3. PDF manual

  • CHAPTER

    FOUR

    INDICES AND TABLES

    • genindex

    • modindex

    • search

    39

    DeviceContentsIntroductionNewsDevice servicesStart - Gateway informationStart - Gateway configurationStart - Gateway IQRFStart - Gateway cloudsStart - Gateway usersAdvanced setup

    PDF manualIndices and tables