View Single Post
Old 11-09-2021, 04:23 PM   #5
katadelos
rm -rf /
katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.
 
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
Quote:
Originally Posted by jollyblondgiant View Post
Perhaps interesting: when the two are tethered, ifconfig on the pi detects the kindle, just not the other way around.
Try plugging in the Kindle then run dmesg on the Pi - you should see something similar to this:
Code:
[212626.094661] usb 1-2: new high-speed USB device number 106 using xhci_hcd
[212626.249894] usb 1-2: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 3.99
[212626.249912] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[212626.249921] usb 1-2: Product: RNDIS/Ethernet Gadget
[212626.249927] usb 1-2: Manufacturer: Linux 3.0.35-lab126 with fsl-usb2-udc
[212626.253116] cdc_subset: probe of 1-2:1.0 failed with error -22
[212626.256638] cdc_ether 1-2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-2, CDC Ethernet Device, ee:49:00:00:00:00
[212626.308247] cdc_ether 1-2:1.0 enxee4900000000: renamed from usb0
As you noticed, a new network interface will appear when running ifconfig:
Code:
enxee4900000000: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::bd21:212e:6ca6:7430  prefixlen 64  scopeid 0x20<link>
        ether ee:49:00:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 632 (632.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Attempting to SSH into the Kindle at this point will fail because an IP address hasn't been defined on the Pi for the interface presented by the Kindle. ifconfig is just a utility to list and configure network interfaces, it doesn't automatically set the connection up for you.

To set the IP address for the network interface presented by the Kindle, run this:
Code:
sudo ifconfig enxee4900000000 192.168.15.201
You should now be able to ping and SSH into the Kindle:
Code:
user@ubuntu:~$ ping 192.168.15.244
PING 192.168.15.244 (192.168.15.244) 56(84) bytes of data.
64 bytes from 192.168.15.244: icmp_seq=1 ttl=64 time=0.372 ms
64 bytes from 192.168.15.244: icmp_seq=2 ttl=64 time=0.242 ms
^C
--- 192.168.15.244 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1027ms
rtt min/avg/max/mdev = 0.242/0.307/0.372/0.065 ms

Code:
user@ubuntu:~$ ssh root@192.168.15.244


Welcome to Kindle!

root@192.168.15.244's password: 
#################################################
#  N O T I C E  *  N O T I C E  *  N O T I C E  # 
#################################################
Rootfs is mounted read-only. Invoke mntroot rw to
switch back to a writable rootfs.
#################################################
[root@kindle root]#
Manually setting the IP address is still annoying though - it would be nice if we could set things up to handle this automatically. IIRC, Raspbian uses netplan now, so you should be able to define a configuration that does exactly that:
Code:
network:
  version: 2
  renderer: networkd
  ethernets:
    enxee4900000000:
      link-local: []
      dhcp4: false
      addresses:
        - 192.168.15.201/24
Save the contents of the code block above to /etc/netplan/01-kindle.yaml then run the command below:
Code:
sudo netplan apply
This will automatically assign the IP address 192.168.15.201 to the network interface presented by the Kindle when you next plug it in. Note that the network interface name might differ on your Pi - if it does, substitute enxee4900000000 with the interface name that you saw appearing in ifconfig.
katadelos is offline   Reply With Quote