r22 gu - exeginexegin.com/wp-content/uploads/r22_gu.pdfjust click esy to add the rsa2 ngerprint of...

31

Upload: others

Post on 13-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

R22 GU

Owen Kirby

Copyright 2018, Exegin Technologies Limited

Page 2: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

ii

Page 3: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CONTENTS

1 Quick Start Guide 3

Connecting to the Beaglebone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Inside the beaglebone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Channel Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Running a Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Turing off the beaglebone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2 Installation and Recovery 15

Kit Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Beaglebone Green . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Q7x Beaglebone RF Cape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Q7x Radio Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Assembly Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Golden Unit Tools Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Golden Unit Tools Update - Linux and OSX . . . . . . . . . . . . . . . . . . . . . 23Golden Unit Tools Update - Windows . . . . . . . . . . . . . . . . . . . . . . . . 24

iii

Page 4: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CONTENTS 1

Contents:

Page 5: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

2 CONTENTS

Page 6: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CHAPTER

ONE

QUICK START GUIDE

Assemble the hardware as shown, with the 2.4GHz antenna on the inboard RP-SMA connec-tor and the longer 900MHz antenna on the outboard RP-SMA antenna, and then poweringthe beaglebone platforms with a powered USB hub. Most laptops can provide enough powerfor the Beaglebone platform, but sometimes the units may exceed the 500mA USB currentrating, so a powered hub is advised.

3

Page 7: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

4 CHAPTER 1. QUICK START GUIDE

Connecting to the Beaglebone

After powering up the Beaglebone, it will appear as a USB Ethernet device, hosting a DHCPserver that will assign an internal IP address to your PC. Once powered up, you can connectto the IP address of the Beaglebone printed on a label on the side of connector P9 usingSSH. The default username is debian and the default password is temppwd.

Connecting with Linux or OSX

On linux the SSH command would be:

ssh [email protected]

You machine might prompt you to accept the RSA2 fingerprint of the beaglebone. Simplyaccept the key and you will be prompt to enter the password for the beaglebone.

Connecting with Windows

An installation of the Beaglebone drivers is first required and can be found:

https://learn.adafruit.com/ssh-to-beaglebone-black-over-usb/installing-drivers-windows

The link provides drivers for both 32 and 64-bit installers. It should be noted that the driverson the adafruit website doesn’t work with Windows 10 systems, but the drivers for it can befound:

http://beagleboard.org/static/beaglebone/latest/README.htm#step2

After installing the Beaglebone drivers we can then connect the Beaglebone to the PC andconnect to the device using SSH. We recommend using PuTTY as the SSH client, which canbe obtained from:

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

After launching PuTTY the following screen will be shown:

Page 8: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CONNECTING TO THE BEAGLEBONE 5

Change the Host Name to match the IP address that’s printed to the side of the beaglebone.Then on the left hand pane click on Connection->Data

Page 9: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

6 CHAPTER 1. QUICK START GUIDE

Enter “debian” in the Auto-login username field. Also make sure that Prompt is selected inthe When username is not specified selection group.

You can then go back to the Session window using the left hand pane and save the theconfiguration if desired.

After configuring PuTTY, click the Open button and it will open an SSH session to thebeaglebone. You might get a security alert screen like:

Page 10: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CONNECTING TO THE BEAGLEBONE 7

Just click Yes to add the RSA2 fingerprint of the beaglebone to your Windows machine.After adding the fingerprint, PuTTY will open a new window and you will see a prompt toenter the password for the beaglebone.

Page 11: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

8 CHAPTER 1. QUICK START GUIDE

Inside the beaglebone

After connecting to the beaglebone, you should see the prompt displaydebian@beaglebone:~$ to indicate that you have successfully logged into the beagle-bone. The current working directory should be /home/debian which will contain thefollowing:

Path Description

start Start zbcli and begin writing to a new log file.restart Start zbcli while appending to an existing log file.scripts Directory of ZigBee test script files.

Page 12: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CHANNEL CONFIGURATION 9

Channel Configuration

Modify the channels scripts to select the desired channel. The location of the script can befound in:

File Description

~/scripts/r22/channels Channel configuration commands

The contents of the file will look something like this:

startup_channellist clear

### 2.4 GHz (Page 0, channels 11 to 26)

startup_channellist 0 11

### GB-868 (Pages 28 to 31)

startup_channellist 28 0

### VPAN (Page 16)

startup_channellist 16 0

The two number after startup_channellist represents the page and channel respectively.

Page 13: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

10 CHAPTER 1. QUICK START GUIDE

Running a Test

After configuring the desired channel range on which you will be testing, we can begintesting by invoking the zbcli tool and running the ZigBee test scripts. In the scripts/r22/directory there are sub-directories for each test. Within each test sub-directory, there is afile with a tcNN-NN naming format that can be used as a reference to run the entire test(e.g. scripts/r22/tc11-02/tc11-02). We will take a look at test case 11.2 (TP/NWK/BV-02)for this document. The contents of the file tc11-02 will look something like this:

beaglebone$ cat scripts/r22/tc11-02/tc11-02

# 11.2 TP/NWK/BV-02 ZR-ZDO-APL RX Join/Leave

# 11.2.1 Description

# To test that devices are capable of joining and leaving network.

# 11.2.2 Procedure

# Steps

On gZC

source tc11-02/gzc

On dZR1

source tc11-02/dzr1

nwk_leave 0

zcl_tp2 buffer nwk 0x0 10

source tc11-02/dzr1

On gZC

nwk_leave 0x0000000100000000

On dZR1

zcl_tp2 buffer nwk 0x0 10

This listing demonstrates the commands used for each part of the test setup, and test proce-dure needed to execute test case 11.2 from the ZigBee PRO test specification. This particulartest case requires two devices: gZC and dZR1, we we will need to log into two beaglebonesto run this test. Inside the same directory contains the scripts to run a particular device rolewhich matches the naming scheme of the test case. This test begins by forming a network,which is accomplished with the script file at scripts/r22/tc11-02/gzc

beaglebone$ cat scripts/r22/tc11-02/gzc

echo on

# advertize our role so you can tell who we are with multiple windows open

prompt gZC

# initialize stack and set our EUI-64 as per the test case

init 0xaaaaaaaaaaaaaaaa

Page 14: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

RUNNING A TEST 11

source coord

# start the stack

startup_form

# set PAN ID per test case (usually optional when joining)

set_ib nwkPanId 0x1aaa

# During testing, set FC cooldown to 10 seconds

set_ib nwkFrameCounterCooldown 10

# Enable permit-join indefinitely

nwk_pjoin 255

However, before we can begin a test, we first need to set up the desired radio interfaces andchannels that we want the devices to use for this test. The channels are adjusted by editingthe script file located at scripts/r22/channels. To run this test using a single sub-GHzradio, we would start zbcli and execute the wpan serial /dev/q7x_subghz command. Ifyou want to use a 2.4 GHz radio, execute the wpan serial /dev/q7x_2400 command.

host-pc$ ssh [email protected]

beaglebone$ ./start

zbcli > wpan serial /dev/q7x_subghz

Once the radio has been successfully configured, we can continue by executing the gZC testcase script.

zbcli > source tc11-02/gzc

The second part of the test continues by joining a DUT router to the golden unit, leavingthe network, attempting to send traffic to the coordinator and then joining again. Thus wewould conduct the DUT side of the test with the following commands.

host-pc$ ssh [email protected]

beaglebone$ ./start

zbcli > wpan serial /dev/q7x_subghz

zbcli > source tc11-02/dzr

dZR1 > nwk_leave 0

dZR1 > zcl_tp2 buffer nwk 0x0 10

dZR1 > source tc11-02/dzr1

Thus the following two steps could be executed by entering the commands on gZC and dZR1respectively:

gZC > nwk_leave 0x0000000100000000

dZR1 > zcl_tp2 buffer nwk 0x0 10

Once the test has been completed, exit the zbcli tool using the quit command, and theoutput from the tool will have been saved to a file in the current directory named logfile

Page 15: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

12 CHAPTER 1. QUICK START GUIDE

gZC > quit

beaglebone$ ls -l

drwxr-xr-x 2 debian debian 4096 Nov 6 15:27 bin

-rw-r--r-- 1 debian debian 210 Nov 6 15:46 logfile

-rwxr-xr-x 1 debian debian 74 Nov 6 15:39 restart

drwxr-xr-x 3 debian debian 4096 Nov 6 2016 scripts

-rwxr-xr-x 1 debian debian 116 Nov 6 15:39 start

Page 16: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

TURING OFF THE BEAGLEBONE 13

Turing off the beaglebone

It is important to note that you cannot simply unplug the beaglebone from a power source.This can cause the file system to get corrupted on the device. To safely unplug the beaglebone,just enter the command:

sudo shutdown -h

and wait for the LEDs on the device to turn off. This command only works if the zbcli toolhas been exited.

Page 17: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

14 CHAPTER 1. QUICK START GUIDE

Page 18: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

CHAPTER

TWO

INSTALLATION AND RECOVERY

Kit Contents

The following steps document the process for installing the Q7x golden unit software onto abeaglebone, or to restore a beaglebone to factory new condition.

The Q7x golden unit platform consists of the following hardware:

� Beaglebone Green

� Q7x Beaglebone RF Cape with programmable RF attenuators.

� Two radios expansion modules, which can be any of the following:

– Q72 Radio board using the AT86RF215 dual-band radio.

– Q73 Radio board using the ADF7023 sub-GHz FSK radio.

– Q74 Radio board using the ADF724x 2.4GHz O-QPSK radio.

� Two u.FL mini-coaxial jumper cables to connect the radio modules to the cape.

� Three USB micro-B cables

15

Page 19: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

16 CHAPTER 2. INSTALLATION AND RECOVERY

Beaglebone Green

The Beaglebone Green is an open source Linux computer, the golden unit platform is builton the Green variant from Seeedstudio, which includes gigabit Ethernet, 4GB of onboardeMMC flash, and a single USB port. Other beaglebone variants can be used, but sincethe SPI signals for the programmable RF attenuators are shared with the HDMI controller,the HDMI output must be disabled when used with the Black and White variants of theBeaglebone.

Page 20: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

Q7X BEAGLEBONE RF CAPE 17

Q7x Beaglebone RF Cape

The RF cape provides a mounting solution for the Q7x radio modules onto a beagleboneand integrates an onboard two-port USB hub and two digital programmable RF attenuatorsinline between the u.FL and RP-SMA antenna connectors. Some variants may also include abattery-backed realtime clock. The cape makes use of the following pins on the Beagleboneheader:

Pin Signal Revision Description

P9-1 GroundP9-2 GroundP9-3 +3.3VP9-4 +3.3VP9-7 +5V rev0 USB hub powerP9-8 +5V rev0 USB hub powerP9-10 NRST rev0 Reset signal to USB hubP9-14 PWM Output rev1 RGB LED (Red channel)P9-16 PWM Output rev1 RGB LED (Green channel)P9-19 I2C SCL Cape ID EEPROM and optional RTCP9-20 I2C SDA Cape ID EEPROM and optional RTCP9-28 SPI CS0 Chip select for first RF attenuatorP9-29 PWM Output rev1 RGB LED (Blue channel)P9-30 SPI MOSI SPI data for RF attenuatorsP9-31 SPI CLK SPI clock for RF attenuatorsP9-42 SPI CS1 Chip select for second RF attenuatorP9-43 GroundP9-44 GroundP9-45 GroundP9-46 Ground

Page 21: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

18 CHAPTER 2. INSTALLATION AND RECOVERY

Q7x Radio Modules

The Q7x radio modules combine a small Cortex-M3 CPU and one of several IEEE 802.15.4radio transcievers. Each radio module implements the MAC and PHY layers of the OSImodel, and can be controlled via the USB interface.

Page 22: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

Q7X RADIO MODULES 19

Module Transceiver CPU Description

Q72 AT86RF215 AT91SAM3S8B Dual-band IEEE 802.15.4-2015 radio moduleQ73 ADF7023 AT91SAM3S8B Sub-GHz IEEE 802.15.4g FSK radio moduleQ74 ADF724x AT91SAM3S8B 2.4GHz IEEE 802.15.4 O-QPSK radio module

Page 23: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

20 CHAPTER 2. INSTALLATION AND RECOVERY

Assembly Instructions

Begin assembly by installing the three 25mm M2 machine screws through the bottom of thecape pointing upwards as shown below, and screw on the three nylon hex standoffs to holdthe screws in place.

Install the 2.4GHz radio module onto the machine screws as shown below, and install a u.FLcoaxial jumper between the 2.4GHz antenna connector and the outboard u.FL connector onthe cape (furthest from the USB connector stack). Add the round nylon standoffs ontop ofthe 2.4GHz radio module.

Install the sub-GHz radio module ontop of the machine screws as shown below, and installa u.FL coaxial jumper between the sub-GHz antenna connector and the inbouard u.FLconnector on the cape (nearest to the USB connector stack). Fasten the radio modulesin place with a M2 hex nut and secure the nut with a drop of loctite.

Page 24: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

ASSEMBLY INSTRUCTIONS 21

Page 25: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

22 CHAPTER 2. INSTALLATION AND RECOVERY

Golden Unit Tools Installation

1. Change the static IP address of the golden unit to match the address printed onthe side of P9 so that each Beaglebone can be uniquely addressed by modifiyingUSB Ethernet section of the file /etc/network/interfaces as follows:

# Ethernet/RNDIS gadget (g_ether)

# Used by: /opt/scripts/boot/autoconfigure_usb0.sh

iface usb0 inet static

address 192.168.X.2

netmask 255.255.255.252

network 192.168.X.0

gateway 192.168.X.1

2. Install the Q7x Golden Unit package by copying the installation tarball to thebeaglebone, extracting and executing the install script.

host-pc$ scp q7x-golden-installer.tar.gz [email protected]:~

host-pc$ ssh [email protected]

beaglebone$ tar -mxzf q7x-golden-installer.tar.gz

beaglebone$ sudo q7x-golden-installer/install.sh

3. Safely power down the Beaglebone either by pressing the Power button adja-cent to the Ethernet jack, or by running the command sudo shutdown -h now

from the Beaglebone. Once the blue LEDs are all off it is safe to disconenctthe Beaglebone. Failure to safely power down the device can lead to

filesystem corruption.

Page 26: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

GOLDEN UNIT TOOLS UPDATE - LINUX AND OSX 23

Golden Unit Tools Update - Linux and OSX

To update the golden unit tools from a Linux or OSX machine, repeat steps 2 and 3 of theprevious section with the provided instaler package.

Page 27: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

24 CHAPTER 2. INSTALLATION AND RECOVERY

Golden Unit Tools Update - Windows

To update the golden unit tools from a Windows machine, we will need to usean SFTP and SSH client. We recommend the use of PuTTY and WinSCP. Onceinstalled, the GU tools can be updated as follows:

1. Launch WinSCP and configure the sesion to use the SFTP protocol.The host name should match the IP address printed on the side of P9.The port number used by the SFTP protocol is 22, and the defaultlogin to the Beaglebone is debian with password temppwd.

2. Click Login to connect to the Beaglebone, and you will be presentedwith an authentication banner. Click Continue to proceed to the filetransfer window.

Page 28: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

GOLDEN UNIT TOOLS UPDATE - WINDOWS 25

3. At the file transfer window, navigate the right pane tolocate the provided GU installer package, it will be namedq7x-golden-installer.tar.gz. And navigate the left pane to the/home/debian directory on the Beaglebone. Then drag and drop theq7x-golden-installer.tar.gz file from the right pane and into theleft pane.

Page 29: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

26 CHAPTER 2. INSTALLATION AND RECOVERY

4. After the file transfer is complete, click the red X to terminate thesession and close WinSCP.

5. Launch PuTTY and configure the session to use the SSH protocol.The host name should match the IP address printed on the side of P9.The port number used by the SSH protocol is 22.

6. Click Open to connect to the Beaglebone and you will be promptedfor your login credentials. The default login to the Beaglebone is debianwith password temppwd.

Page 30: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

GOLDEN UNIT TOOLS UPDATE - WINDOWS 27

7. Perform the following commands to remove the previous tools, ex-tract the installation package, and apply the upgrade to the Beaglebone.

8. After the upgrade is complete, we must restart the Beaglebone forthe changes to take effect. The shutdown -hr now command can beused to safely power down and restart the Beaglebone.

Page 31: R22 GU - Exeginexegin.com/wp-content/uploads/r22_gu.pdfJust click esY to add the RSA2 ngerprint of the beaglebone to your Windows machine. After adding the ngerprint, PuTTY will open

28 CHAPTER 2. INSTALLATION AND RECOVERY