Set up the working environment
USBnet setup
We have enabled RNDIS and DHCP on the system by default in order to use USB network.
Windows
-
Connect the Duo to the computer via Type-C cable
-
The "RNDIS" device appear in the Device Manager
- Select "RNDIS" and right click to update the driver
- Select "Browse my computer for drivers"
- Select "Let me pick from a list of available drivers on my computer"
- Select "Network adapters"
- Manufacturer/Model: Microsoft/USB RNDIS Adapter
- Ignore warning message and click "Yes"
- Driver update successful
- Check "USB RNDIS Adapter"
- Find the IP and test the network using ping
- If you are having trouble installing the rndis driver, you can try another installation method.
Linux
In general, Linux can use RNDIS without configuration.
You can use command ip to check the usb0 network.
neko@milk-v:~ sudo dmesg | grep usb0
[1055270.386719] rndis_host 1-2.1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-2.1, RNDIS device, aa:53:5d:bb:7f:28
[1055270.423753] rndis_host 1-2.1:1.0 enxaa535dbb7f28: renamed from usb0
neko@milk-v:~ ip addr show enxaa535dbb7f28
15: enxaa535dbb7f28: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 42:a2:79:19:7f:e3 brd ff:ff:ff:ff:ff:ff
inet 192.168.42.69/24 brd 192.168.42.255 scope global dynamic noprefixroute enp0s20f0u1
valid_lft 3569sec preferred_lft 3569sec
inet6 fe80::3c92:ed74:3475:cb9c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
neko@milk-v:~ ping 192.168.42.1 -c 5
PING 192.168.42.1 (192.168.42.1) 56(84) bytes of data.
64 bytes from 192.168.42.1: icmp_seq=1 ttl=64 time=0.334 ms
64 bytes from 192.168.42.1: icmp_seq=2 ttl=64 time=0.287 ms
64 bytes from 192.168.42.1: icmp_seq=3 ttl=64 time=0.275 ms
64 bytes from 192.168.42.1: icmp_seq=4 ttl=64 time=0.287 ms
64 bytes from 192.168.42.1: icmp_seq=5 ttl=64 time=0.266 ms
--- 192.168.42.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4096ms
rtt min/avg/max/mdev = 0.266/0.289/0.334/0.031 ms
neko@milk-v:~
macOS
There is no official driver for RNDIS. We need to install HoRNDIS.
- Download HoRNDIS driver
- Intel https://github.com/jwise/HoRNDIS/releases
- Apple silicon https://github.com/jwise/HoRNDIS/files/7323710/HoRNDIS-M1.zip
-
Disable System Integrity Protection
a. Enter macOS recovery
Please refer macOS User Guide -> Recovery to enter recovery mode.
b. Open the terminal and type the following command
csrutil disable
csrutil enable --without kextc. Restart the Mac
-
Install the Kext extension in the zip pack
-
Check the network settings
SSH
- Open the terminal, type ssh [email protected], and answer yes
-
Enter the password milkv
(The password will not be displayed on the screen)
- Login successful
Modify the IP address of RNDIS
The default IP address of USB network RNDIS is 192.168.42.1
. If you need to modify this address, for example, when the same computer is connected to multiple Duo devices, the RNDIS IP of each Duo needs to be set to a different one. This can be achieved by modifying the following two files in the Duo device:
#!/bin/sh
/etc/uhubon.sh device >> /tmp/rndis.log 2>&1
/etc/run_usb.sh probe rndis >> /tmp/rndis.log 2>&1
/etc/run_usb.sh start rndis >> /tmp/rndis.log 2>&1
sleep 0.5
ifconfig usb0 192.168.42.1
count=`ps | grep dnsmasq | grep -v grep | wc -l`
if [ ${count} -lt 1 ] ;then
echo "/etc/init.d/S80dnsmasq start" >> /tmp/rndis.log 2>&1
/etc/init.d/S80dnsmasq start >> /tmp/rndis.log 2>&1
fi
interface=usb0
dhcp-range=192.168.42.2,192.168.42.242,1h
dhcp-option=3
dhcp-option=6
Serial Console
USB to TTL serial cable
Each pin of a USB-to-TTL cable is defined as follows:
Connection
Connect USB to TTL serial cable as shown below. Do not connect the red wire.
Milk-V Duo | <---> | USB to TTL |
---|---|---|
TX (pin 16) | <---> | White wire |
RX (pin 17) | <---> | Green wire |
GND (pin 18) | <---> | Black wire |
The default serial setting for Duo u-boot and kernel console is:
baudrate: 115200
data bit: 8
stop bit: 1
parity : none
flow control: none