Bonjour and alternatives for Raspberry Pi OTG

Submitted by code_admin on Wed, 07/25/2018 - 15:49

Windows host commands.
I installed Bonjour then I can run the following:

  1. dns-sd

Linux:

Avahi Daemon

Getting OTG working in Ubuntu

In boot partition edit config.txt and add the last line

  1. dtoverlay=dwc2

In boot partition edit cmdline.txt and add

  1. modules-load=dwc2,g_ether g_ether.host_addr=00:22:82:ff:ff:20 g_ether.dev_addr=00:22:82:ff:ff:22

After rootwait.
Final line will look like

  1. dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=970b8044-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether  g_ether.host_addr=00:22:82:ff:ff:20 g_ether.dev_addr=00:22:82:ff:ff:22 quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles

I used ifconfig with raspberrypi plugged in and not plugged in.

I found that the interface for the raspberry pi was "enp0s20f0u1i1"
I decided I want my Pi to be on ip range 192.168.200.*
I will use static IP on this for both my ubuntu host and for the machine

On the pi I set the following /etc/network/interfaces file:

  1. # interfaces(5) file used by ifup(8) and ifdown(8)
  2.  
  3. # Please note that this file is written to be used with dhcpcd
  4. # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  5.  
  6. # Include files from /etc/network/interfaces.d:
  7. source-directory /etc/network/interfaces.d
  8.  
  9. auto lo
  10. iface lo inet loopback
  11.  
  12. iface eth0 inet manual
  13.  
  14. allow-hotplug wlan0
  15. iface wlan0 inet manual
  16.     wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  17.  
  18. allow-hotplug wlan1
  19. iface wlan1 inet manual
  20.     wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  21.  
  22. auto usb0
  23. iface usb0 inet static
  24.     address 192.168.200.2
  25.     netmask 255.255.255.0
  26.     gateway 192.168.200.1
  27.     dns-search metcarob-home.com
  28.     dns-nameservers 192.168.1.254

Note my dns server is 192.168.1.254. You will probably want to change it to 8.8.8.8

Restart network: (Didn't work - I ended up rebooting the pi zero

  1. sudo ifdown usb0
  2. sudo ifup usb0

In ubuntu I didn't have to change any files. In the menu item for the network I saw the connection appear, I selected edit connections and set up ipv4 settings as follows:
192.168.200.1
netmask 255.255.255.0
no gateway or anything else

Then the pi can ping my laptop and the internet, but it has no dns server

RJM Article Type
Work Notes