Transcript
BeagleBoneBlack IoT cape IEEE802.15.4 cape with ATMEL ATZB-RF-1-C component
NGS IoT Bone (rev.ATZ-1) User manual
Code : NGS_IoT_Bone_rev_ATZ_1 Version : 1.0 Date : 14/04/2016
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
Page intentionally left blank
New Generation Sensors S.r.l.
2/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
Warranty, Warnings and Disclaimers This evaluation board/kit is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY and is not considered by New Generation Sensors S.r.l. to be a finished end product fit for general consumer use. Persons handling the product(s) must have electronics training and observe good engineering practice standards. As such, the goods being provided are not intended to be complete in terms of required design-, marketing-, and/or manufacturing-related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards. This evaluation board/kit does not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), and therefore may not meet the technical requirements of these directives or other related directives. Please read the User Manual and, specifically, the Warnings and Restrictions notice in the Systems Reference Manual of the BeagleBone Black you are using, prior to handling the product. This notice contains important safety information about temperatures and voltages. No license is granted under any patent right or other intellectual property right of Supplier covering or relating to any machine, process, or combination in which such Supplier products or services might be or are used. The Supplier currently deals with a variety of customers for products, and therefore our arrangement with the user is not exclusive. The Supplier assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. The “NGS IoT Bone (rev. ATZ-1)” as purchased is warranted against defects in materials and workmanship for a period of 90 days from purchase. This warranty does not cover any problems occurring as a result of improper use, modifications, exposure to water, excessive voltages, abuse, or accidents. All boards will be returned via standard mail if an issue is found. If no issue is found or express return is needed, the customer will pay all shipping costs.
New Generation Sensors S.r.l.
3/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
Page intentionally left blank
New Generation Sensors S.r.l.
4/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
Revision History Version 1.0
Changes First version of the document
New Generation Sensors S.r.l.
Date 14/04/2016
5/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
Page intentionally left blank
New Generation Sensors S.r.l.
6/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
Table of Contents 1. Introduction ............................................................................................................................................8 Scope ..................................................................................................................................................... 8 Acronyms and abbreviations ................................................................................................................. 8 2. BBB pin description ...............................................................................................................................9 3. Device setup ......................................................................................................................................... 11 Setup in kernel 4.1.21 with Device Tree ..............................................................................................11 4. Communication setup ..........................................................................................................................13 WPAN interface configuration ............................................................................................................ 13 6LoWPAN interface configuration ..................................................................................................... 14
New Generation Sensors S.r.l.
7/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
1. Introduction The NGS IoT Bone (rev. ATZ-1) cape described in this document provides the IEEE802.15.4 interface capabilities for Ad-Hoc Internet of Things deployments. The cape embeds the ATMEL ATZB-RF-2331-C module as standard 2.4 GHz RF transceiver. This solution creates a low-cost, low-data rate (up to 250kbps) Wireless Personal Area Network (WPAN).
Scope This document describes the cape’s behaviors and features, and also how to interact with it.
Acronyms and abbreviations Table 1 - List of acronyms Acronym 6LoWPAN
Description IPv6 over Low power Wireless Personal Area Networks
BBB
Beagle Bone Black
DTB
Device Tree Blob
DTS
Device Tree Source
I/O
Input / Output
NGS IoT Bone (rev. ATZ-1) SPI WPAN
The BBB IoT Cape based on the IEEE802.15.4 described in this document Serial Periferal Interface (the ATZB-RF-1-C control interface) Wireless Personal Area Network
New Generation Sensors S.r.l.
8/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
2. BBB pin description This cape has been developed to be fully compatible the Beagle Bone Black version. The pin map assignment based on the BBB (I/O) perspective is the following: Table 2 - P9 Header pin usage PIN
Name on BBB
Direction
Description
P9.23
GPIO1_17
O
ATZB-RF-2331-C reset
P9.27
GPIO3_19
I
ATZB-RF-2331-C Interrupt
P9.25
GPIO3_21
O
ATZB-RF-2331-C Wake
P9.28
SPI1_CSO
O
SPI Chip Select
P9.30
SPI1_D1
O
SPI Serial Data Out
P9.29
SPI1_D0
I
SPI Serial Data In
P9.31
SPI1_SCLK
O
SPI Clock
Name on BBB
Direction
Description
P2.1
-
Power
3.3V
P2.2
-
Power
GND
P2.3
I2C2_SCL
O
I2C SCL
P2.4
I2C2_SDA
I/O
I2C SDA
P2.5
UART1_TX
O
UART TX
P2.6
UART1_RX
I
UART RX
P2.7
SYS_5V
Power
5V
P2.8
GND
Power
GND
Table 3 – P2 Header pin usage PIN
New Generation Sensors S.r.l.
9/14
NGS IoT Bone (rev. ATZ-1) User manual
P8
Version : Date :
1.0 14/04/2016
P9
P2
New Generation Sensors S.r.l.
10/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
3. Device setup In order to have the NGS IoT Bone (rev. ATZ-1) fully working in the Linux environment some steps must be followed as a function of the Linux Kernel version used in the reference distribution.
Setup in kernel 4.1.21 with Device Tree To have the cape working with kernel 4.1.21 the right definition must be inserted in the BeagleBone Black Device Tree, then the reference dts file must be compiled. The cape definition to be inserted at the end of the kernel file “/arch/arm/boot/dts/am335x-boneblack.dts” is reported in the following: &am33xx_pinmux { spi1_pins: pinmux_spi1_pins { pinctrl-single,pins = < 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE3) 0x194 (PIN_INPUT | MUX_MODE3) 0x198 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) 0x19c (PIN_OUTPUT_PULLUP | MUX_MODE3) 0x1a4 (PIN_INPUT | MUX_MODE7) 0x1ac (PIN_OUTPUT_PULLDOWN | MUX_MODE7) 0x044 (PIN_OUTPUT_PULLUP | MUX_MODE7) >; }; };
&spi1 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&spi1_pins>; at86rf233@0 { compatible = "atmel,at86rf233"; spi-max-frequency = <6000000>; reg = <0>; interrupts = <19 4>; interrupt-parent = <&gpio3>; reset-gpio = <&gpio1 17 1>; sleep-gpio = <&gpio3 21 1>; xtal-trim = /bits/ 8 <0xF>; }; };
To check whether the cape has been loaded the “dmesg” command can be used after the boot, and the following output must be shown whether everything is correct: [ 15.506076] at86rf230 spi2.0: Detected at86rf233 chip version 1
Moreover, by using the “iwconfig” command a wpan0 interface appears, which can be enabled through the “ifconfig wpan0 up” command. As result the following output can be seen by simply running New Generation Sensors S.r.l.
11/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
“ifconfig”: wpan0
Link encap:UNSPEC HWaddr 01-B5-EE-AA-AC-33-7F-ED-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING NOARP MTU:127 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
An already compiled dts file supporting the NGS IoT Bone (rev. ATZ-1) can be downloaded from ngssensors.it/en/.
New Generation Sensors S.r.l.
12/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
4. Communication setup To have a fully working WPAN network the network interface must be properly configured. In the following the main configuration steps are reported, as well as how to set up a 6LoWPAN interface.
WPAN interface configuration The wpan0 interface can be easily configured through wpan-tools, a userspace tools for Linux IEEE 802.15.4 stack. Wpan-tools can be downloaded at the link https://github.com/linux-wpan/wpan-tools. The following set of commands, which refers to version 0.6, can be used to change the transmission channel, the device MAC address, and the PAN-ID: iwpan dev wpan0 del iwpan phy phy0 set channel 0 23 iwpan phy phy0 interface add wpan0 type node 11:22:33:44:55:66:77:88 iwpan dev wpan0 set pan_id 0xabcd
As a result the WPAN interface will have the following configuration parameters: iwpan phy wpan_phy phy0 supported channels: page 0: 11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26 current_page: 0 current_channel: 23, 2465 MHz tx_power: 0 iwpan dev phy#0 Interface wpan0 ifindex 8 wpan_dev 0x5 extended_addr 0x1122334455667788 short_addr 0x0002 pan_id 0xabcd type node max_frame_retries -1 min_be 3 max_be 5 max_csma_backoffs 4 lbt 0 ifconfig wpan0 Link encap:UNSPEC HWaddr 11-22-33-44-55-66-77-88-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING NOARP MTU:127 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
New Generation Sensors S.r.l.
13/14
NGS IoT Bone (rev. ATZ-1) User manual
Version : Date :
1.0 14/04/2016
collisions:0 txqueuelen:300 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
6LoWPAN interface configuration Once the wpan interface has been configured the 6lowpan interface can be created through the following commands: ip link add link wpan0 name lowpan0 type lowpan ip link set lowpan0 up
To check whether a lowpan interface is running use the ifconfig command: ifconfig lowpan0 Link encap:UNSPEC HWaddr 11-22-33-44-55-66-77-88-00-00-00-00-00-00-00-00 inet6 addr: fe80::1322:3344:5566:7788/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1280 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wpan0
Link encap:UNSPEC HWaddr 11-22-33-44-55-66-77-88-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING NOARP MTU:127 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300 RX bytes:0 (0.0 B) TX bytes:1900 (1.9 KB)
New Generation Sensors S.r.l.
14/14