.. _setup_standalone_network_cfg: Configure DevKit Network ------------------------ When setting up the DevKit in standalone mode, the primary task is configuring its IP address. The method you use depends on network availability. There are three possible ways to assign an IP address to the DevKit. .. tabs:: .. tab:: Auto Config Through Network .. image:: ../../media/devkit-to-network-directly.png :width: 600px :align: center .. note:: - Suitable when the developer's network is less restrictive and provides available ethernet port. - Connect the DevKit directly to a network with DHCP enabled. The DevKit will automatically receive an IP address. - The assigned IP can be determined by accessing the DevKit's console through the UART interface. From the serial console, run the following command to check the IP address: .. code-block:: console ifconfig eth0 | grep -w inet The output will display the IP address assigned to the DevKit. For example: .. code-block:: console davinci:~$ ifconfig eth0 | grep -w inet inet 192.168.1.130 netmask 255.255.255.0 broadcast 192.168.1.255 The ``192.168.1.130`` is the IP address assigned to the DevKit. .. tab:: Auto Config Through Dev Computer .. image:: ../../media/devkit-share-internet.png :width: 600px :align: center .. note:: - Suitable when the developer's network is not available for Ethernet connection from the DevKit. - Plug the DevKit into the Ethernet port of the developer's computer, use a USB-to-Ethernet dongle if developer's computer doesn't 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. * On your upper right corner open ``Settings`` then go to the ``Network`` section. * Under the ``Wired`` section, click the plus sign to create a new settings profile if you don't have an existing profile for the board or just modify the existing one if you do. * If you are creating a new profile, name the profile "Shared" or whatever you want. * In the ``IPv4`` tab, choose ``Shared to other computers``. Click Apply. * If you had an existing connection, turn off and on the connection for the changes to take effect. * Your computer should now be networked with the AP. ``10.42.0.0/24`` this is the default subnet used by Ubuntu for this setup, but there's not necessarily a guarantee that your computer will use that 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 Here you will be listing the IP addresses used in this subnet. The one ending in ``.1`` is your host machine. The one that doesn't end in ``.1`` will be the IP address for the SiMa DevKit. From the code 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 in 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:: Static IP Configuration Through Dev Computer .. image:: ../../media/devkit-isolated.png :width: 600px :align: center .. note:: - Needed when corporate security policies prevent internet sharing with developer's computer. - Manually assign IP addresses to both the DevKit and the developer's machine. - Python dependencies must be manually copied using ``scp`` from developer's computer. Follow the instructions below for an Ubuntu host system. On other platforms, the instructions may vary; please look for related instructions online on how to share network connections. #. On your right upper corner open ``Settings`` then go to the ``Network`` section. #. Under the ``Wired`` section, click the plus sign to create a new settings profile if you don't have an existing profile for the board or just modify the existing one if you do. #. If you are creating a new profile, select a profile name of your choice. For example, "Local". #. In the ``IPv4`` tab, choose ``Manual`` and enter the following: * Address ``192.168.1.10`` * Netmask ``255.255.255.0`` * Leave ``Gateway`` empty #. We recommend you to set up DNS as ``8.8.8.8, 8.8.4.4``. #. Click **Apply**. #. If you had an existing connection, turn the connection ON and OFF for the changes to take effect. #. Log in to your board using the serial device and run ``sudo ifconfig eth0 192.168.1.20 up``. #. Test the connection by running the following command: .. code-block:: console sima-user@sima-user-machine:~$ ssh sima@192.168.1.20 .... davinci:~$ **Then, setup static IP in the DevKit:** #. Connect to the board via UART and serial terminal. #. Reboot the board. #. Press any key to enter U-Boot when prompted with the message, ``Hit any key to stop autoboot``. #. Enter the following commands to configure the board to boot up with the previously set IP address. .. code-block:: console sima:~$ env set forcenetcfg static; saveenv sima:~$ boot #. The board will reboot and use ``192.168.1.20`` as IP address for port ``eth0`` and ``192.168.2.20`` for port eth1. #. To modify the board's static IP address, edit the network file using the ``vi`` command. .. code-block:: console davinci:~$ sudo vi /etc/systemd/network/20-eth0-static.network #. In the **Network** section, update the IP address as needed. #. To reset the connectivity back to DHCP mode, reboot and enter U-Boot by pressing any key when prompted to ``Hit any key to stop autoboot``; then enter the commands below and boot up the board. .. code-block:: console sima:~$ env set forcenetcfg dhcp; saveenv sima:~$ boot #. Once you have confirmed the IP address of the board, you can connect to it using the SSH protocol. For example, ``ssh sima@192.168.1.20``.