.. _setup_standalone_network_cfg: Configure DevKit Network ------------------------ By default, the DevKit network interfaces use DHCP. - If you want to connect the DevKit directly to your computer, configure your computer's network interface with a static IP and connect it directly to the DevKit. - If you want the DevKit to obtain its IP address automatically from a network, you will need to configure the interface to use DHCP. **Checking the current IP address** From the serial console, run: .. code-block:: console sima@modalix:~$ ip a | grep inet inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host noprefixroute inet 192.168.91.181/22 brd 192.168.91.255 scope global dynamic noprefixroute end0 inet6 fe80::ab34:b995:9f6e:160e/64 scope link noprefixroute .. tabs:: .. tab:: Network Setup In The Linux Shell .. note:: If you want to toggle between static and DHCP without rebooting the device, follow these instructions. If you have ``sima-cli`` installed on the DevKit and want to switch between DHCP and static configuration dynamically without rebooting, run: .. code-block:: console davinci:~$ sima-cli network You will be prompted with an interactive menu to switch between static and DHCP network configurations. If ``sima-cli`` is not available, use ``nmcli`` to switch between the preconfigured connection profiles: ``end0-static`` and ``end0-dhcp``. .. note:: The following instructions use ``NetworkManager`` profiles to configure the network interface and apply to DevKit systems running eLxr 2.1 or later. If your system is running an earlier release, refer to the `v2.0.0 documentation `_. **Switching to Static IP** To change the network interface from DHCP to static, run: .. code-block:: console davinci:~$ sudo nmcli connection up end0-static davinci:~$ nmcli -f NAME,DEVICE,STATE connection show --active davinci:~$ networkctl status **Switching to DHCP** To change the network interface from static to DHCP, run: .. code-block:: console davinci:~$ sudo nmcli connection up end0-dhcp davinci:~$ nmcli -f NAME,DEVICE,STATE connection show --active davinci:~$ networkctl status .. tab:: Auto Config Through Dev Computer .. note:: - Suitable when the developer network is not available for an Ethernet connection from the DevKit. - Plug the DevKit into the Ethernet port of the developer computer. Use a USB-to-Ethernet dongle if the developer computer does not have an Ethernet port available. - The computer can share Internet with the DevKit, enabling Python package installation using ``pip``. - Requires enabling internet connection sharing on the host computer. #. Follow the instructions below for an Ubuntu machine. On other platforms, the instructions may vary; please look for related instructions online on how to share network connections. * In the upper-right corner, open ``Settings``, then go to the ``Network`` section. * Under ``Wired``, click the plus sign to create a new settings profile if you do not have an existing profile for the board, or modify the existing one if you do. * If you are creating a new profile, name it "Shared" or any name you prefer. * In the ``IPv4`` tab, choose ``Shared to other computers``. Click Apply. * If you had an existing connection, turn it off and on for the changes to take effect. * Your computer should now be networked with the AP. ``10.42.0.0/24`` is the default subnet used by Ubuntu for this setup, but your computer may use a different subnet. * If the next step returns no results, run ``ifconfig`` and look for the IP of your Ethernet interface (usually ``eth0``) there. #. Open a terminal on the Ubuntu machine. Type the following to scan the devices in that IP range: .. code-block:: console sima-user@sima-user-machine:~$ nmap -sn 10.42.0.0/24 | grep report Nmap scan report for sima-user-machine (10.42.0.1) Nmap scan report for 10.42.0.241 This lists the IP addresses used in this subnet. The one ending in ``.1`` is your host machine. The one that does not end in ``.1`` is the IP address of the SiMa DevKit. In the example above, the board is ``10.42.0.241`` and the host is ``10.42.0.1``. #. Test the connection by running: .. code-block:: console sima-user@sima-user-machine:~$ ssh sima@10.42.0.241 ... Last login: Mon Nov 27 19:58:33 2023 davinci:~$ #. To test that you can connect to your host from the board, ping ``10.42.0.1`` from the board. If you have an SSH server running on your host, you can also SSH: .. code-block:: console davinci:~$ ping 10.42.0.1 PING 10.42.0.1 (10.42.0.1): 56 data bytes 64 bytes from 10.42.0.1: seq=0 ttl=64 time=0.598 ms 64 bytes from 10.42.0.1: seq=1 ttl=64 time=0.703 ms 64 bytes from 10.42.0.1: seq=2 ttl=64 time=0.639 ms ^C --- 10.42.0.1 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.598/0.646/0.703 ms #. If you are unable to ping or SSH to the board, use the static IP configuration method. .. tab:: Network Setup In The U-Boot Shell .. note:: This procedure applies only to DevKit firmware release 2.0 or earlier. On release 2.1 and later, users can rely on Linux-side configuration. Configuring the network in U-Boot ensures the network settings persist across firmware upgrades. #. Connect to the DevKit via UART and :ref:`serial terminal `. #. Reboot the DevKit. #. Press any key to enter U-Boot when prompted with the message, ``Hit any key to stop autoboot``. #. To switch to a static IP, enter the following commands: .. code-block:: console sima:~$ env set forcenetcfg static; saveenv sima:~$ boot #. The board will reboot and use ``192.168.1.20`` and ``192.168.2.20`` for the first and second Ethernet ports. #. To modify the board's static IP address, edit the network file with ``vi`` after the device boots. .. code-block:: console davinci:~$ sudo vi /etc/systemd/network/20-end0-static.network #. In the **Network** section, update the IP address as needed. #. To configure DHCP mode, enter the commands below and boot the board. .. code-block:: console sima:~$ env set forcenetcfg dhcp; saveenv sima:~$ boot