Skip to content

Networking

Torizon for Maivin uses the standard NetworkManager framework for managing system networking. NetworkManager is used by most Linux distributions and can manage all of the system's networking interfaces, including the optional LTE modem, and be used to configure VPN connections.

As noted in the Quick Start, the Maivin can be discovered on a network using the verdin-imx8mp-XXXXXXXX.local hostname where the 'XXXXXXXX' is the eight-digit serial number of the unit. The serial number can be found on the rear sticker near the connection ports.

This chapter documents the most common networking configurations for the Maivin. For further detailed documentation, please refer to the NetworkManager Documentation.

Network Interfaces

The Maivin includes a number of networking interfaces: Ethernet, Wi-Fi, and an optional LTE modem. The interface names and ports are described in the table below. The ethernet1 and can0 interfaces are sensor-only interfaces used by the Raivin to communicate with the internal radar module or an external LiDAR sensor. The remaining interfaces are user configurable.

Name ID Details
Gigabit Ethernet ethernet0 RJ-45 port on the rear of the Maivin
Wi-Fi Client mlan0 Wi-Fi client interface
Wi-Fi AP uap0 Wi-Fi Access Point interface
LTE Modem wwan0 Optional LTE Modem using internal m.2 expansion
Sensor Ethernet ethernet1 Internal 1000Base-T1 interface to the radar or LiDAR
CAN Bus can0 Internal CAN interface to the Radar

NetworkManager is the sole network manager on Torizon for Maivin, the systemd-networkd service is masked. The CAN bus is the exception as NetworkManager does not support CAN interfaces, it is configured by the can0.service systemd unit.

Note

On lab units with a CPU serial number starting with 0 the Ethernet interfaces may enumerate as end0 and end1, refer to the Known Issues. Customer units are not affected.

Ethernet Setup

The Maivin ships with the Ethernet interface setup as a DHCP client and should automatically get an IP address on a network which provides DHCP. Otherwise the Maivin will fallback to a link-local IP. In either scenario, the Maivin can be accessed using the verdin-imx8mp-XXXXXXXX.local hostname.

Note

The Maivin also supports IPv6 which will be available through a link-local address. This IPv6 link-local address will be associated with the verdin-imx8mp-XXXXXXXX.local hostname.

Tip

If connecting to the Maivin using a Windows PC, either with an SSH client or a web browser, adding the ".local" suffix is optional. For Linux or Mac machines, the suffix must be used.

Once connected to the Maivin, standard Linux tools are available for listing the network interfaces and their current status. NetworkManager offers the nmcli command-line tool for querying the status of the interfaces it manages; for example, the nmcli connection command is shown below. We see the connection name network0 which is associated to the external network interface ethernet0, and the ethernet1-radar sensor profile which is associated to the ethernet1 interface. The network0 connection name can be user defined.

$ nmcli -t connection
network0:958cc5e3-1bbf-3d64-beeb-020d4414e254:802-3-ethernet:ethernet0
ethernet1-radar:78c31df4-8c89-31a6-9aeb-d5603e230e4e:802-3-ethernet:ethernet1
ethernet1-lidar:2f0a1c44-63a2-4a58-9b0e-0f6e8d5f2c11:802-3-ethernet:

Tip

When using nmcli, the -t parameter is used to provide simpler text output. Without it, the rich console interface is used which requires an appropriate terminal to display correctly. If you find the output of nmcli visually erroneous, use the -t parameter.

Tip

The nmcli sub-commands can be abbreviated. For example, nmcli connection can simply be entered as nmcli c.

Other standard Linux tools such as ifconfig, ip, and ethtool are also available. For example, ifconfig can be used to see the link status and IP address along with other details.

$ ifconfig ethernet0
ethernet0 Link encap:Ethernet  HWaddr 00:14:2D:E7:08:E3  
          inet addr:10.10.41.226  Bcast:10.10.47.255  Mask:255.255.248.0
          inet6 addr: fe80::1cc:4f8d:9ea2:815/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2091191 errors:0 dropped:0 overruns:0 frame:0
          TX packets:251375 errors:2 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:188791038 (180.0 MiB)  TX bytes:329873651 (314.5 MiB)
          Interrupt:52

Static IP

The Maivin can be configured to use a static IP for ethernet using the NetworkManager command-line tool. You will need to know the desired IP address and subnet mask. You will also need the gateway and DNS IP address, if required for Internet access.

First, you must identify the connection name of the interface you wish to configure with a static IP. The external gigabit ethernet interface ethernet0 has the connection name network0 by default, which we can see in the first column of the output. You will use this connection name in the following commands.

$ nmcli -t c
network0:958cc5e3-1bbf-3d64-beeb-020d4414e254:802-3-ethernet:ethernet0

The following steps are then followed to configure the static IP address. Note that the network bitmask (or netmask) is provided in Classless Inter-Domain Routing (CIDR) format. This lists the numbers of bits to set in the IP address as belonging to the network. For example, the netmask '255.255.255.0' has the first 24 bits set (each 255 is 8 bits), so the netmask is set using /24. You may need to adjust this according to your specific network configuration.

  1. Set the static IP address:
    nmcli con mod network0 ipv4.addresses 192.168.1.10/24
  2. Set the gateway, if required:
    nmcli con mod network0 ipv4.gateway 192.168.1.1
  3. Set the DNS, if required:
    nmcli con mod network0 ipv4.dns 8.8.8.8
  4. Set the IPv4 method to manual:
    nmcli con mod network0 ipv4.method manual
  5. Finally, bring up the new configuration (or sudo reboot the unit):
    nmcli con up network0

The device should now be configured with the new static IP address.

Warning

The internal ethernet1 interface uses the 192.168.11.0/24 network to communicate with the radar module and the 192.168.1.0/24 network for the LiDAR profile. Do not configure the static IP address to reside on these networks.

Warning

The ipv4.addresses element must be configured before switching the IPv4 method to manual.

Warning

Calling the connection up command while connected through this interface can cause the link to drop. Reconnect using the new address. An alternate to the connection up command is to use sudo reboot to restart the device.

Re-enable DHCP

To revert the connection to using DHCP you must follow these steps.

  1. Configure automatic (DHCP) mode:
    nmcli con mod network0 ipv4.method auto
  2. Remove the previous gateway:
    nmcli con mod network0 ipv4.gateway ""
  3. Remove the previous static addresses:
    nmcli con mod network0 ipv4.addresses ""
  4. Remove the previous DNS:
    nmcli con mod network0 ipv4.dns ""
  5. Activate the changes:
    nmcli con up network0

Mixed Static and DHCP

NetworkManager allows mixed static and DHCP configurations. If you configure ipv4.method auto you can still configure some of the other IPv4 parameters statically.

Wi-Fi Client Setup

Maivin units with Wi-Fi can be configured to connect to a Wi-Fi Access Point (AP). Refer to the next section if you instead want to use your Maivin as a Wi-Fi AP.

Warning

FCC regulations require special certifications for collocated transmitters (a device with multiple RF transmitters). Maivin and Raivin are not currently certified for collocated transmitters so users must not enable more than one of the Wi-Fi, Modem, or Radar without first receiving FCC certification. Refer to regulatory boards in your jurisdiction for your relevant regulations.

NetworkManager handles the Wi-Fi client configuration. Follow these steps to connect to an AP, you will need to know the AP Service Set Identifier (SSID, usually the network name) and the password, if required.

  1. First scan for available Wi-Fi networks to join:
    nmcli device wifi list
  2. Connect to the desired Wi-Fi network using the SSID:
    nmcli -a device wifi connect <SSID>
  3. Enter the password, if needed, when prompted.
  4. Confirm the mlan0 interface is up and has received an IP address:
    ifconfig mlan0

Wi-Fi AP Setup

Maivin units with Wi-Fi can be configured as an AP allowing client devices to connect to the Maivin. Instead of using NetworkManager, we use the Host AP daemon (hostapd). The uap0 interface is excluded from NetworkManager through the /etc/NetworkManager/conf.d/unmanaged.conf file.

Warning

FCC regulations require special certifications for collocated transmitters (a device with multiple RF transmitters). Maivin and Raivin are not currently certified for collocated transmitters so users must not enable more than one of the Wi-Fi, Modem, or Radar without first receiving FCC certification. Refer to regulatory boards in your jurisdiction for your relevant regulations.

Wi-Fi AP mode is configured using the hostapd service in Linux. The Maivin does not ship with an access point configured, you provide the network configuration in /etc/hostapd.conf before enabling the service. We describe a common Wi-Fi AP configuration; for more advanced setup, please refer to the hostapd documentation.

Access Point Configuration

The following is an example configuration to write to /etc/hostapd.conf. The network name and password are placeholders which you must replace with your own values. The full list of configuration options is documented in the hostapd.conf reference file.

ssid=ExampleAP
wpa_passphrase=ExamplePassword
own_ip_addr=10.10.10.1
interface=uap0

country_code=CA
hw_mode=a
channel=40

ieee80211ac=1
ieee80211n=1
ieee80211w=2
wmm_enabled=1

auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_pairwise=CCMP
sae_require_mfp=1

ht_capab=[LDPC][HT40+][GF][SHORT-GI-20][SHORT-GI-40][TX-STBC][DSSS_CCK-40]

Choose Your Own Network Name and Password

The values above are examples and must not be used on a deployed device. The ssid is limited to 32 characters. The wpa_passphrase must be between 8 and 63 printable ASCII characters, hostapd refuses to start when the passphrase is shorter than 8 characters.

The country_code must match the regulatory domain where the unit operates as it determines the channels and transmit power hostapd is allowed to use. The example configures a 5 GHz 802.11ac network on channel 40.

Enabling the Access Point

With /etc/hostapd.conf in place, enable the hostapd service along with the companion hostapd-network service. The companion service is bound to hostapd, it assigns the AP address, runs a dedicated dnsmasq DHCP server for the clients, and sets up IP forwarding and NAT so AP clients can reach the Internet through the Maivin's uplink.

sudo systemctl enable --now hostapd hostapd-network

The access point network created by the example configuration is summarized below. The AP address and DHCP range are configured by the hostapd-network service, whose DHCP server configuration is found under /etc/hostapd-dhcp.conf.

Setting Value
SSID ExampleAP
Band 5 GHz (802.11ac), channel 40
Security WPA2-PSK
AP IP 10.10.10.1/24
DHCP range 10.10.10.100 to 10.10.10.199

Warning

If you change the access point address in the DHCP configuration, make sure it matches the own_ip_addr address in hostapd.conf!

LTE Modem Setup

Maivin provides an m.2 expansion port which can be used to add an LTE modem to the device. We offer Maivin and Raivin units preconfigured with an LTE modem and SIM card or a modem can be added by customers themselves following the instructions at the end of this section.

Warning

FCC regulations require special certifications for collocated transmitters (a device with multiple RF transmitters). Maivin and Raivin are not currently certified for collocated transmitters so users must not enable more than one of the Wi-Fi, Modem, or Radar without first receiving FCC certification. Refer to regulatory boards in your jurisdiction for your relevant regulations.

Modem Configuration

The modem in the Maivin is configured through ModemManager, which is a companion framework to NetworkManager but specializing in modem configuration. Before you start, you need to ensure the modem is installed into the Maivin along with the SIM card and that you have the correct Access Point Name (APN) configuration string from your LTE carrier.

We describe the common modem configuration in this section. For further details of the modem features and configuration, please refer to the ModemManager Documentation.

Configure m.2 Port

To configure the modem, we first need to ensure the m.2 expansion port is configured for the correct operating mode. The expansion port supports PCI and USB operating mode and the correct one needs to be configured in the device tree. Most modems use USB. The device tree is configured through the /etc/overlays.txt file, so please make sure the entry maivin2-m2usb.dtbo is listed.

$ cat /etc/overlays.txt
fdt_overlays=maivin2.dtbo maivin2-os08a20.dtbo maivin2-m2usb.dtbo

Warning

The maivin2.dtbo overlay must always be present first. Care must be taken when adjusting the device tree overlays as errors will cause boot failures!

Verify Modem Found

After confirming the correct device tree overlays are configured and rebooting the Maivin, you can verify the modem has been found. For USB modems, the lsusb command is used, in the example below we see a Telit LN920 modem has been found.

$ lsusb
Bus 002 Device 002: ID 1bc7:1060 Telit Wireless Solutions LN920

Configure Networking

With the m.2 expansion and modem configured and detection verified the networking can now be configured.

First we must enable the ModemManager service which is disabled by default on Maivin.

sudo systemctl enable ModemManager
sudo systemctl start ModemManager

Next we can confirm that the modem and SIM card are found.

$ mmcli -m 0
  ----------------------------------
  General  |                   path: /org/freedesktop/ModemManager1/Modem/0
           |              device id: 7d04c0ee5027689a762768e20387443c2eb574ea
  ----------------------------------
  Hardware |           manufacturer: Telit
           |                  model: LN920A6-WW
           |      firmware revision: M0L.010002
           |         carrier config: default
           |           h/w revision: 1.10
           |              supported: gsm-umts, lte
           |                current: gsm-umts, lte
           |           equipment id: 352214163072532
<additional output removed>

Note

If mmcli -m 0 returns the error "error: couldn't find the ModemManager process in the bus", then you need to first start the service using sudo systemctl start ModemManager.

Note

If mmcli -m 0 returns the error "error: couldn't find modem", then wait a few minutes before trying again. Modem startup can take a while. If the modem is still not found, please contact support.

Now that the modem is properly detected by ModemManager, we switch to NetworkManager to configure the network.

Warning

Take careful note of the commands, as mmcli for ModemManager and nmcli for NetworkManager look very similar.

  1. First we create a new NetworkManager connection for the cellular modem and provide the APN string which will be provided to you by your service provider:
    nmcli connection add type gsm ifname "*" con-name "Cellular Connection" autoconnect yes gsm.apn <APN_FROM_CARRIER>
  2. Next you can bring up the newly created connection:
    nmcli connection up "Cellular Connection"
  3. Then you can verify the connection is up:
    nmcli -c no connection show

Once properly configured the wwan0 interface can also be queried through ifconfig.

Modem Installation

The modem installation can be performed by customers by following these instructions. If your modem and service provide require physical SIM card installation that is also possible during installation.

Warning

Installing an LTE modem is an advanced configuration which requires opening up the Maivin. Extreme caution should be followed during this procedure. We suggest ordering Maivin or Raivin units with the LTE option preconfigured.

Sensor Network

The ethernet1 and can0 interfaces are reserved for communications with the radar module on Raivin configurations and with a LiDAR sensor. Two NetworkManager profiles are installed for ethernet1, only one is active at a time.

Profile Address Autoconnect Sensor
ethernet1-radar 192.168.11.17/24 yes Radar module
ethernet1-lidar 192.168.1.102/24 no LiDAR module

Both profiles use policy routing so the sensor subnet is routed through its own routing table and the sensor interface never becomes the default gateway. Switch between the profiles with nmcli when provisioning a LiDAR.

sudo nmcli connection down ethernet1-radar
sudo nmcli connection up ethernet1-lidar

The ethernet1-master.service configures the 1000Base-T1 automotive Ethernet PHY as the link master, which is required for the radar module. The Maivin also runs a PTP grandmaster (ptp4l) on ethernet1 distributing the GNSS disciplined system time to the connected sensors, the phc2sys-master@ethernet1 service keeps the interface clock in step with the system clock. Sensors such as the Ouster LiDAR can synchronize to it by selecting their PTP timestamp mode. The system clock itself is disciplined by chrony from the GNSS receiver through gpsd and the receiver's pulse per second signal, chronyc sources shows the GPS reference selected at stratum 1 on a healthy unit.

Refer to the Radar and LiDAR hardware pages for details.