1

我正在尝试通过串行线 (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 行)

有人知道我会做错什么或我错过了什么吗?

4

2 回答 2

0

该问题通过在内核配置中启用 CONFIG_FILE_LOCKING 得到解决。

于 2019-07-24T09:07:35.823 回答
0

我不知道前两个命令是什么意思,但我想它们不相关。

./ltib -c

目标图像生成

对于最后一个

tmpfs 大小

我检查了文件系统,我有足够的空间。我看到的唯一奇怪的事情是 tmps 没有安装到,/var而是安装到/var/volatile.

root@device:~# df -h
Filesystem                Size      Used Available Use% Mounted on
ubi0:root                90.6M     58.5M     32.1M  65% /
devtmpfs                344.2M         0    344.2M   0% /dev
tmpfs                   504.3M     44.0K    504.3M   0% /run
tmpfs                   504.3M     24.0K    504.3M   0% /var/volatile

root@device:~# ls -l /var/run/
drwxr-xr-x    2 messageb messageb        60 Jan  5 15:33 dbus
-rw-r--r--    1 root     root            16 Jan  5 15:33 ifstate
lrwxrwxrwx    1 root     root            16 Jan  1  1970 ld.so.cache -> /etc/ld.so.cache
drwxrwxrwt    3 root     root            80 Jan  5 15:51 lock
-rw-r--r--    1 root     root             4 Jan  5 15:33 messagebus.pid
-rw-r--r--    1 root     root             4 Jan  5 15:51 ppp0.pid
-rw-r--r--    1 root     root             0 Jan  5 15:51 pppd2.tdb
-rw-r--r--    1 root     root            84 Jan  5 15:33 resolv.conf
drwxr-xr-x    2 root     root            40 Jan  1  1970 sshd
-rw-r--r--    1 root     root             4 Jan  5 15:34 sshd.pid
drwxr-xr-x    5 root     root           120 Jan  5 15:51 udev
-rw-r--r--    1 root     root             4 Jan  5 15:33 udhcpc.eth0.pid
-rw-rw-r--    1 root     root             0 Jan  1  1970 utmp

我还检查了写入/var/run文件夹,这只是工作。

于 2018-01-07T08:57:06.920 回答