Using A Consumer Router to Simplify Robot Networking

Written on September 27, 2021

Glossary

  • MikroTik: A network equipment manufacturer.
  • Router: A network device that forwards data packets between computers and computer networks.
  • Access Point: A networking hardware device that allows devices to connect to a wired network.
  • Bridge: A network bridge is a computer networking device that creates a single, aggregate network from multiple networks or devices.
  • Switch: Networking device that forwards data
  • MAC Address: Unique hardware identifier for a network device.
  • Static IP address: An IP address tied directly to a MAC Address, this allows the same device to be assigned the same IP address every time it connects to the network.
  • SSID: Name of a Wireless Network.
  • CPE: Client device, which will connect to an Access Point (AP) device. Provides option to scan for AP devices in your area.

Required Hardware

Overview

Working with mobile robotic systems with onboard compute can be difficult especially when developing on the platform. During my time building and developing an autonomous wheelchair I setup a router to provide a wifi network to the robots intranet and a bridged network that acted as a client to a local network providing internet to the platform. In this post I will walk through the hardware and software I used to accomplish it, but the same general idea can be setup in a number of ways.

Network Topology

The network topology of this setup is fairly simple but provides useful functionality. The Router is setup with eth0 (in Mikrotik it is ether1, counting from 1 instead of 0) as a WAN port and the rest of the 4 ports as a switch. Where the deviation from a normal router setup is found is in the wifi setup. Unlike a normal router which would have SSIDs being broadcast on both the 2.4 and 5Ghz bands, in this setup the 5Ghz band will act as a client connected to another wifi network acting as another wan source with only the 2.4Ghz band broadcasting the SSID.

Note, there is no load balancing or failover on the two WAN ports in this example, because of this both will be used if both are plugged in. A good future step could be prioritizing ethernet over wifi since it will generally be faster and have less delay.

Network Topology

Setting Up Router

  1. Main quickset page, choose CPE from the system dropdown.

    Main Page

  2. Interface List, here the WAN and LAN interfaces are defined. By adding ether1 to the WAN list we can either provide internet through a client wifi address or the first ethernet port.

    Interface List

  3. Port Assignments, here disable ether1 since it will be setup as a wan port not as a lan port.

    Port Assignments

  4. Dhcp Client, setting up a dhcp client on ether1 will allow it to be allocated an ip address from the WAN connection, this will need to be setup as a static ip if the WAN connection supplies one.

    Dhcp Client

  5. Wifi Interfaces, these should be setup by the original dropdown, but in the case you have an issue this is what the setup should look like.

    Wifi Interfaces

Example Config

Here is the example config for this networking setup working on a MikroTik hAC Router. The ip address for the management website is the default with the username and password both being admin.

Example Config

Summary

Small network changes like this one can greatly improve development time and ease access to mobile platforms. While this is by no means a novel concept it is something I have found often overlooked.

Future Work

A similar setup can be accomplished with a raspberry pi 4 but with the added benefit of having the compute in a single module. Proof of concept has been done here, here and here. The development of single board Rpi compute module routers also open up more applications.