Set NetworkManager configuration

You can use NetworkManager.conf, the configuration file for NetworkManager, to set up NetworkManager behavior. The default file location is /etc/NetworkManager/NetworkManager.conf.

The general Network Manager configuration and the connection profiles setup can be established:

See NetworkManager.conf(5) for more information on the configuration file.

To create images that include your own configuration file, follow these steps:

  1. Write the configuration file NetworkManager.conf.

  2. Locate it in your layer inside the directory recipes-connectivity/networkmanager/networkmanager.

  3. Create a networkmanager_%.bbappend file inside the recipes-connectivity/networkmanager directory to extend the existing recipe file with new files.

    networkmanager_%.bbappend file
    FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
  4. Build your Digi Embedded Yocto project as usual.

Configure Ethernet network settings

NetworkManager manages the Ethernet interfaces in Digi Embedded Yocto. By default, Digi Embedded Yocto includes an Ethernet configuration placeholder under /etc/NetworkManager/system-connections/nm.ethX, where X is the Ethernet interface index starting at zero. With this configuration file, NetworkManager will try to bring up any previously detected Ethernet interface.

By default, Digi Embedded Yocto builds images configured to use DHCP to get the wired IP addresses. While DHCP works well for most devices, you may need to set your IP addresses to be static.

Set up network configuration on a running system

You can change the Ethernet settings on the target using command line tool nmcli.

Configure static IPs

To configure the static IP for the Ethernet interface you can use this nmcli command:

# nmcli con edit eth0
===| nmcli interactive connection editor |===
Editing existing '802-3-ethernet' connection: 'eth0'
Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.
You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb
nmcli> set ipv4.method manual
nmcli> set ipv4.address 192.168.104.87/16
nmcli> set ipv4.gateway 192.168.104.10
nmcli> set ipv4.dns 8.8.8.8
nmcli> save
Connection 'eth0' (7296aec4-0cf2-3172-a2a8-79bb745d5a9a) successfully updated.
nmcli> quit

Now restart the Ethernet interface to make sure it will use the new configuration.

# nmcli con up eth0

Configure dynamic IP

To configure a dynamic IP, use the following nmcli command on your target.

# nmcli con edit eth0
===| nmcli interactive connection editor |===
Editing existing '802-3-ethernet' connection: 'eth0'
Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.
You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb
nmcli> set ipv4.method auto
nmcli> set ipv4.dns
Enter 'dns' value:
nmcli> set ipv4.gateway
Enter 'gateway' value:
nmcli> save
Connection 'eth0' (7296aec4-0cf2-3172-a2a8-79bb745d5a9a) successfully updated.
nmcli> quit

Restart the Ethernet interface to make sure it will use the new configuration.

# nmcli con up eth0

Set network configuration from Digi Embedded Yocto

You can change the default network settings from Digi Embedded Yocto at image-creation time.  See Set NetworkManager configuration.

Configure static IPs

To configure static IPs, you can use the following configuration in your conf/local.conf file:

  1. Configure the interface mode as static:

    ETHn_MODE = "static"

    The value of n may be 0 or 1, depending on which Ethernet interface you wish to configure.

  2. Configure the static IPs. By default, when setting static IPs, Digi Embedded Yocto images are configured with the following static IPs:

    ETH0_STATIC_IP ?= "192.168.42.30"
    ETH1_STATIC_IP ?= "192.168.44.30"
  3. To change these default values, use the following variables:

    ETHn_STATIC_IP = "<ip address>"
    ETHn_STATIC_NETMASK = "<netmask>"
    ETHn_STATIC_GATEWAY = "<gateway ip address>"
    ETHn_STATIC_DNS = "<dns server ip address>"
    • n may be 0 or 1 depending on the Ethernet interface you want to configure.

    • ETHn_STATIC_IP is the static IP address for the specified Ethernet interface.

    • ETHn_STATIC_NETMASK is the netmask address for the specified Ethernet interface.

    • ETHn_STATIC_GATEWAY is the default gateway address. Note that having more than one default gateway is not recommended.

    • ETHn_STATIC_DNS is the name resolution server IP address. You can add several servers as a space-separated list. Note that if different interfaces define DNS entries, the target’s /etc/resolv.conf file uses the last-defined entry.

Configure dynamic IP

To configure a dynamic IP, use the following configuration:

ETHn_MODE = "dhcp"

The value of n is the number of the configured Ethernet interface.

Configure Wi-Fi settings

NetworkManager manages the Ethernet interfaces in Digi Embedded Yocto. By default, Digi Embedded Yocto includes a Wi-Fi configuration placeholder under /etc/NetworkManager/system-connections/nm.wlanX, where X is the Wi-Fi interface index starting at zero. With this configuration file, NetworkManager will try to bring up any previously detected Wi-Fi interface.

By default, Digi Embedded Yocto builds images configured to use DHCP to get the wireless IP addresses. While DHCP works well for most devices, you may need to set your IP addresses to be static.

Additionally, the following Wi-Fi modes are available to configure:

By default, Digi Embedded Yocto configures wlan0 with client infrastructure mode, leaving the rest of wlan virtual interfaces down. When using concurrent mode, the interface is shared between all functionalities so overall performance is affected.

Maximum performance is achieved on the physical wlan0 when the wireless interface is not shared between multiple functionalities. Digi recommends you always use the physical wlan0 interface and only configure virtual interfaces when using concurrent modes.

Set up network configuration on a running system

To configure the wireless settings in a running system use nmcli command line tool.

Configure static IPs

To configure the static IP for the Wireless interface you can use this nmcli command:

# nmcli con edit wlan0
===| nmcli interactive connection editor |===
Editing existing '802-11-wireless' connection: 'wlan0'
Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.
You may edit the following settings: connection, 802-11-wireless (wifi), 802-11-wireless-security (wifi-sec), 802-1x, ipv4, ipv6
nmcli> set wifi.ssid <AP_name>
nmcli> set wifi-sec.key-mgmt <encryption_method>
nmcli> set wifi-sec.psk <password>
nmcli> set ipv4.method manual
nmcli> set ipv4.address 192.168.104.87/16
nmcli> set ipv4.gateway 192.168.104.10
nmcli> set ipv4.dns 8.8.8.8
nmcli> save
nmcli> quit

Restart the wireless interface to make sure it will use the new configuration.

# nmcli con up wlan0

Configure dynamic IP

To configure a dynamic IP, use the following nmcli command on your target.

# nmcli con edit wlan0
===| nmcli interactive connection editor |===
Editing existing '802-11-wireless' connection: 'wlan0'
Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.
You may edit the following settings: connection, 802-11-wireless (wifi), 802-11-wireless-security (wifi-sec), 802-1x, ipv4, ipv6
nmcli> set wifi.ssid <AP_name>
nmcli> set wifi-sec.key-mgmt <encryption_method>
nmcli> set wifi-sec.psk <password>
nmcli> set ipv4.method auto
set ipv4.dns
Enter 'dns' value:
nmcli> set ipv4.gateway
Enter 'gateway' value:
nmcli> save
nmcli> quit

Restart the wireless interface to make sure it will use the new configuration.

# nmcli con up wlan0
Digi Embedded Yocto default configuration includes SoftAP mode by adding a wlan1 entry in the /etc/network/interfaces. See Access point mode.

Set up network configuration from DEY

You can change the default network settings from Digi Embedded Yocto at image-creation time. See Set NetworkManager configuration.

Configure static IPs

To configure static IPs, use the following configuration in your project’s conf/local.conf file:

  1. Configure the interface mode as static:

    WLAN0_MODE = "static"
  2. Configure the static IP settings:

    WLAN0_STATIC_IP = "<ip address>"
    WLAN0_STATIC_NETMASK = "<netmask>"
    WLAN0_STATIC_GATEWAY = "<gateway ip address>"
    WLAN0_STATIC_DNS = "<dns server ip address>"

    where

    • WLAN0_STATIC_IP is the static IP address for wlan0 interface.

    • WLAN0_STATIC_NETMASK is the netmask address for wlan0 interface.

    • WLAN0_STATIC_GATEWAY is the default gateway address. 

    • WLAN0_STATIC_DNS is the name resolution server IP address. You can add several servers as a space-separated list. Note that if different interfaces define DNS entries, the target’s /etc/resolv.conf file uses the last entry defined.

Configure dynamic IP

To configure a dynamic IP, use the following configuration in your project’s conf/local.conf file:

WLAN0_MODE = "dhcp"

Configure cellular network settings

NetworkManager manages the cellular devices in Digi Embedded Yocto. By default, Digi Embedded Yocto includes a cellular configuration placeholder under /etc/NetworkManager/system-connections/nm.cellular. With this configuration file, NetworkManager will try to bring up any previously detected cellular device.

NetworkManager uses ModemManager support to access each identified modem. 

Configure Digi XBee Cellular

To configure the Digi XBee Cellular to work as a modem, follow these steps:

  1. Insert an unlocked SIM card into the XBee Cellular Modem.

  2. Plug the XBee Cellular into the XBIB-U-DEV board.

  3. Plug the power supply to the power jack on the XBIB-U-DEV board.

  4. Use XCTU to configure the following parameters:

    1. Baud Rate (BD) to 57600. This is the default baud rate that ModemManager expects on every TTY it opens.

    2. API Enable (AP) to Bypass Mode.

      See Add radio modules to XCTU to learn how to add your XBee Cellular to XCTU. See Configure your modules for more information on how to set your XBee Cellular parameters.
  5. Configure the PDP context 3 of the modem. To do so:

    1. Open the Serial Console of XCTU (Tools > Serial Console).

    2. Click Open.

    3. Configure the serial connection by selecting the port where your XBee Cellular is connected and its baud rate (57600).

    4. Type the following AT command in the Console log box:

      AT+CGDCONT=3,"IP","<APN>"

      where <APN> is the desired APN.

      For help determining which APN you are using, see the Digi XBee Cellular Embedded Modem User Guide.

      To verify that the change has been applied, issue the following AT command:

      AT+CGDCONT?

      See Serial console tool for more information.

  6. The XBee Cellular is configured. Connect it to your ConnectCore:

    1. Unplug the XBIB-U-DEV board power supply.

    2. Remove the XBee from the XBIB-U-DEV board.

    3. Unplug the ConnectCore platform power supply.

    4. Connect the XBee into its socket.

    5. Plug power supply to the power barrel connector of the ConnectCore board.

Higher baud rates may also be used (up to 921600 bps). For example, if you want to configure the baud rate to 115200, use XCTU to configure the XBee Cellular to use that baud rate and then edit the XBee Cellular udev rules file to configure ModemManager to use that baud rate when opening the port. To do so, use the ID_MM_TTY_BAUDRATE udev tag:

/lib/udev/rules.d/78-mm-digi-xbee-cellular.rules
DEVPATH=="<platform dependent modem path>", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1", ENV{ID_MM_TTY_BAUDRATE}="115200"

See the XBee Cellular and XCTU documentation for more information.

Set up network configuration on a running system

You can also change the configuration on the target using the nmcli tool.

For example to configure the APN value of the cellular interface:

# nmcli con edit cellular
===| nmcli interactive connection editor |===
Editing existing 'gsm' connection: 'cellular'
Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.
You may edit the following settings: connection, gsm, serial, ppp, ipv4, ipv6
nmcli> set gsm.apn <apn_name>
nmcli> save
nmcli> quit

NetworkManager then uses the information in that file to establish a cellular connection when bringing up the network interface.

You may need to bring the interface up again to use the new configuration:

# nmcli con up cellular

Set network configuration from Digi Embedded Yocto

You can use the following variables in your Digi Embedded Yocto project’s conf/local.conf to configure your cellular interface and network provider:

  • CELLULAR_APN: Access Point Name (APN) as defined by your cellular provider.

  • CELLULAR_USER: Username for authentication.

  • CELLULAR_PASSWORD: Password for authentication.

  • CELLULAR_PIN: SIM card pin number. Do not define if the SIM card is not locked.

These authentication settings are optional depending on the cellular network and SIM used. See the Mobile Broadband Information web page.

local.conf
CELLULAR_APN = "vzwinternet"

When building images, Yocto will add those fields to the NetworkManager configuration file (/etc/NetworkManager/system-connections/nm.cellular), within the generated image. For the example above, the following file will be generated:

nm.cellular
[connection]
id=cellular
type=gsm
 
[gsm]
apn=vzwinternet
number=*99#
 
[ppp]
lcp-echo-failure=3
lcp-echo-interval=5
 
[ipv4]
method=auto
 
[ipv6]
method=auto

See Set NetworkManager configuration for information on how to configure the behavior of NetworkManager.

Protocols

The following table shows the default protocol and other protocols supported by these modems.

Modem Default protocol Other supported protocols

Digi XBee Cellular

Serial

-

Telit LE910

QMI

USB serial

Telit HE910

USB serial

-

Huawei ME909u

USB NET

Serial, MBIM

UBlox Toby L-200/L-210

Serial

-

Quectel EC21/EC25

QMI

USB serial

Instructions for unsupported modems

If Digi Embedded Yocto does not support your modem, Digi can provide a Cellular Integration Guide to help you integrate a modem into your Digi Embedded Yocto system. Contact your local Digi representative or Digi Technical Support to obtain the guide.