Configuration Guide

Doodle Labs Smart Radio Advanced MIMO Mesh in a tiny Form Factor

Introduction The Smart Radio runs a customized version of Openwrt with enhancements related to the Doodle Labs Mesh Rider® technology. These enhancements are useful for applications requiring low-latency command-and- control transmission and high-throughput video - e.g. UAV and robotics.

The purpose of this guide is to aide a programmer in re-configuring common Smart Radio settings once it is deployed in the field. A full technical discussion of all of the different configuration parameters of the Openwrt system is beyond the scope of this guide, and the user is encouraged to explore the OpenWrt website.

Smart Radio Configuration Overview Factory Configuration By default, the Smart Radio is configured to connect to a mesh network as shown in the diagram in the next section. There are two networks configured in each Smart Radio. The first is the mesh network, and the second is the configuration network.

• The mesh network consists of all Smart Radios and host platforms which join the mesh. ETH0 is bridged to the mesh network. The is set up to allow input access using SSH or the web GUI. The mesh network has two IP addresses. o The first is a DHCP client. o The second is a static IP address equal to 10.223.x.y where x.y is the last four hexadecimal digits of the wireless MAC address. For example, a unit shipped with MAC address 00301A4E7AB0 has the last four HEX digits 7AB0 and x.y is equal to 122.176. • The configuration network is meant to include only the Smart Radio and the host platform it is connected to via ETH1. The firewall is setup to allow all input access and it is designed to be a configuration port. o It has a static IP address equal to 192.168.1.1 and is not bridged to the mesh.

The Smart Radio can be accessed over the command line with user@host-pc:~$ ssh root@ or using a web browser at the same IP address. depends on whether you are connected to ETH0 or ETH1. In Windows, use the PuTTY client. No password is set by default, and after setting one up, it is possible to setup public-key authentication following this guide.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 1 Configuration Guide

SSL Certificate Warning Newer revisions of the Doodle Labs Smart Radio firmware use HTTPs for web access to the Smart Radio. The SSL certificate is self-signed, and therefore, the first time you access the Smart Radio from a new browser, you will get a SSL certificate warning. It is okay to ignore the warning and proceed. Supported Network Configurations (Simple Config) The Smart Radio supports several different network configurations using the Simple Config menu. The Simple Config menu is accessed in the web GUI at network → simple config.

• Mesh • Mesh Gateway • WDS Access Point • WDS Client • WDS Access Point Gateway • Multi-Radio Mesh

In the following descriptions of the supported network configurations, ETH1 is not used. As mentioned in the section above, ETH1 is only attached to the configuration network of the Smart Radio. Mesh Configuration The diagram below shows the mesh configuration. This is the factory setting of the Smart Radio.

In this configuration, a Router is connected to one of the Smart Radios at ETH0, which acts as an Gateway for the mesh. The Router runs a DHCP server which provides IP addresses to all of the host devices in the mesh. In the absence of the Gateway Router, the user will need to manually enable the embedded DHCP server in one of the Smart Radios or assign static IP addresses to the host devices in the 10.223.0.0/16 network. Mesh mode requires a small protocol overhead which makes it less responsive than WDS AP/Client mode. Therefore, if mesh is not required, we suggest switching to WDS AP/Client mode.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 2 Configuration Guide

Mesh Gateway Configuration In the configuration above, a router was used to create a network for the Smart Radio mesh. The Smart Radio also includes a gateway mode which obviates the need for a router. The network diagram is shown below.

The Smart Radio in gateway mode (on the right) configures the network with a 10.223.0.0/16 IP address range and acts as a DHCP server. All other Smart Radios are in normal mesh mode. In order to access the gateway device, either access it wirelessly, or connect to ETH1 and use the 192.168.1.0/24 subnet. WDS AP/Client mode The WDS AP/Client network diagram is shown below. In WDS mode, traffic is bridged transparently between the router and the end device. As in the standard mesh mode, IP addresses are provided by the DHCP server running in the external router. The pre-defined static IP addresses of the Smart Radios are still active. WDS AP/Client mode establishes a star network topology which means that all communications must go through a central controller. If mesh is not required, we recommend this mode since it is typically more responsive.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 3 Configuration Guide

WDS Gateway Mode WDS Gateway mode is an extension of the WDS AP/Client mode where the WDS AP is also an internet gateway. The WDS AP Gateway runs a DHCP server and performs NAT between the local 10.222.0.0/16 subnet and the wider network.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 4 Configuration Guide

Multi-Radio Mesh Mode The Smart Radio supports direct connection between multiple radios using the ETH1 interface. In order to do this, change the configuration to multi-radio mesh mode in the Simple Config menu. Note that in this mode, ETH1 is no longer the configuration port and cannot be accessed at 192.168.1.1. Two example network configurations are shown below.

In the above configuration, two radios are used to extend a link using two different frequencies to avoid having to share the medium. The two channels could be in the same band if desired; for example 2412 MHz and 2462 MHz.

In the next configuration, the 915-MHz radios are used as a failsafe for the 2.4-GHz band. If the 2.4-GHz link cuts off due to it being out of range, or due to excessive interference, network traffic will switch to the 915- MHz link automatically. An important point in the diagram above is that traffic entering the mesh from one side always takes 2 hops before leaving the mesh on the other side. This balance allows the mesh to react significantly faster than if one route required more hops than the other.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 5 Configuration Guide

Common Network Settings Wireless Settings The radio’s wireless settings can be found by navigating to network → wireless in the GUI. There should only be one radio interface present if you setup your network using the Simple Configuration menu. To modify the wireless settings, click Edit. You should see a page similar to the one below. We recommend the following updates.

• For point-to-point networks such as a GCS controlling a single UAV, enable “Dynamically Adjust txpower based on neighbor sounding”. • For 2.4-GHz ISM-band radios, change the channel bandwidth to 10-MHz. This is especially important in urban areas. • Chane the Mesh ID and under Wireless Security, change the password. • In the Advanced Settings tab, modify the distance to something higher than your maximum expected distance. This is optional, but may lead to minor performance improvement. • If you plan to use only one antenna, disable the unused antenna in the Advanced Settings tab. • Choose the best operating channel in your environment.

You should not need to adjust txpower.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 6 Configuration Guide

Interface Settings Network interface settings can be modified in the Network → Interfaces tab. Wrongly configuring the network interface settings can brick your radio. Below are some common changes you may want to make.

• Enable a DHCP server on one of the radios.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 7 Configuration Guide

o To do this, click Edit next to the WAN interface. You should see a page similar to the picture below. Change the Protocol from DHCP to Static Address. Add an IPv4 address and netmask of your choosing, then scroll to the bottom of the page, and un-check Disable DHCP for this Interface. Click Save & Apply. • You may also wish to enable a DHCP server on the LAN interface (ETH1). The steps are similar to those above. • Change the default static IP address of ETH0. To do this, edit the WAN2 interface, and change the static IP address to your liking.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 8 Configuration Guide

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 9 Configuration Guide

Firewall Settings The web GUI is a good mechanism to view and modify the firewall configuration. It is located under Network → Firewall and can also be modified over the CLI at /etc/config/firewall.

We shall use the iperf application as an example to demonstrate setting a firewall rule to allow access to port 5001 of the router. Navigate to the Firewall page, and click the Traffic Rules tab. In the “Open ports on router” section, enter the name, protocol, and port number as “Allow iperf”, “TCP”, and “5001” respectively so that clients is able to connect to port 5001.

Before port 5001 is opened, run iperf in server mode inside the Smart Radio. root@smartradio-301a4e8646:~# iperf -s

If you try and connect to the iperf server from your local machine, you will get an error, connect failed: Connection refused. After opening the firewall at port 5001, you should be able to connect to the iperf server.

Extensive information regarding Firewall configuration is available at the .org website.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 10 Configuration Guide

Differentiated Services Different types of traffic can be prioritized in the Differentiated Services menu. This is useful when operating in a crowded wireless medium. There are four different queues – Voice, Video, Best Effort, and Background. The Voice queue optimizes latency and may also be used for command and control, the Video queue optimizes throughput, the Best Effort Queue is essentially unoptimized, and the Background queue is for low- priority data.

In order to use these QoS features, open up the web GUI and navigate to network → differentiated services. The Smart Radio includes software to map different network protocols or ports to the various QoS queues. To do so, click Enable Differentiated Services, and add a classification rule to suit the application’s needs. For example, you can send all UDP traffic to the Video queue which is beneficial for video transmission.

URLLC (Ultra Reliable Low Latency Channel)

The Smart Radio also includes protocol optimizations for URLLC applications as well as video optimizations. URLLC applications typically include command and control (C&C) or voice data, but can be extended to any application requiring a reliable low latency. Assuming that we have a C&C application which uses network port 7000 over UDP. In the screenshot below, first click Optimize Command & Control and Voice for URLLC. Next click Add, and then change the new classification rule to use Port 7000, and set the DSCP value to CS6. The comment section can be filled if desired. Finally click Save & Apply and wait for the page to refresh.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 11 Configuration Guide

System Configuration using UCI UCI Overview Openwrt uses the UCI system for device configuration. Most of the configuration files can be found here, root@LEDE:~# ls /etc/config/ batman-adv diffserv firewall network openvpn_recipes system ucitrack wireless dhcp dropbear luci openvpn rpcd ubootenv uhttpd

To show the current wireless configuration, type

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 12 Configuration Guide

root@LEDE:~# uci show wireless wireless.radio0=wifi-device wireless.radio0.type='mac80211' wireless.radio0.path='platform/qca953x_wmac' wireless.radio0.htmode='HT20'

Only the first four results are shown above. To change a setting, e.g. the wireless channel, use uci set: root@LEDE:~# uci set wireless.radio0.channel=’10’

This change will be held in memory but will have an effect when the network settings are reloaded using root@LEDE:~# /etc/init.d/network reload

Changes to the configuration can be stored using root@LEDE:~# uci commit

Configuration Parameters Table 1 shows a list of commonly used wireless configuration parameters

Wireless wifi-device section txpower Specifies the transmit power in dBm. Note that transmit power is also limited by local regulations, and a rate-dependent target power. channel This is the wireless operating channel.

Table 2 shows information on the Doodle Labs Smart Radio specific configuration parameters.

Wireless wifi-device section fes_disabled This will put the front-end-system in sleep mode (low power) freqshift This is used by the Operating System and should not be changed chanbw Sets the channel bandwidth in MHz. Only model specific valid bandwidths can be used. Supported bandwidths are 3/5/10/20/26 with 0 being 20 MHz. nf_override Sets a noise floor override in dBm, which can be useful to ignore interferences. Default value is approx. -95. wifi-iface section mesh_fwding Set to ‘0’ to disable 802.11s forwarding. Mesh forwarding is typically handled by batman-adv. mesh_ttl Set to 1 to disable further forwarding in 802.11s. Forwarding typically handled by batman-adv mcast_rate Specify the multicast modulation rate in mesh networks, in bps (e.g. 12000 = 12 Mbit/s). If set higher, the range is decreased but the faster links are preferred. Diffserv general section

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 13 Configuration Guide

enabled Set to 1 to enable diffserv optimized_cc Set to 1 to enable URLLC operation for the Command & Control and Voice Queue optimized_vi Set to 1 to enable URLLC operation for the Video queue mark section dscp Select the DSCP queue, e.g. BE = best effort proto Define the protocol, e.g. icmp, tcp or udp srchost The source and the destination host are IPv4 address (e.g. 192.168.1.2) dsthost can be used to apply rules only to a specific host. A network mask can be used to match entire networks. 192.168.1.0/24 will match traffic with an IP address in the range of 192.168.1.1 to 192.168.1.254. Blank fields will match any address. ports Affected ports for this rule. Valid ports in rules can be in the range 1- 65535. Port ranges can be given in the form of a single port, an inclusive range - or as a comma separated list ,. Both notations can not be mixed. Mesh (batman-adv) bridge_loop_avoidance Set to 1 if there is a chance that devices can be connected via Ethernet and Mesh at the same time orig_interval Interval of batman-adv originator messages (management frames). Default is 1000. Decrease to more frequently update the network topology, e.g for high mobility nodes. This may limit the maximum # of nodes on the network.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 14 Configuration Guide

Appendix A Working with the UART/RS232 port In hardware version 2, models shipped with a -S order code, e.g. RM-915-2H-XS, include a UART port on the auxiliary connector. In hardware version 3, the embedded version (-M) includes a UART port, while the external version (-E) includes RS232 level shifting. In all cases, the UART is implemented as one TX line, one RX line, and GND. Configuring the UART port The UART port uses 0 to 3.3-V signaling levels. The current default serial port settings are 115200 baud rate, 8 data bits, no parity bit, and 1 stop bit. These settings can be changed using the stty program which is installed on the Smart Radio. When you are happy with the stty settings, you can modify the file /etc/init.d/uart_defaults to ensure that the settings are applied on boot-up. Note that if ser2net is used, then its serial settings will override those in the uart_defaults file once a connection is established.

The figure below shows how to setup the Smart Radio for quick evaluation of the UART port. A USB to Serial adapter (shown) can be used if the host PC doesn’t have a serial port. Note that in hardware version 3, the secondary connector is not required for this setup.

Version 3 Hardware

Version 2 Hardware

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 15 Configuration Guide

First install a terminal emulator program like minicom in the host PC. Ensure that the TTY settings in the Smart Radio are the same as the settings in the host PC. You can use the program stty to modify configuration settings. Note that the UART port is accessed at /dev/ttyUSB0 for hardware version 2 and /dev/ttyACM0 for hardware version 3.

Login to the device and update the UART settings to your liking using stty. The current default setting is configured as, root@LEDE:~# stty -F /dev/ttyUSB0 115200 cs8 -cstopb -parenb

At the host PC, start a minicom session with the following settings on the serial port: 115200 baud, 8N1, no hardware flow control, no software flow control. Make sure the serial device is the one connected to the Smart Radio. Back in the Smart Radio SSH session, send a command over UART with root@LEDE:~# echo –ne “Hello World\n” > /dev/ttyUSB0

“Hello World” should appear in the minicom session on the host PC. Next we can read input from the host PC. In the SSH session, type root@LEDE:~# cat < /dev/ttyUSB0

Type “Hello World” in the host PC’s minicom terminal. You should see it echoed in the SSH session of the Smart Radio. It is also possible to send an SSH remote command with the following example syntax user@host-pc:~$ ssh root@ ‘cat < /dev/ttyUSB0’

Assuming the above test worked, we can use ser2net to automatically forward network data to the UART port. This will replace the echo and cat commands above. As an example, the default configuration on the Smart Radio includes the following settings: 2000:telnet:0:/dev/ttyUSB0:115200 NONE 1STOPBIT 8DATABITS 3000:raw:0:/dev/ttyUSB0:115200 NONE 1STOPBIT 8DATABITS

More information on ser2net can be found in its online documentation, and the example ser2net.conf file can be found in the Smart Radio at /etc/ser2net.conf after it is installed. ser2net is running in the Smart Radio by default with the above settings. Note that the serial port settings in the ser2net.conf file will override the settings in /etc/init.d/uart_defaults only if a connection is established with ser2net.

After changing the configuration file, restart ser2net with root@LEDE:~# /etc/init.d/ser2net restart

Next run SSH with port forwarding on the local host user@host-pc:~$ netcat -C 3000

You can now send text between the minicom and netcat sessions.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 16 Configuration Guide

Over the Air Messages Assuming we have setup our Smart Radio as part of a mesh network of other Smart Radios, we can send messages wirelessly and have them appear on the UART port. Make hardware setup changes according to the picture below.

Hardware Version 3

Hardware Version 2

Open up a netcat session on the remote PC which is connected to the mesh network

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 17 Configuration Guide

user@remote-pc:~$ netcat -C 3000

In this case, is the IP address of the remote PC.

UART to UART communications As a last example, we will send messages from the UART port of Smart Radio 1 to the UART port of Smart Radio 2. We will continue with the previous setup and make modifications according to the picture below.

Hardware Version 3

Hardware Version 2

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 18 Configuration Guide

We will use the program socat to forward serial port messages to a remote Smart Radio which is using ser2net to listen. socat is installed but not enabled by default since the IP address of the remote node is required. The settings can be changed in /etc/config/socat. For now, run socat with root@LEDE:~# socat /dev/ttyUSB0,b115200,raw,echo=0 TCP::3000

In this case, is the IP address of the remote smart radio. Open up a minicom session on the remote PC. We can now send messages between the minicom session of the local PC and the minicom session of the remote PC. Ruggedizing the commands The instructions above establish basic means to receive and send UART messages. However, in your final application, you will find it necessary to extend the commands in order to ruggedize them. For example to allow multiple connections, or to recover from TCP disconnects. For example, you can modify the ser2net command to 3000:raw:0:/dev/ttyUSB0:115200 NONE 1STOPBIT 8DATABITS max-connections=3

This allows for up to three incoming connections. You can use the following socat script to keep socat running after a TCP disconnect. root@LEDE:~# (while sleep 1; do socat /dev/ttyUSB0,b115200,raw,echo=0 TCP:: 3000,forever,reuseaddr >> /etc/logsocat.txt )&

Using UDP Transport So far we have been using the TCP transport protocol. In some applications, it may be necessary to use UDP instead. To use UDP, modify the ser2net.conf file to add the line, udp,3001:raw:0:/dev/ttyUSB0:115200 NONE 1STOPBIT 8DATABITS

Next, change your socat command to root@LEDE:~# socat /dev/ttyUSB0,b115200,raw,echo=0 UDP:10.223.141.25:3001,reuseaddr,sourceport=3001

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 19 Configuration Guide

Appendix B USB The USB port is a host port and is pre-configured as an Ethernet over USB interface. When plugged into a USB device or OTG port with a compatible Ethernet over USB configuration, a new interface, USB0, will be instantiated and bridged to the WAN interface. It is then possible to access the Smart Radio over the web browser or SSH at the default static IP address defined earlier. It is possible to install other USB packages to include other USB functions for your application.

The Smart Radio has a USB hub inside and USB ports are accessible on the main and secondary connectors. USB0 on the main connector does not have a 5-V supply associated with it.

Please note that in the v2 revision of hardware, either USB or UART are available and depends on the ordering code. In v3 hardware revision, both USB and UART are available. GPIO In hardware version 3, 3 GPIOs are available for programming. The GPIOs are provided by an on-board MCU and interfaced to the Operating System over USB HID. A program “sr-ctrl-usb” is pre-installed in the system and is used to access the GPIOs. The general syntax for accessing the MCU is root@LEDE:~# sr-ctrl-usb r/w is either “0” for read or “1” for write. The parameter numbers for the three GPIOs are tabulated below. The possible values which can be read or written are “0 and “1” and correspond to 0-V and 3.3-V.

Param # Function 6 Logic level of GPIO1, 0 is GND and 1 is 3.3-V 7 Logic level of GPIO2, 0 is GND and 1 is 3.3-V 8 Logic level of GPIO3, 0 is GND and 1 is 3.3-V 11 Direction of GPIO1, 0 is Output and 1 is Input 12 Direction of GPIO2, 0 is Output and 1 is Input 13 Direction of GPIO3, 0 is Output and 1 is Input

As an example, if we want to write a level 1 to GPIO2, we first set the direction of GPIO2 to 0 and then we set the logic level to 1. root@LEDE:~# sr-ctrl-usb 1 12 0 root@LEDE:~# sr-ctrl-usb 1 7 1

We can read the logic level of GPIO3 with, root@LEDE:~# sr-ctrl-usb 1 13 1 root@LEDE:~# sr-ctrl-usb 0 8

Note that the GPIO directions are reset to input when the MCU is reset. When the MCU is reset, a reset flag is raised at param # 13 and it should be reset to zero by the user.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 20 Configuration Guide

Appendix C Customization Creating Custom Packages There is extensive documentation on creating and installing custom packages on the Openwrt website. https://openwrt.org/docs/guide-developer/helloworld/start

The Smart Radio Operating System is based on LEDE 17.01.4. The vanilla build system can be cloned from GitHub using the following command user@remote-pc:~$ git clone https://github.com/openwrt/openwrt.git user@remote-pc:~$ cd openwrt user@remote-pc:~$ git checkout v17.01.4

This build system is suitable for building individual packages, but not the entire operating system, as it is missing several key components required to interface with the Smart Radio hardware.

Please note that packages installed from the Smart Radio command line interface will be removed if the Smart Radio is factory reset. Keeping Changes after Factory Reset The Smart Radio maintains all files in the /opt directory after a soft factory reset. Additionally, there is a script in /opt called FactoryReset.sh which is automatically run after a soft factory reset. An example usage of this would be to copy myProgram.ipk to the /opt directory, and add a line in FactoryReset.sh, root@LEDE:~# opkg install /opt/myProgram.ipk

Another possibility would be to backup the UCI configuration to the /opt directory via sysupgrade, and then restore it after a factory reset. To back up the configuration, use root@LEDE:~# sysupgrade -b /opt/config.tar.gz after that, add the line to /opt/FactoryReset.sh root@LEDE:~# sysupgrade -r /opt/config.tar.gz

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 21 Configuration Guide

Appendix D Optimizing the Link Range

This section discusses methods to optimize the long range performance of the Smart Radio. Our intention is not to go into detail on any of the topics, but to provide some useful insights which can help during the setup of a long-range link. Fresnel Zones The Fresnel Zone between a transmitter and a receiver is an elliptical zone within which RF propagation takes place. Therefore, objects within the Fresnel Zone can affect the link. If Freznel Zone clearance is not adhered to, multi-path interference will result, and destructive interference can result in significant degradation in the signal quality.

The radius of the first Fresnel Zone can be calculated as,

F = 8.656*√(D/f) where F is in meters, D is the distance in kilometers, and f is the frequency in GHz. As an example, at 2.45 km, using 2.45 GHz WiFi, the radius of the first Fresnel Zone is 8.656m.

In the diagram above, the trees are considered to be obstructions because they are in the Fresnel Zone even though they do not obstruct the line of sight. Antenna Gain and Antenna Placement Antenna selection and placement is very important for long-range optimization. The diagram below shows radiation patterns of a hypothetical antenna. Antennas concentrate power in different directions and in this case, the -3dB beamwidth is 45 degrees. Whip antennas when viewed from the top have perfect rotational symmetry and this explains why the azimuth radiation pattern is omnidirectional. The degree to which antennas concentrate power can also be described by its gain in dBi. An antenna with 5 dBi gain has 5 dB of gain with relative to an isotropic antenna.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 22 Configuration Guide

A dipole antenna is considered to be omnidirectional because when it is placed vertically it is seen equally in all directions on a horizontal plane. A patch antenna on the other hand can be designed to be directional in both the elevation and azimuth and this has the important benefit of avoiding interference originating outside of the link path. Looking at the diagram below, while both antennas could have the same gain, and the same RSSI would be attained, the patch antenna could get a significantly better link in this case because it cannot “see” the interference.

As antenna gain is really just a focusing of power, it does not apply any noise or distortion penalty to the signal. This is in contrast to active amplifiers. Therefore, we recommend that you use an antenna which focuses power only in the direction that your application requires with the highest gain that the application allows. For example, in the diagram above, the antenna on the right might be suitable for a handheld controller which can be oriented by the operator, while the antenna on the left might be more suitable for the UAV which may need to rotate.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 23 Configuration Guide

Noise The throughput that is achievable in a communications system is limited by the received Signal-to-Noise Ratio (SNR). The Shannon-Hartley equation establishes the maximum theoretical channel capacity as,

C=B*log2(1+SNR)

Where C is the capacity in bits per second, B is the bandwidth in Hz, and SNR is dimensionless.

Noise can take on many forms in a communications link. The IEEE 802.11 standard uses clever MAC protocols to share the wireless medium and prevent devices in the same channel from transmitting at the same time. However, non-WiFi devices do not obey these rules, and the standard does not cater to devices operating in adjacent channels. In the image below, three devices are operating in non-overlapping channels. However, the sideband noise of the adjacent channels limits the SNR of the middle channel. Additionally, WiFi devices are not the only ones which take advantage of the 2.4-GHz ISM band.

Doodle Labs’ Smart Radios cover many different frequency bands including non-ISM bands. In noisy environments, choosing the right frequency band may be the best way to establish a long-range communications link. Polarization, MIMO, and Diversity Antennas can be holizontally, vertically, or right/left-hand circularly polarized. Antennas with opposite polarization cannot see each other. Doodle Labs offers dual-antenna radios for its long-range solutions. Having two antennas allows the radios to use either spatial-diversity to improve the reliability of the link, or spatial-multiplexing to improve the datarate.

In spatial-diversity, the same stream of data is sent redundantly over both antennas and combined at the receiver in an intelligent way to optimize the link quality. Depending on the application, it may be beneficial to mount one antenna horizontally and the other vertically to get the most diversity in the polarization, or to mount both antennas horizontally (for example) to get the most power if the polarization is known.

In spatial-multiplexing, two different streams of data are sent to the two antennas resulting in double the throughput. In order not to interfere with each other in a line-of-sight (LoS) link, the antennas should be oppositely polarized. In a non-LoS link, it is not necessary for the antennas to be oppositely polarized as the radios make use of multipath propagation to combine the data streams.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 24 Configuration Guide

Doodle Labs radios automatically switch between spatial-diversity to spatial-multiplexing modulations in order to optimize link quality. Channel Bandwidth Channel bandwidth can be configured between 3 MHz (5 MHz for -P/S models) and 20 MHz. Bandwidth and rise time are inversely related to each other – the faster a signal switches, the more bandwidth it occupies. If bandwidth is reduced from 20 MHz to 5 MHz, we can say that the signal is integrated for 4x longer which means that noise is averaged for 4x longer, or we can say that in the frequency domain, we are capturing 4x less noise bandwidth. For this reason, the SNR is improved by 4x. On the otherhand, throughput is 4x less.

We can also consider channel bandwidth from a interference perspective. A narrow channel bandwidth offers better immunity to continuous-time noise since it is possible to simply move to a channel away from the source of interference. However, a wider channel bandwidth offers better immunity to intermittent sources of interference as the signal can fit into the time slots between the intermittent noise.

Mesh Networking Mesh network configurations were introduced earlier, and they allow the user to extend a network well beyond the normal range of a simple AP/Client network. That said, since each radio operates in a half-duplex mode, throughput is halved as data hops over an intermediate node. Doodle Labs radios can be bridged together to support multiple channel or band operation. For example, it is possible to bridge three radios together, one operating at 2412-MHz, one at 2462-MHz, and the last at 915-MHz. This arrangement reduces the hop penalty and offers frequency diversity in case one or more channels is too congested.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 25 Configuration Guide

Appendix E Spectrum Scanner The Spectrum Scanner can be a useful tool when surveying a site, or debugging a weak connection. It can be accessed from the wireless page of the web GUI, however, note that the Spectrum Scan button will only appear if the channel bandwidth setting is at least 10 MHz. A higher channel bandwidth setting will result in faster scanning. If you do not see the Spectrum Scan button, then try updating to the latest version of the firmware.

Click the Spectrum Scan button and you will be presented with an FFT plot of the available spectrum like shown below.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 26 Configuration Guide

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 27 Configuration Guide

Appendix F Remote Network Information Retreival It is possible to remotely retrieve network information using the GUI by logging into the Smart Radio with a web browser at the ETH0 IP address, or over the command line using a combination of SSH and command-line utilities.

The followings are some examples of remotely executing a command via SSH to obtain network information from the node. ssh [email protected] ‘iw wlan0 info’

Lists the current configuration of wlan0 ssh [email protected] ‘iw wlan0 station dump’ shows connection information to all currently connected stations. ssh [email protected] ‘iw wlan0 list’ shows the capabilities of the wlan0 interface. An example output is shown below. root@LEDE:~# iw dev wlan0 info Interface wlan0 ifindex 13 wdev 0x7 addr 00:30:1a:4e:86:46 type mesh point wiphy 0 channel 12 (915 MHz), width: 20 MHz, center1: 915 MHz txpower 32.00 dBm

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 28 Configuration Guide

Appendix G Transmit Power Control Starting with firmware version firmware-2020-05, transmit power control (TPC) is included. When a node detects another node that is too close, messages are exchanged between the nodes so that they each reduce their transmit power to an optimal level. How close units can get to each other depends on the model as path loss is frequency dependent. For reference, RM-2450-2H-XS works well to within about half a meter. Note that a caveat with TPC is that when two nodes get very close to each other, they will reduce their output power, and this may compromise connectivity with a far away node. The dynamic range of the Smart Radio allows for about 60-dB of range which means that if the two closest nodes are 1m apart, then the furthest visible node is about 1km away. If necessary, TPC can be disabled by going to the wireless configuration page, and editing the wireless network to disable “Dynamically adjust txpower based on neighbor sounding”.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 29 Configuration Guide

Appendix H Fixing MCS Rates The Smart Radio automatically chooses the best modulation (MCS) rate using a trial and error based approach. In our experiments, fixing the radio to a specific modulation rate does not improve overall throughput. However, if you wish to experiment with fixed modulation rates,

1. Login to the radio using SSH user@remote-pc:~$ ssh root@

2. In the following command, substitute for all of the rates which you wish to allow. MCS rates are numbered 0-15 with 0-7 being spatial diversity rates and 8-15 being spatial multiplexing rates. Separate the allowed rates with spaces (e.g 0 2 4 8). root@LEDE:~# iw wlan0 set bitrates ht-mcs-2.4

3. Revert to automatic settings with root@LEDE:~# iw wlan0 set bitrates

Take note that these settings will not survive a radio reset. The suggested method for ensuring that such settings persist over radio resets is to add a hotplug event to /etc/hotplug.d/net. Information on the hotplug system can be found at https://openwrt.org/docs/guide-user/base-system/hotplug.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 30 Configuration Guide

Appendix I Multicasting The Smart Radio has two fundamental wireless network configurations, AP/Client, which is a star network, and Mesh. Multicast data is treated in the same way as broadcast data. AP/Client mode In AP/Client mode, a client which wants to multicast data will first unicast the data to the AP, and then the AP will broadcast it out. In a normal WiFi network, the AP broadcasts packets at the lowest supported rate, which is 1 Mbps. In the Smart Radio, multicast packets are converted to unicast packets and sent to each client individually. Note that all data must still go through the AP.

Mesh mode Multicast data transmission is not recommended in mesh mode unless the amount of data is very small (for example less than 100 kbps). The de-centralized nature of the mesh means that broadcast packets ultimately get re-broadcast from each node. Although multicast to unicast conversion is supported, it is not sufficient to prevent data multiplication. An example of how a multicast packet may end up flowing through the mesh is shown below.

Multicast data transmission over mesh is a topic that we are actively looking into, so please expect updates.

© 2020 Doodle Labs. All rights reserved. August 26, 2020

Page 31