gpt4 book ai didi

linux - PPP 连接问题嵌入式 linux

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:18:09 30 4
gpt4 key购买 nike

我正在尝试通过串行线 (RS-422) 在 iMX6 和台式机之间建立 PPP 连接。但在嵌入式系统方面,连接因错误而失败:

Warning: couldn't open ppp database /var/run/pppd2.tdb

ioctl (SIOCGIFFLAGS): Bad file descriptor (line 2389)

我检查了几件事:

  • 启用所有内核模块:

    • CONFIG_PPP
    • CONFIG_PPP_BSDCOMP
    • CONFIG_PPP_DEFLATE
    • CONFIG_PPP_FILTER
    • CONFIG_PPP_MPPE
    • CONFIG_PPP_MULTILINK
    • CONFIG_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 - number:4 (line 2386)

有谁知道我可能做错了什么或遗漏了什么?

最佳答案

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

./ltib -c

Target image generation

最后一个

tmpfs size

我检查了文件系统,我有足够的空间。我看到的唯一奇怪的事情是 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 文件夹,这正常工作。

关于linux - PPP 连接问题嵌入式 linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47929717/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com