# 1 Overview

This document provides step-by-step instruction to demonstrate the Arch Rock 6LoWPan sample applications for the ATAVRRZRAVEN 2.4 GHz Evaluation and Starter Kit (ATAVRRZRAVEN henceforth).

The ATAVRRZRAVEN contains the following hardware:

- A USB radio – AVRRZUSBSTICK
- Two Raven boards – AVRRAVEN1 and AVRRAVEN2

Running the Arch Rock 6LoWPan sample application comprises of the following steps:

1. Flashing the AVRRZUSBSTICK image on the hardware
2. Installing the Arch Rock 6LoWPAN service on the PC
3. Flashing the AVRRAVEN1 and AVRRAVEN2 images on the hardware
4. Running the sample applications

Each of the steps is detailed in the following sections.

# 2 Flashing the AVRRZUSBSTICK image

Refer to the AVRRZUSBSTICK Setup Guide located at

Arch Rock/docs/UsbStick/

# 3 Installing Arch Rock 6LoWPAN Service

Refer to the AVRRZUSBSTICK Setup Guide located at

Arch Rock/docs/UsbStick/

# 4 Flashing AVRRAVENx images

The programming interface on the AVRRAVENx boards must be setup prior according to the procedure described in Refer to AVR2016: RZRAVEN Hardware User's Guide 3.11.1.

Note that each AVRRAVENx board requires two images, one for the Atmega 3290p processor, another for the Atmega 1284p processor. For the purposes of this exercise, you only need to setup one of the two AVRRAVEN boards.

All the images are located under:

Arch Rock/binaries/raven_telnet_shell/

This directory is organized by processor type, one sub directory for the atmega3290p processor, another for the atmega1284p processor

Currently we provide one sample application image under the processor subdirectory

- Shell: allows a user to telnet to an AVRRAVEN and execute commands on a shell-like environment. (TCP/IP over 6LoWPAN)

## 4.1 Flashing the 3290p processor

Connect the JTAG programmer to the PC and connect the programming header to the rightmost header labeled 3290. Be sure the header is on in the correct orientation. Pin1 on the header should line up with the triangle marking on the board.

Power up your Raven board, either by external battery pack or the batteries included in the kit. We recommend that you start the programming process with fresh batteries.

Start AVR studio. You need not open a project. Select Program AVR from the Tools menu, as shown below:

Under the Main tab, Select JTAG mode and the Atmega3290p device. (Note, if you click Read Signature to verify the device it may report a WARNING: Signature does not match selected device.)

Under the Fuse tab, confirm the fuse settings. They should be:

Extended: 0xFF

High: 0x90

Low 0x62

Under the Program tab, check the boxes next to the Erase Device before programming and Verify Device after programming options.

In the flash section, browse to the Atmega3290p binary located at

Arch Rock/binaries/raven_telnet_shell/atmega3290p

Click the Program button.

Verify the programming succeeded with no error messages.

Detach the programming header

## 4.2 Programming the 1284p processor

Connect the JTAG programmer to the PC and connect the programming header to the left header labeled 1284. Be sure the header is on in the correct orientation. Pin1 on the header should line up with the triangle marking on the board.

In the Main tab, Select JTAG mode and the 1284p device.

Power up your Raven board, either by external battery pack or the batteries included in the kit. We recommend that you start the programming process with fresh batteries.

Under the Fuse tab, confirm the fuse settings. They should be:

Extended: 0xFF

High: 0x90

Low 0xE2

Under the Program tab, check the boxes next to the Erase Device before programming and Verify Device after programming options.

In the flash section, browse to the appropriate Atmega1284p binary located under

Arch Rock/binaries/raven_telnet_shell/atmega1284p/

Click the Program button.

Verify the programming succeeded with no error messages.

Detach the programming header

# 5 Running the demo software

## 5.1 Arch Rock 6LoWPAN Windows Service management GUI

Depending on what you have been doing previously, the Windows 6LoWPAN service may or may not be running. To check, right click on the My Computer icon and select Manage.

In the Computer Management window, click on the Services entry to reveal the currently running services. Right click on the Ach Rock 6LoWPAN service and select stop.

### 5.1.1 Insert the AVRRZUSBSTICK into the USB port and verify that the blue LED is lit

If the AVRRZUSBSTICK is already attached to the USB port; detach it, wait 5 seconds, and re-attach it.

The LED indicates that the AVRRZUSBSTICK is programmed.

### 5.1.2 Start the Arch Rock 6LoWPAN Service

### Right click on My Computer -> Manage. Arch Rock Arch Rock 6LoWPAN Service should be shown as running under the services category.

Note: You may stop the service by right clicking on the name of the service and choose stop; or you may restart the service by right clicking on the name of the service and choose restart

### 5.1.3 Navigate browser to http://localhost:7673

This shows a management view into your 6LoWPAN network.

### 5.1.4 In the upper right hand corner of the browser, verify that:

LoWPAN Channel = 26

LoWPAN ID = 34

If the settings shown in the browser do not match the above values, you may change them one of two ways:

1. Click on the Router Settings tab and enter the new values
2. Modify the conf/rosetta.conf file

You can also see your 6LoPWAN network in your Network Connections control panel.

You should see the Raven node join the 6LoWPAN network in the Routing Table tab.

Notice the IPv4 address of the node. Here is it 10.97.0.41.

## 5.2 Shell sample application

Start a windows command console

Type telnet <ip address of mote>, the IP address of the mote can be found in the Routing Table page of the web GUI You are now logged into your Raven.

Type ? at the shell prompt to see the list of commands available

1. lon - turn on the led
2. loff - turn off the led
3. lcd xxxx - display message xxxx on Raven's LCD
4. route - shows routing information
5. ifconfig – shows interface information
6. blink – blink the LED periodically with a pattern of N quick blinks
7. time – displays the number of seconds the Raven has been running (note that the start time is not zero, rather, it is 1/1/1970 in seconds)
8. temp – displays the reading of the temperature sensor onboard the raven (note that the temperature sensor readings are incorrect as long as JTAG is enabled)
9. exit - quit telnet session
10. ? - shows help

The IPv6 address that you see above is the link local address of the 6LoWPAN router.

# 6 Wireshark

Since Arch Rock mesh networks are IP based, not only can one use standard tools such as ping and telnet to interact with nodes in the network, one can also use standard diagnostic tools such as wireshark to debug the network.

The above screenshot shows the packet capture of a telnet session and a series on pings from a Windows machine to a Raven board. One simply has to install wireshark and start capture on “MS Loopback Interface”.

# 7 Known issues

1. Arch Rock 6LoWPAN Windows Service does not recover gracefully from removal of the AVRRZUSBSTICK. If the AVRRZUSBSTICK is removed, Arch Rock 6LoWPAN Windows Service needs to be restarted
2. Communication between AVRRZUSBSTICK and PC has lag; consequently, ping times are not great (500ms)

# 8 Troubleshooting

## 8.1 General troubleshooting comments

The AVRRZUSBSTICK must be flashed with the correct image and inserted in the USB port. The blue LED on the AVRRZUSBSTICK will turn on when the hardware is functioning correctly. The Arch Rock 6LoWPAN Windows Service must be started after the blue LED is on.

Note that out of the box the AVRRZUSBSTICK does not have the Arch Rock image flashed.

The Arch Rock 6LoWPAN Windows Service must be restarted after the AVRRZUSBSTICK has been detached from the USB port.

The proper way to reset the AVRRZUSBSTICK and Arch Rock 6LoWPAN Windows Service is to:

1. Detach the AVRRZUSBSTICK
2. Stop the Arch Rock 6LoWPAN Windows Service
3. Attach the AVRRZUSBSTICK
4. Verify that the blue LED on AVRRZUSBSTICK is lit
5. Start the Arch Rock 6LoWPAN Windows Service

## 8.2 The Management GUI does not load at all

Make sure the Arch Rock 6 LoWPAN Windows Service is started and the correct image for AVRRZUSBSTICK has been flashed on the hardware. The blue LED on the AVRRZUSBSTICK must be lit.

## 8.3 The “Router Settings” page does not display meaningful values

Restart the Arch Rock 6LoWPAN Windows Service, as described in section 3.1.2

## 8.4 The AVRRAVENx boards are not showing up in the network

Make sure that the channel and PAN ID shown in the management GUI matches the channel and PAN ID set in the AVRRAVENx firmware.

If you have more than one raven kit, make sure only one AVRRZUSBSTICK is on one channel at a time.

## 8.5 The connectivity to the AVRRAVENx boards is intermittent

Under the “Routing Table” tab in the management GUI, click on “Rebuild Routing Tree” to restore connectivity.

# 9 Support

Please visit http://support.archrock.com/asd for technical support and updates.