Connecting Raspberry Pi and Odroid to PC

We can connect the RPi and Odroid boards in two ways to a PC. One is through a router in which both devices are on same network, or we can directly connect to a PC without a router. The connection through a router is simple and straightforward. Each device will get an IP address, and we can communicate with each device using it. But using direct communication, there is no IP assigned; we can do it using a Wi-Fi hotspot or wired LAN hotspot from a PC.

The following is the procedure to create a wired hotspot on Ubuntu for interfacing these boards:

  1. Click on Edit Connection... from the network option in Ubuntu, as shown in the following figure. Click Add button to create a new connection.
Figure 19: Creating a new network connection in Ubuntu
  1. Create a new Ethernet connection, name the connection Share, and in the connection settings, change the IPV4 setting to Shared to other Computers, as shown here:
Figure 20: Creating a new Ethernet connection in Ubuntu
  1. After creating the connection, you can plug the micro SD card to the board and boot the device; also, connect the wired LAN cable from the board to the PC.
  2. When the board boots up, it will automatically connect to the Share network. If it is not connecting, you can manually click on the Share network name to connect to it. When it is connected, it means the board has an IP address and the PC can communicate with the board using this IP; also, the important thing is that the PC is sharing its Internet connection if it has one.
  3. But how do we find the IP of a board that is connected to a PC? There is a way to find out. The following command will unveil the IP:
          $ cat /var/lib/misc/dnsmasq.leases
  1. The dnsmasq utility is a lightweight DNS and DHCP server. We can get an active client connected to the server by looking at the file called dnsmasq.leases. The output of this command is as follows:
Figure 21: The IP of active clients connected to dnsmasq
  1. Great going! If you get the IP, you can communicate with the board using Secure Shell (SSH). Here are the commands to start an SSH shell from a PC to each board:
  • From PC to Raspberry Pi:
                   $ ssh pi@ip_address_of_board
  • The password is raspberry
  • From PC to Odroid:
                   $ ssh odroid@ip_adress_of_board
  • The password is odroid

If everything works fine, you will get the board's shell, and you can access the ROS commands from the shell.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.78.106