Jetson Nano USB 4G Modem 调试
2019-08-17 本文已影响0人
童年雅趣
Nano&4G.png
Part1. 代码修改 (参考4G Modem 说明书)
Kernel-4.9 添加内容:
1、GobiNet 拨号源码添加
kernel-4.9/drivers/net/usb/GobiNet/GobiUSBNet.c
kernel-4.9/drivers/net/usb/GobiNet/Kconfig
kernel-4.9/drivers/net/usb/GobiNet/MPQCTL.h
kernel-4.9/drivers/net/usb/GobiNet/MPQMI.h
kernel-4.9/drivers/net/usb/GobiNet/MPQMUX.c
kernel-4.9/drivers/net/usb/GobiNet/MPQMUX.h
kernel-4.9/drivers/net/usb/GobiNet/Makefile
kernel-4.9/drivers/net/usb/GobiNet/QMI.c
kernel-4.9/drivers/net/usb/GobiNet/QMI.h
kernel-4.9/drivers/net/usb/GobiNet/QMIDevice.c
kernel-4.9/drivers/net/usb/GobiNet/QMIDevice.h
kernel-4.9/drivers/net/usb/GobiNet/Readme.txt
kernel-4.9/drivers/net/usb/GobiNet/Structs.h
kernel-4.9/drivers/net/usb/GobiNet/ndis.h
kernel-4.9/drivers/net/usb/Kconfig
kernel-4.9/drivers/net/usb/Makefile
2、添加 CONFIG_USB_SERIAL_WWAN
kernel-4.9/arch/arm64/configs/tegra_defconfig
3、添加USB VID/PID (usb->serial->option.c )
kernel-4.9/drivers/usb/serial/option.c
Part2. 接口验证 (参考4G Modem 说明书)
1、USB TTY 设备确认?
root@nano-tw:~# ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
2、GobiNet 设备确认?
root@nano-tw:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 2949:8247
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 004: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@nano-tw:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/5p, 480M
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/4p, 12M
|__ Port 1: Dev 5, If 0, Class=Vendor Specific Class, Driver=option, 12M
|__ Port 1: Dev 5, If 1, Class=Vendor Specific Class, Driver=option, 12M
|__ Port 1: Dev 5, If 2, Class=Vendor Specific Class, Driver=option, 12M
|__ Port 1: Dev 5, If 3, Class=Vendor Specific Class, Driver=option, 12M
|__ Port 1: Dev 5, If 4, Class=Vendor Specific Class, Driver=GobiNet_Neoway, 12M
3、4G Modem Ethernet 设备确认? (eth0 or eth1)
root@nano-tw:~# ifconfig eth0
eth0: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.4.201.79 netmask 255.255.255.224 broadcast 10.4.201.95
ether aa:69:b8:ed:86:b4 txqueuelen 1000 (Ethernet)
RX packets 14 bytes 2164 (2.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 75 bytes 8905 (8.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@nano-tw:~# ifconfig eth1
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::3309:6ad3:bb45:c1b4 prefixlen 64 scopeid 0x20<link>
ether 00:04:4b:e5:13:4b txqueuelen 1000 (Ethernet)
RX packets 3187 bytes 233159 (233.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 528 bytes 52199 (52.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 149 base 0xe000
4、GobiNet 拨号确认?
root@nano-tw:~# echo -e "at\$qcrmcall=1,1\r\n" > /dev/ttyUSB2
打开另一个 Terminal 终端
root@nano-tw:~# cat /dev/ttyUSB2
$QCRMCALL: 1, V4
OK
5、DHCP 获取IP 并进行上网确认?
root@nano-tw:~# udhcpc -i eth0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 10.4.201.79
udhcpc: lease of 10.4.201.79 obtained, lease time 7200
root@nano-tw:~# ping host.nvidia.com