Laird WB45NBT User manual

A
Reference Guide
WB45NBT
Version 1.10

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
2
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
REVISION HISTORY
Version
Date
Notes
Approver
1.0
20 August 2013
Initial Version
Andrew Chen
1.1
22 August 2013
Minor revisions and formatting edits
Andrew Chen
1.2
28 July 2014
Minor edits for Rev 2 board
Andrew Chen
1.3
6 July 2015
Added Note regarding No Serial Output
Andrew Chen
1.4
6 August 2015
Added BT/BLE
Andrew Chen
1.5
27 April 2016
Removed references to connecting to an open AP by
default in the Automatic Remote Update section.
Mark Calhoun
1.6
07 July 2016
Changed bootstrap.bin references to at91bs.bin
Updated to new template
Doug Smith
1.7
10 April 2017
Added WB Security section
Andrew Dobbing
1.8
1 May 2017
OS Support. Removed SAM-BA section and directed to
app note at lairdtech.com
Jay White
1.9
7 June 2017
Updates to clarify lack of USB to Wi-Fi layer 2 bridging
support
Dan Kephart
1.10
17 Nov 2017
Updated DCAS authentication information
Andrew Dobbing

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
3
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
CONTENTS
1Introduction to the Laird WB45NBT Device ...................................................................................................... 4
2Product Description........................................................................................................................................... 4
3Software ............................................................................................................................................................ 4
3.1 WB45NBT Usage........................................................................................................................................ 5
4Configuring IP Based Connectivity..................................................................................................................... 5
4.1 Choosing an Interface to the WB .............................................................................................................. 5
4.2 Configuring the WB to Use Layer 2 Bridging or Layer 3 NAT..................................................................... 6
4.3 Choosing Layer 2 Bridge or Layer 3 NAT –Use Cases................................................................................ 6
4.4 WB Configurations –Use Case Examples .................................................................................................. 8
4.5 Activating the New WB Configuration..................................................................................................... 12
5Set Up –USB Ethernet on a Host PC................................................................................................................ 12
6Setting Up a PPP Link Over RS232 ................................................................................................................... 13
7Building the WB from Source .......................................................................................................................... 13
8Updating the WB50NBT Software ................................................................................................................... 14
8.1 Flash Programming Using fw_update ..................................................................................................... 14
8.2 Troubleshooting U-Boot .......................................................................................................................... 18
8.3 Flash Programming Using the Atmel SAM-BA Utility .............................................................................. 19
9Debugging........................................................................................................................................................ 19
9.1 Application Debugging ............................................................................................................................ 19
9.2 Connecting a Device or File to a Socket .................................................................................................. 19
9.3 Setting Up Stand-alone FTP, TFTP, and SSH servers................................................................................ 20
10 Breakout Board Schematic and BOM .......................................................................................................... 20
11 Developing and Integrating Using the Development Kit............................................................................. 20
11.1 Software Tools and Techniques............................................................................................................... 20
11.2 Finding Version Information.................................................................................................................... 21
12 Hardware Use Notes.................................................................................................................................... 21
12.1 GPIOs ....................................................................................................................................................... 21
12.2 Analog to Digital Converter ..................................................................................................................... 23
13 WB Security ................................................................................................................................................. 24
13.1 Solutions to Enhance Security ................................................................................................................. 24
13.2 Best Practices for Improving Wireless Network Security ........................................................................ 25
13.3 WB inetd and WB init-scripts .................................................................................................................. 25
WB inetd .......................................................................................................................................................... 25
WB init-scripts ................................................................................................................................................. 26
14 References ................................................................................................................................................... 28
15 More Information and Support ................................................................................................................... 28

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
4
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
1INTRODUCTION TO THE LAIRD WB45NBT DEVICE
The Laird WB45NBT wireless bridge module is a wireless communications subsystem that may be integrated into
a variety of host devices via a number of available electronic and logical interfaces.
Interfaces
Features
Specifications
▪Fast Ethernet
▪Serial UART
▪USB
▪SPI
▪I2C
▪80 pin board with mating
options
▪Mounting holes
▪ARM9 processor (396 MHz)
▪64 MB of LPDDR (Lower Power
DDR) memory
▪128 MB of NAND flash storage
▪Length: 40 mm
▪Width: 40 mm
▪Height: 3.8 mm
2PRODUCT DESCRIPTION
The Laird WB45NBT provides complete enterprise-class Wi-Fi connectivity with
an integrated TCP/IP stack, full support for IEEE 802.11a/b/g/n and Bluetooth 4.0
dual-mode air standards, and a fully integrated security supplicant providing
802.11i/WPA2 Enterprise authentication, data encryption, and BT protocol
stacks.
The WB45NBT is a fully integrated module with RF shielding and two U.FL type
antenna connectors. The Main antenna (for Wi-Fi) and the Auxiliary antenna (for
Bluetooth) work separately to get the best coexistence performance. Although
not currently supported, the third antenna connector multiplexes both the Wi-Fi
and Bluetooth signals into a single RF port through the use of a T/R switch.
Note: For additional information on the hardware aspects of the WB45NBT, please refer to the Hardware
Integration Guide download on the WB45NBT Product Page.
3SOFTWARE
The WB45NBT has 128 MB of NAND flash memory that is divided into partitions (see Table 1). It uses 4-bit ECC in
a 64 bit OOB area in each sector.
Table 1: Flash memory partitions
Image
Partition
Start
End
Size
MTD
Type
at91bs.bin
at91bs
0x00000000
0x0001FFFF
128 KB
/dev/mtd0
Raw binary
u-boot.bin
u-boot
0x00020000
0x0009FFFF
512 KB
/dev/mtd1
Raw binary
-
u-boot-env
0x000A0000
0x000BFFFF
128 KB
/dev/mtd2
U-boot env
-
redund-env
0x000C0000
0x000DFFFF
128 KB
/dev/mtd3
U-boot backup env
kernel.bin
kernel-a
0x000E0000
0x0035FFFF
2.5 MB
/dev/mtd4
Kernel image
kernel.bin
kernel-b
0x00360000
0x005DFFFF
2.5 MB
/dev/mtd5
Kernel image
rootfs.ubi
rootfs-a
0x005E0000
0x02BDFFFF
38 MB
/dev/mtd6
UBI
rootfs.ubi
rootfs-b
0x02BE0000
0x051DFFFF
38 MB
/dev/mtd7
UBI

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
5
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
N/A
user
0x051E0000
0x07EFFFFF
46 MB
/dev/mtd8
Raw
N/A
logs
0x07F00000
0x07F7FFFF
512 KB
/dev/mtd9
Raw
There are four basic types of binary images that can be programmed into the flash memory:
▪Bootstrap loader
▪U-boot boot loader
▪Linux kernel
▪Root filesystem
The flash partition layout allows for two kernel images (kernel-a and kernel-b), as well as two file system images
(rootfs-a and rootfs-b). This allows an update to an alternate image without disturbing the currently running
system. Additionally, if something goes awry with the newly updated image, the original image is still available.
The update program is intelligent enough to program the correct partition (the one which is not currently being
run).
The filesystem is stored using a format called Unsorted Block Images (UBI). This is a filesystem that lies on top of
the Memory Technology Device (MTD) layer. The MTD layer handles bad block mapping. When a bad block is
encountered, it is simply skipped and not used. As new bad blocks occur, they are marked as such and handled
properly between the MTD and UBI file system. The UBIFS handles wear-leveling.
3.1 WB45NBT Usage
One of the main applications of the WB is to enable Wi-Fi on your host device using one of the available
interfaces of the WB module. This section describes how to do this from a Linux environment.
The quickest way to start controlling the WB is through the built-in Linux command line interface (CLI). The WB's
CLI can be accessed via the DEBUG UART (settings: 115200 8N1) or via Secure Shell (ssh). ssh logins can be
accepted on Ethernet (IP address assigned via DHCP –see your local DHCP server for address) or via USB
Ethernet at IP address 192.168.3.1 port 22.
Once CLI access is available, configuration files on the device can be examined or modified.
4CONFIGURING IP BASED CONNECTIVITY
This section covers enabling your host device to communicate over Wi-Fi via the WB. The predominant use cases
involve using the WB as Ethernet to Wi-Fi, USB to Wi-Fi, or Serial PPP (RS232) to Wi-Fi peripherals. These use
cases allow normal IP network connectivity via the WB’s Wi-Fi interface. We’ll explain these use cases in this
guide, but they aren’t the only ones available; more complex configurations are also possible. Please contact
Laird support if you have a use case this is not covered in this document.
4.1 Choosing an Interface to the WB
The first consideration in configuring the Wi-Fi connectivity is what interface will be used between the host
device and the WB. The most common three options are Ethernet, USB Ethernet, and Serial (RS232). Each of
these cases has the host device sending and receiving IP packets and the WB forwarding packets to and from the
Wi-Fi interface once connected.
▪Ethernet –Refers to the standard 802.3 Ethernet.
▪USB connectivity –We recommend setting up the WB to enable USB CDC Ethernet (also known as USB
Gadget Ethernet). Then installing the proper drivers on the host device. This allows the WB to appear as a
standard Ethernet network device.

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
6
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
▪Serial (RS232) –We recommend setting up PPP over serial on the WB and the host device and enabling IP
over PPP. Optionally, the host device can send raw byte data to a UART on the WB and the WB can
forward that data bi-directionally to a TCP socket via the built in socat program.
4.2 Configuring the WB to Use Layer 2 Bridging or Layer 3 NAT
The second consideration in configuring Wi-Fi connectivity is whether to configure the WB to act as a Layer 2
Bridge or a Layer NAT device.
4.2.1 Layer 2 Bridge
When configured as a Layer 2 bridge, the WB acts as a transparent bridge for Layer 2 packets carrying an IP-
based packet from the host device. The WB expects the host to do all Layer 3 IP configuration such as static
addressing or DHCP for the Wi-Fi network. This mode applies to Ethernet to Wi-Fi. In the Layer 2 Bridge
configuration, it appears to the host device that it is connected to a physical network.
4.2.2 Layer 3 NAT
When configured to do Layer 3 NAT, the WB is configured to run a DHCP client or have a static IP address on the
WB’s Wi-Fi interface. In this configuration, a static non-routable IP address is assigned on the host device’s
communication interface and the corresponding interface on the WB. Port NAT and IP masquerading would then
enable seamless communication from the host interface to the Wi-Fi network. This mode applies to Ethernet to
Wi-Fi, USB Ethernet to Wi-Fi, and Serial PPP to Wi-Fi. Seven common use cases are detailed that describe the WB
configured as a bridge or NAT device.
Note: Please contact Laird support if you have a use case not covered here in this document.
4.3 Choosing Layer 2 Bridge or Layer 3 NAT –Use Cases
4.3.1 Use Case 1
A single host device with a DHCP client for Wi-Fi on the host device’s Ethernet to the WB.
This is often used when the WB if functioning as an Ethernet to Wi-Fi dongle on an existing product where the
Ethernet is set up to use DHCP.
▪Solution: Bridging
The WB acts as a transparent bridge between the Ethernet and Wi-Fi.
▪Caveats:
It should send a ping packet or other IP packet from the host device’s interface to the WB once a new IP
address has been assigned to register the host device with the WB’s bridge code. Otherwise, the bridge
may not forward incoming Wi-Fi packets to the host device.
In addition, this configuration is not able to renew DHCP on a roam without software using SDK Events to
alert the host device to trigger DHCP on a roam. This is only an issue for networks configured with multiple
subnets on the same SSID (determine if your customers do this).
See Single Host Device with DHCP running on the WB for NAT Configuration to solve this issue.
Use Case 1 Example

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
7
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
4.3.2 Use Case 2
A single host device with a static IP for Wi-Fi on the host device’s Ethernet to the WB
The IP address that is used on the Wi-Fi network is statically assigned by the host device. This is often the case
when using the WB as an Ethernet to Wi-Fi dongle on an existing product where the Ethernet was set up to use
static IP addresses.
▪Solution: Bridging
The WB acts as a transparent bridge between the Ethernet and Wi-Fi.
▪Caveats:
It should send a ping packet or other IP packet from the host device’s interface to the WB using static IP
address to register host device with WB’s bridge code. Otherwise the bridge may not forward incoming
Wi-Fi packets to the host device.
Use Case 2 Example
4.3.3 Use Case 3
A single host device with DHCP running on the WB’s Wi-Fi interface
A single device is connected to the Ethernet, USB Ethernet, or PPP serial; a DHCP client is running on the WB to
handle the Wi-Fi DHCP assignment.
▪Solution: NAT
The WB does IP NAT and port masquerading to forward traffic from the Wi-Fi to host device. Host device
interface to the WB along with the corresponding WB interface should be assigned a non-routable
169.254.x.x IP address. The WB does a DHCP request on roam to support networks configured with
multiple subnets on the same SSID (determine if your customers do this).
Use Case 3 Example
4.3.4 Use Case 4
A single host device with a static IP on the WB’s Wi-Fi interface
▪Solution: NAT
The WB does IP NAT and port masquerading to forward traffic from Wi-Fi to the host device. The host
device interfaces to the WB, along with the corresponding WB interface, should be assigned a non-
routable 169.254.x.x IP address.
Use Case 4 Example
4.3.5 Use Case 5
Multiple host devices connected via Ethernet with DHCP running on the WB’s Wi-Fi interface
▪Solution: NAT
The WB does IP NAT and port masquerading to forward traffic from the Wi-Fi to each host device. Host
device interfaces to the WB along with the corresponding WB interface should be assigned non-routable
169.254.x.x IP addresses. The WB does a DHCP request on roam to support networks configured with
multiple subnets on the same SSID (determine if your customers do this).
Use Case 5 Example

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
8
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
4.3.6 Use Case 6
Multiple host devices connected via Ethernet with a static IP on the WB’s Wi-Fi interface
▪Solution: NAT
The WB does IP NAT and port masquerading to forward traffic from Wi-Fi to each host device. Host device
interfaces to the WB, along with the corresponding WB interface, should be assigned non-routable
169.254.x.x IP addresses. The WB does a DHCP request on roam to support networks configured with
multiple subnets on the same SSID (determine if your customers do this).
Use Case 6 Example
4.3.7 Use Case 7
Multiple host devices connected via Ethernet with DHCP running or a static IP on each host device interface
to the WB
▪Solution: Use NAT instead
We recommend that you use a NAT-based configuration instead. The WB does not currently support this
use case in the standard release. If this use case is required, please contact Laird with complete details of
the use case for potential customized options.
Use Case 7 Example
4.4 WB Configurations –Use Case Examples
Each example configuration uses a combination of the sdc_cli command line utility, the ifrc command line utility,
and editing the /etc/network/interfaces file. These can be done once console access has been established with
the WB as described in the WB45NBT Quick Start Guide (available from the Documentation tab of the Laird
WB45NBT product page). These configurations are only examples for the WB’s configuration. Example host test
device configurations are described in the following section to complete early testing.
Note: Editing of the /etc/network/interfaces file should be done with vi. To learn how to use vi as an
editor, there are many online tutorials.
To begin editing, execute the following:
# vi /etc/network/interfaces
Note: The following examples describe how to enable Ethernet to Wi-Fi connectivity. In these cases, the
Ethernet interface is referred to as eth0. To enable USB Ethernet to Wi-Fi, substitute eth0 with
usb0 and for PPP Serial to Wi-Fi substitute eth0 with ppp0. The Wi-Fi interface is wlan0 in the
examples.
4.4.1 Use Case 1 Example
A single host device with a DHCP client for Wi-Fi on the host device’s Ethernet to the WB.
Enable the Ethernet interface and make sure it doesn’t use an IP configuration:
# sdc_cli iface set auto eth0 on
# sdc_cli iface set method eth0 manual

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
9
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Enable the Wi-Fi interface and make sure it doesn’t use an IP configuration:
# sdc_cli iface set auto wlan0 on
# sdc_cli iface set method wlan0 manual
Enable bridging between Ethernet and Wi-Fi:
# sdc_cli iface set auto br0 on
# sdc_cli iface set method br0 manual
# sdc_cli iface set bridge_ports br0 eth0 wlan0
Optional: If IP communication between the WB and host device for configuration or otherwise is desired, then
additional IP configuration should be enabled on the bridge interface (br0):
# sdc_cli iface set method br0 static
# sdc_cli iface set address br0 169.254.0.1
# sdc_cli iface set netmask br0 255.255.255.0
# sdc_cli iface set broadcast br0 169.254.0.255
4.4.2 Use Case 2 Example
A single host device with a static IP for Wi-Fi on the host device’s Ethernet to the WB
Enable the Ethernet interface and make sure it doesn’t use an IP configuration:
# sdc_cli iface set auto eth0 on
# sdc_cli iface set method eth0 manual
Enable the Wi-Fi interface and make sure it doesn’t use an IP configuration:
# sdc_cli iface set auto wlan0 on
# sdc_cli iface set method wlan0 manual
Enable bridging between Ethernet and Wi-Fi:
# sdc_cli iface set auto br0 on
# sdc_cli iface set method br0 manual
# sdc_cli iface set bridge_ports br0 eth0 wlan0
Optional: If IP communication between the WB and host device for configuration or otherwise is desired, then
additional IP configuration should be enabled on the bridge interface (br0):
# sdc_cli iface set method br0 static
# sdc_cli iface set address br0 169.254.0.1
# sdc_cli iface set netmask br0 255.255.255.0
# sdc_cli iface set broadcast br0 169.254.0.255
4.4.3 Use Case 3 Example
A single host device with DHCP running on the WB’s Wi-Fi interface

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
10
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Enable the Ethernet interface and configure a non-routable IP configuration:
# sdc_cli iface set auto eth0 on
# sdc_cli iface set method eth0 static
# sdc_cli iface set address eth0 169.254.0.1
# sdc_cli iface set netmask eth0 255.255.255.0
# sdc_cli iface set broadcast eth0 169.254.0.255
Enable the Wi-Fi interface with DHCP client support:
# sdc_cli iface set auto wlan0 on
# sdc_cli iface set method wlan0 dhcp
Enable NAT between Ethernet and Wi-Fi by editing /etc/network/inferfaces. The stanza starting with auto eth0
should have an uncommented out post-cfg-do and pre-dcfg-do sections like the following:
## Wired
auto eth0
iface eth0 inet static
…
…
post-cfg-do /etc/network/wifi-nat.conf
pre-dcfg-do /etc/network/wifi-nat.conf
4.4.4 Use Case 4 Example
A single host device with a static IP on the WB’s Wi-Fi interface
Enable the Ethernet interface and configure a non-routable IP configuration:
# sdc_cli iface set auto eth0 on
# sdc_cli iface set method eth0 static
# sdc_cli iface set address eth0 169.254.0.1
# sdc_cli iface set netmask eth0 255.255.255.0
# sdc_cli iface set broadcast eth0 169.254.0.255
Enable the Wi-Fi interface with static IP support:
# sdc_cli iface set auto wlan0 on
# sdc_cli iface set method wlan0 static
# sdc_cli iface set address eth0 x.x.x.x
# sdc_cli iface set netmask eth0 x.x.x.x
# sdc_cli iface set broadcast eth0 x.x.x.x
# sdc_cli iface set nameserver eth0 x.x.x.x
Enable NAT between Ethernet and Wi-Fi by editing /etc/network/inferfaces. The stanza starting with auto eth0
should have an uncommented out post-cfg-do and pre-dcfg-do sections like the following:
## Wired
auto eth0

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
11
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
iface eth0 inet static
…
…
post-cfg-do /etc/network/wifi-nat.conf
pre-dcfg-do /etc/network/wifi-nat.conf
4.4.5 Use Case 5 Example
Multiple host devices connected via Ethernet with DHCP running on the WB’s Wi-Fi interface
Enable the Ethernet interface and configure a non-routable IP configuration:
# sdc_cli iface set auto eth0 on
# sdc_cli iface set method eth0 static
# sdc_cli iface set address eth0 169.254.0.1
# sdc_cli iface set netmask eth0 255.255.255.0
# sdc_cli iface set broadcast eth0 169.254.0.255
Enable the Wi-Fi interface with DHCP client support:
# sdc_cli iface set auto wlan0 on
# sdc_cli iface set method wlan0 dhcp
Enable NAT between Ethernet and Wi-Fi by editing /etc/network/inferfaces. The stanza starting with auto eth0
should have an uncommented out post-cfg-do and pre-dcfg-do sections like the following:
## Wired
auto eth0
iface eth0 inet static
…
…
post-cfg-do /etc/network/wifi-nat.conf
pre-dcfg-do /etc/network/wifi-nat.conf
4.4.6 Use Case 6 Example
Multiple host devices connected via Ethernet with a static IP on the WB’s Wi-Fi interface
Enable the Ethernet interface and configure a non-routable IP configuration:
# sdc_cli iface set auto eth0 on
# sdc_cli iface set method eth0 static
# sdc_cli iface set address eth0 169.254.0.1
# sdc_cli iface set netmask eth0 255.255.255.0
# sdc_cli iface set broadcast eth0 169.254.0.255
Enable the Wi-Fi interface with static IP support:

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
12
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
# sdc_cli iface set auto wlan0 on
# sdc_cli iface set method wlan0 static
# sdc_cli iface set address eth0 x.x.x.x
# sdc_cli iface set netmask eth0 x.x.x.x
# sdc_cli iface set broadcast eth0 x.x.x.x
# sdc_cli iface set nameserver eth0 x.x.x.x
Enable NAT between Ethernet and Wi-Fi by editing /etc/network/inferfaces. The stanza starting with auto eth0
should have an uncommented out post-cfg-do and pre-dcfg-do sections like the following:
## Wired
auto eth0
iface eth0 inet static
…
…
post-cfg-do /etc/network/wifi-nat.conf
pre-dcfg-do /etc/network/wifi-nat.conf
4.4.7 Use Case 7 Example
Multiple host devices connected via Ethernet with DHCP running or a static IP on each host device interface
to the WB
Laird recommends to use a NAT-based configuration instead. The WB does not currently support this use case in
the standard release. If this use case is required, please contact Laird with complete details of the use case for
potential customized options.
4.5 Activating the New WB Configuration
To activate the new configuration, two method can be used:
▪Activate via a reboot
# reboot
▪Activate without a reboot
# ifrc restart
5SET UP –USB ETHERNET ON A HOST PC
From a PC running Ubuntu 14.04, you must configure the usb-ethernet host device settings.
Note: The IP address of the USB Ethernet connection is 192.168.3.1. When configuring the host interface
the IP address assigned to the host must be on the same subnet.
Once the USB cable is plugged in, the Linux OS should recognize and load the USB Ethernet driver. Ensure that
the USB Ethernet interface is being used for bridging the Wi-Fi on the WB50 to the host by removing any
Ethernet cables and disabling any Wi-Fi interfaces on your host PC. To do this, left-click the network icon in the
upper right corner on the task bar and un-check Enable Wi-Fi.
To set the IP address on the USB Ethernet device to be compatible with the WB50, follow these steps:

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
13
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
1. Left-click the Network Manager icon on the task bar and select Edit connections.
2. From the Ethernet list, select the Wired connection interface.
3. Click Edit..
4. In the Editing Wired connection window, select the IPv4 Settings tab.
5. From the Method list, select Manual.
6. Click Add.
7. Change the address settings to the following:
Address: 192.168.3.2
Netmask: 255.255.255.0
Gateway: 192.168.3.1
DNS servers: 8.8.8.8
8. Click Save and Close.
If your WB was set up with a profile and connected to a local AP, you should now be connected to the network
via the Wi-Fi. Verify by opening your browser and navigating to a resource on the network or, if the network has
access to the Internet, navigate to our website: http://www.lairdtech.com/
6SETTING UP A PPP LINK OVER RS232
The WB50NBT may be configured as a Wi-Fi peripheral using a PPP (point-to-point) link over RS232. The USB to
RS232 cable is required for this example. On the WB, use the sdc_cli to create and activate a wireless profile.
Once a Wi-Fi connection has been established, attach the DB9 connector of the cable to the BB40 (use the port
on the BB40 labeled UART0 which is /dev/ttyS2) and the USB connector to the host.
See the examples for use cases 3 and 4; substitute ppp0 to configure the WB for PPP over RS232.
Next, you must set up your host machine.
Enter the following command into the Linux terminal:
# /usr/sbin/pppd 192.168.0.2:192.168.0.1 /dev/ttyUSB1 230400
Note: Your USB interface may be different.
7BUILDING THE WB FROM SOURCE
The WB50NBT utilizes Buildroot to build the entire system. Laird's WB50NBT source release package provides
everything necessary to build and customize a WB image for your application and hardware system. WB source
releases are distributed on GitHub.
Please go to GitHub for both the source release and the instructions for working with it:
https://github.com/LairdCP/wb-manifests
Requirements:
▪Linux system capable of building Buildroot
▪Internet access
Recommended:
▪Ubuntu 14.04 LTS

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
14
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Details on the system requirements for using Buildroot can be obtained from the Buildroot User Manual.
(http://buildroot.uclibc.org/downloads/manual/manual.html#requirement)
Complete information on Buildroot is also available with the Buildroot User Manual.
(http://buildroot.uclibc.org/downloads/manual/manual.html)
8UPDATING THE WB50NBT SOFTWARE
There are various methods of updating the software on the WB. Once you’ve completed a build with the
buildroot framework or have downloaded the binary image files, there are three options for programming them
onto the WB50NBT:
▪Linux: Use the fw_update utility on the WB.
▪UBoot: Flash the images from the u-boot environment shell.
▪SAM-BA: Use the external sam-ba utility if there is no image present on the WB or the system has become
corrupted.
8.1 Flash Programming Using fw_update
The fw_update program is run via the Linux shell in either of two ways:
▪Automatic –During bootup, if using a DHCP server that also sends a Bootfile-Name option along with the
IP address. The option value is set to the URL of the images server.
▪Manual –The fw_update program can be invoked manually over the WB's Linux command line interface
(CLI).
In all cases, fw_update requires an fw.txt file to describe the image files available via locally-attached media
(such as a USB flash drive or SD card); or via remote network server (anonymous https, http, and ftp are
supported). The program has built-in help and examples which can be viewed with:
# fw_update –h
# fw_update --usage
# fw_update --usage fw.txt
The fw_update program can be invoked from the CLI. You can obtain access to the CLI either through the
console serial port or over a network connection, via Ethernet or a USB Ethernet gadget, with the use of SSH. By
default, an SSH server is enabled on the WB50NBT. The username is root and the password is summit. It’s
important that the password is changed to something different in the filesystem of the end product.
For example: If updating from a USB flash drive:
Load the image components and the fw.txt file onto a USB or mmc/SD drive. Insert the drive into the
appropriate port on the BB50 breakout board. The media drive is auto-mounted to the directory /media/usb0.
# fw_update /media/usb0/fw.txt
The path of the image files on the USB drive can be specified on the fw_update command line; a path with
spaces is not supported. For example:
# fw_update /media/usb0/directory_path/fw.txt
... when the files are stored on the USB drive in /directory_path/.

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
15
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
8.1.1 fw_update via Network
fw_update can also be used over a wireless connection if the image files are placed on a web or ftp server. For
example:
# fw_update http://<url of server>/<path>/fw.txt
8.1.2 Remote Update Requirements
To use the Remote Update capability of the WB45NBT, three pieces of hardware must to be in place:
▪Wi-Fi Access Point
▪Linux server running DHCP and either HTTP or FTP
▪WB45NBT unit to be updated
8.1.2.1 Wi-Fi Access Point
If this is the first time the WB45NBT module is updated, then the AP must be configured for open access. This
ensures that the WB45NBT can obtain a wireless network connection without having to be pre-programmed
with a specific SSID and password. Make sure that there are no other APs around that the WB45NBT may
inadvertently attach to during this update procedure.
Subsequent updates can be scheduled with a prescribed, secured AP but the corresponding profile must first be
created in the unit using the CLI.
8.1.2.2 Linux Server
The server must offer DHCP and either HTTP or FTP file services.
The DHCP server must be configured to send an additional parameter called a DHCP Option. The DHCP Option
specifies a Bootfile-Name (DHCP option #67). The Bootfile-Name is a URL of a text file that further describes the
images to be updated (the 'Bootfile'). More information on the bootfile can be found later in this document.
The update program uses the wget utility to fetch the remote updates from the file server over the network. It
supports both HTTP and FTP protocols.
8.1.2.3 Laird WB45NBT
The WB45NBT must be connected to a power source and have a Wi-Fi antenna connected to it.
8.1.3 Bootfile Description
The bootfile (called fw.txt) is a list of all images that are to be updated on the WB45NBT. It resides on the file
server and is pointed to by the Bootfile-Name option in the DHCP Server’s configuration.
The format of the bootfile is as follows:
06c73bb2c38f6bd0ecde4b2308595adc at91bs.bin 11444
c55870dce9de3347950987b135a9fcd3 u-boot.bin 359032
5f7f5ebb4717250cdf565e20049debbe kernel.bin 2091686
479d3828243c3712efd9a14ecfefb96e rootfs.bin 23592960
It is not required to list all four images in this file. If only a subset of these images is required to be upgraded,
then only list those particular image files. Each line has three elements:

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
16
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
▪MD5SUM of image file
▪Name of the image file
▪Length of the image file in bytes
8.1.3.1 Remote Update Methodology
The remote update can be performed automatically using DHCP or manually, using the fw_update program on
the WB45NBT. Both methods are described in the following sections.
8.1.3.2 Automatic Remote Update
This section describes the default behavior of the WB45NBT firmware supplied by Laird.
After associating with an AP, the WB45NBT sends out a DHCP request. The DHCP server must respond with an IP
address and a Bootfile-Name. The WB45NBT detects if it has received this optional DHCP information. If it does,
it proceeds with the fw_update program using the information in the bootfile to update its flash memory. If the
MD5SUM of the components listed in the bootfile match what is already on the device, then nothing is updated
and the WB45NBT continues to run normally.
After all the updates are complete, the bootloader is made aware of the new kernel and/or filesystem and loads
these new images on the next reboot. The WB45NBT reboots into the newly updated system automatically after
the update process is complete.
8.1.3.3 Manual Remote Update
The fw_update program can be invoked from the CLI. Access to the CLI can be obtained either through the serial
port or over a network connection through the use of SSH. By default, an SSH server is enabled on the
WB45NBT. The username is root and the password is summit. It is important that the password is changed to
something different in the filesystem of the end product.
When manually starting the fw_update program, the URL for the fw.txt file must be supplied as an argument to
the fw_update program. For example:
fw_update http://192.168.1.10/wb45n/fw.txt
Note: WB45NBT requires a valid IP address before it can fetch the image files from the network. If the
WB45NBT is configured as a bridge (which may not have an IP address), then it must be configured
with a valid IP address on its network interface before running the fw_update program. This can be
done by stopping the bridging (/etc/network/bridge.sh stop) and then using udhcpc -i wlan0 or the ifrc
utility to configure the IP address settings of the wireless interface.
After the update program has completed its process, the bootloader becomes aware of the new kernel and/or
filesystem. The new images are loaded on the next reboot. Issue the reboot command to reboot the WB45NBT.
When invoked manually, the fw_update program does not automatically reboot the WB45NBT after it has
completed updating the device.
8.1.3.4 Limitations
These methods of updating are destructive to existing data on the device because existing data in the flash
memory of the WB45NBT is overwritten by the new image.

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
17
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
There cannot be a second DHCP server which could respond to the DHCP request sent out by the WB45NBT. This
would create a situation where an intended update may not take place.
Currently, boot failures are not automatically handled by the default software.
Flash Programming Using U-boot Shell
If the WB45NBT module already has both the bootstrap and U-Boot programmed into it, then U-Boot may be
used to load binary images as an alternative to SAM-BA. To use U-Boot to program flash memory, an Ethernet
connection must be available and the binary images must be available over the network from a TFTP server.
U-Boot supports the Ethernet interface (not the wireless interface) for downloading images. For this reason, it is
necessary to have the WB45NBT plugged into the breakout board, so that the RJ45 Ethernet connection is
available. This method of programming also requires that a TFTP server exists on the local network, and that it
has the binary images that are required for the programming procedure.
To get into the command prompt of U-Boot, connect a serial line from the Debug UART to a PC running a
terminal program, such as Tera Term. Tera Term may be obtained from: http://ttssh2.sourceforge.jp/
The serial interface should be configured for 115200 baud, no parity, 8 data bits, 1 stop bit (N81), and no
handshaking. When the WB45NBT is powered up, the serial terminal displays some bootloader messages. At this
point, press Enter several times; the following command prompt will appear:
U-Boot>
Note: If U-Boot does not see any key press, then it automatically boots the operating system after a one
second delay.
At this point, U-Boot may be used to update itself, the bootstrap loader, the Linux kernel, or the file system. Any
one of these items may be updated, and they do not all necessarily need to be updated at the same time.
However, because of compatibility, it is good to ensure that the Linux kernel and the file system are intended to
work together (from a relatively similar release, if not the same release version).
The process of updating a flash image using U-Boot is comprised of downloading the image to be programmed
into local SDRAM of the WB45NBT, erasing the flash at the target memory location, and then copying the
contents of SDRAM to flash memory.
Preparing for using network and tftp:
set autoload no
dhcp
set serverip <ip-address-of-tftp-server>
To update the bootstrap loader, follow these commands:
tftp at91bs.bin
protect off all
nand erase 0x00000000 0x00020000
nand write 0x22000000 0x0 ${filesize}
To update U-Boot, follow these commands:

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
18
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
tftp u-boot.bin
nand erase 0x20000 0x80000
nand write 0x22000000 0x20000 ${filesize}
To update the Linux kernel, follow these commands:
tftp kernel.bin
nand erase 0x000e0000 0x00280000
nand write 0x22000000 0x000e0000 ${filesize}
To update the file system, follow these commands:
tftp rootfs.ubi
nand erase 0x005e0000 0x02600000
nand write.trimffs 0x22000000 0x005e0000 ${filesize}
To reset the system from the U-Boot prompt, type reset and press Enter.
8.2 Troubleshooting U-Boot
If it is not known whether or not a WB45NBT module has a boot loader programmed into it, the presence of a
boot loader can be determined by examining the serial data from the Debug UART at power-on. This serial
interface runs at 115200 baud, no parity, 8 data bits, 1 stop bit, and no hardware handshaking. The boot loader
displays text that is similar to the following:
# RomBOOT
ba_offset = 0xb ...
Loading 1-Wire info...
Enumerate all roms:
Done, 0x0 1-wire chips found!
sn: 0x0; rev: 0x0
AT91Bootstrap 3.4.4-laird2 ( Mon Jul 29 17:36:14 PDT 2013 )
Downloading image...
Nand: ONFI not supported
NAND device: NAND 128MiB 1,8V 8-bit, Manufacturer ID: 0x0 Chip ID: 0xa1
Nand: Copy 0x80000 bytes from 0x20000 to 0x23f00000
Done!
U-Boot 2013.01-laird2-00003-gba48fda (Jul 29 2013 - 17:36:18)
CPU: AT91SAM9G25
Crystal frequency: 12 MHz
CPU clock : 400 MHz
Master clock : 133.333 MHz
DRAM: 64 MiB
WARNING: Caches not enabled
NAND: 128 MiB
MMC: mci: 0
In: serial
Out: serial

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
19
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Err: serial
Net: macb0
Hit any key to stop autoboot: 0
If only RomBOOT displays, then the boot loader is not installed (flash is empty or the bootstrap loader is
corrupt). If nothing displays, check the serial connection and verify that the WB45NBT is properly powered.
8.3 Flash Programming Using the Atmel SAM-BA Utility
It is possible to program the bootloader images only into the WB50NBT using SAM-BA. Details on this procedure
are in the application note Flash Programming using the Atmel SAM-BA Utility. This application note is available
from the Documentation tab of the Laird WB45NBT product page.
9DEBUGGING
9.1 Application Debugging
The GNU Debugger (gdb) is loaded onto the WB45NBT file system by default. It can be used to debug userspace
applications.
gdb <application_name>
Type rand then press Enter.
▪To stop execution at any time, press CTRL-C.
▪To single step, type sand press Enter.
▪To get a backtrace of the stack, type bt and press Enter.
▪To exit the debugger, type quit.
The System Trace utility (strace) is also loaded onto the file system. This utility traces an application's system
calls into the Linux operating system.
strace
Another utility worth mentioning is devmem. This allows physical memory locations to be accessible to
userspace. It works by mmap()ing regions of memory into user space so that they may be accessed directly. It is
similar to a peek/poke utility.
9.2 Connecting a Device or File to a Socket
In many instances, it may be desirable to directly connect a device or file to a socket. This may be done with a
tool called Socat. Socat allows the creation of bidirectional byte streams that may be connected to sockets
and/or devices within Linux.
Below is a simple application (using Socat) to connect a TCP socket to an external UART. The following example
command demonstrates how to establish the Socat link between the device so that Linux forwards all incoming
UART data (on ttyS1) over the socket connection and vice versa.
To use Socat to connect TCP port 1234 to the UART running on /dev/ttyS1, use the following:
# socat tcp-l:1234,reuseaddr,fork file:/dev/ttyS1

WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
20
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
9.3 Setting Up Stand-alone FTP, TFTP, and SSH servers
Set up inetd to start FTP, TFTP, and SSH servers on demand. See /etc/inetd.conf. It is also possible to start each
of these as their own full service. The init scripts are also contained in /etc/init.d/opt:
/etc/init.d/opt/S50proftpd
/etc/init.d/opt/S50sshd
/etc/init.d/opt/S50tftpd
10 BREAKOUT BOARD SCHEMATIC AND BOM
The Breakout Board schematic and BOM (Bill of Materials) are available from the Laird website.
11 DEVELOPING AND INTEGRATING USING THE DEVELOPMENT KIT
There are many helpful tools and hints to developing software and integrating hardware with the WB45N.
11.1 Software Tools and Techniques
11.1.1 GDB
GDB is a debugger that can be run directly on the WB45N.
11.1.2 devmem
The program devmem can be used to read or set any arbitrary physical address on the system. It is particularly
useful for inspecting the state of the Atmel processor's special function registers when trying to debug drivers,
device trees, or other kernel code.
# devmem
BusyBox v1.21.1 (2013-07-29 17:17:51 PDT) multi-call binary.
Usage: devmem ADDRESS [WIDTH [VALUE]]
Read/write from physical address
ADDRESS Address to act upon
WIDTH Width (8/16/...)
VALUE Data to be written
# devmem 0xFFFFF818 32
0x00004100
The above example shows the PIO_OSR (Output Status Register) for PIOC. Note that pc8 and pc14 are
configured as GPIO outputs.
11.1.3 sysfs
Linux can present data about the system and drivers by using sysfs (system file-system). The entire tree can be
found mounted at /sys and through various virtual files, you can read information about the kernel, drivers, and
hardware of the system. By writing to various files, you can cause the drivers or kernel to take various actions.
Other manuals for WB45NBT
2
Table of contents
Other Laird Wireless Router manuals