我正在尝试通过串行线 (RS-422) 在 iMX6 和桌面之间建立 PPP 连接。但是在嵌入式系统方面,由于错误而导致连接失败:
警告:无法打开 ppp 数据库 /var/run/pppd2.tdb
或者
ioctl (SIOCGIFFLAGS):错误的文件描述符(第 2389 行)
我检查了几件事:
启用所有内核模块:
- 配置_PPP
- CONFIG_PPP_BSDCOMP
- CONFIG_PPP_DEFLATE
- CONFIG_PPP_FILTER
- 配置_PPP_MPPE
- CONFIG_PPP_MULTILINK
- 配置_PPPOE
- CONFIG_PPP_ASYNC
- CONFIG_PPP_SYNC_TTY
安装 pppd 包
命令的完整输出如下:
root@imx6:~# pppd -d /dev/ttymxc0 38400 -detach lock nocrtscts nocdtrcts 192.168.0.2: netmask 255.255.255.0 &
[1] 355
root@imx6:~# Warning: couldn't open ppp database /var/run/pppd2.tdb
using channel 8
Using interface ppp0
Connect: ppp0 <--> /dev/ttymxc0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x9194c525> <pcomp> <accomp>]
rcvd [LCP ConfRej id=0x1 <pcomp> <accomp>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <magic 0x9194c525>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <magic 0x9194c525>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xcee8fa7d>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xcee8fa7d>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.0.2>]
rcvd [LCP EchoReq id=0x0 magic=0xcee8fa7d]
sent [LCP EchoRep id=0x0 magic=0x9194c525]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.0.1>]
sent [IPCP ConfAck id=0x1 <addr 192.168.0.1>]
rcvd [CCP ConfReq id=0x1]
sent [CCP ConfAck id=0x1]
rcvd [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [CCP ConfReq id=0x2]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 192.168.0.2>]
rcvd [CCP ConfAck id=0x2]
rcvd [IPCP ConfAck id=0x2 <addr 192.168.0.2>]
sock_fd - number:4 (line 2386)
local IP address 192.168.0.2
remote IP address 192.168.0.1
Fatal signal 11
sock_fd - number:4 (line 2386)
ioctl (SIOCGIFFLAGS): Bad file descriptor (line 2389)
Script /etc/ppp/ip-up started (pid 358)
Modem hangup
Connect time 0.1 minutes.
Sent 0 bytes, received 0 bytes.
sock_fd - number:4 (line 2386)
Connection terminated.
Script /etc/ppp/ip-up finished (pid 358), status = 0x7f
Fatal signal 11
Script /etc/ppp/ip-down started (pid 359)
Script /etc/ppp/ip-down finished (pid 359), status = 0x7f
^C
[1]+ Done(16) pppd -d /dev/ttymxc0 38400 -detach lock nocrtscts nocdtrcts 192.168.0.2: netmask 255.255.255.0
将以下行添加到 pppd 源以调试此问题:
sock_fd - 编号:4(第 2386 行)
有人知道我会做错什么或我错过了什么吗?