OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Base system
  • Assigned To
    Yousong Zhou
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Ken - 07.04.2017
Last edited by Yousong Zhou - 28.04.2017

FS#684 - bug in kmod-can

When I installed “kmod-can-usb-8dev”, I got an error from “kmod-can” :

root@ap121u:~# opkg install kmod-can-usb-8dev

Installing kmod-can-usb-8dev (4.4.50-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.0/targets/ar71xx/generic/packages/kmod-can-usb-8dev_4.4.50-1_mips_24kc.ipk

Installing kmod-can (4.4.50-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.0/targets/ar71xx/generic/packages/kmod-can_4.4.50-1_mips_24kc.ipk
Configuring kmod-can.
can-dev is already loaded

Configuring kmod-can-usb-8dev.

Collected errors:
 * pkg_run_script: package "kmod-can" postinst script returned status 255.
 * opkg_configure: kmod-can.postinst returned 255.

When I plugged in the device ( http://www.8devices.com/products/usb2can ), then “ip l” didn’t look right :

7: can0: <NOARP40000> mtu 16 qdisc noop state DOWN qlen 10
    link/[280]

I tried it on an “Onion Omega” with LEDE 17.01.0 , I got the same symptom as the AP121U.

When I tried it on an “Onion Omega” with “CHAOS CALMER (15.05.1)”, it worked OK.

It’s even broken with the “virtual CAN’ device : kmod-can-vcan

Supply the following if possible:

- Device problem occurs on

Both “Alfa AP121U” and “Onion Omega” showed the problem

- Software versions of LEDE release, packages, etc.

LEDE Reboot (17.01.0, r3205-59508e3)

- Steps to reproduce

# install kmod-vcan :

opkg install kmod-can-vcan

# notice kmod-can error message : “returned 255”

# create virtual CAN interface :

ip link add dev vcan0 type vcan

# print link info :

ip l

# notice “link/[280]” (instead of “link/can”

 
Closed by  Yousong Zhou
28.04.2017 06:27
Reason for closing:  Fixed
Project Manager
Yousong Zhou commented on 11.04.2017 06:05

Please check if the usb_8dev kmod was correctly inserted. The following info can be helpful

- Output of command "lsmod | grep usb_8dev"
- "dmesg | tail -n32" after the opkg install command finished with error message about exit code 255
- Output of command "modprobe usb_8dev"

Ken commented on 24.04.2017 22:30

This has nothing to do with the usb_8dev hardware (the problem exists on the virtual interface : vcan).

FYI, this is still a problem on Reboot (17.01.1, r3316-7eb58cf109) :

root@oo0:/# opkg install kmod-can-vcan
Installing kmod-can-vcan (4.4.61-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.1/targets/ar71xx/generic/packages/kmod-can-vcan_4.4.61-1_mips_24kc.ipk
Installing kmod-can (4.4.61-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.1/targets/ar71xx/generic/packages/kmod-can_4.4.61-1_mips_24kc.ipk
Configuring kmod-can.
[   77.257909] can: controller area network core (rev 20120528 abi 9)
[   77.262785] NET: Registered protocol family 29
[   77.279625] CAN device driver interface
can-dev is already loaded
Configuring kmod-can-vcan.
[   77.398133] vcan: Virtual CAN interface driver
Collected errors:
 * pkg_run_script: package "kmod-can" postinst script returned status 255.
 * opkg_configure: kmod-can.postinst returned 255.
root@oo0:/# ip link add dev vcan0 type vcan
root@oo0:/# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN qlen 1000
    link/ether 40:a3:6b:c1:08:f9 brd ff:ff:ff:ff:ff:ff
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 40:a3:6b:c1:08:fa brd ff:ff:ff:ff:ff:ff
5: vcan0: <NOARP> mtu 16 qdisc noop state DOWN qlen 1
    link/[280] 
Project Manager
Yousong Zhou commented on 25.04.2017 12:20

Hi, this is indeed caused by a flaw of modprobe within 17.01. The issue was already fixed in master branch but did not get backported yet.

As for the link/[280] issue, it was probably caused by the fact that busybox ip utility does not recognise the link type. Installing ip-full should solve the it. This is a relatively minor one.

To temporarily get around the first issue, you can edit /lib/functions.sh and insert a call to "true" at the end of "insert_modules" function. This is ugly hack of course...

I will propose in the mailing list to at least add a patch for ubox utility of 17.01

Ken commented on 25.04.2017 21:32

Awesome !

I tried your "get around / ugly hack" and it seems to work : I installed kmod-can-usb-8dev and plugged the device in and seems to work :

[ 2848.089761] usb 1-1: new full-speed USB device number 2 using ehci-platform
[ 2848.309757] usb 1-1: device descriptor read/64, error -71
[ 2848.588980] usb_8dev 1-1:1.0 can0: firmware: 1.7, hardware: 1.0

I'll test more when I can get access to a CANbus (modern cars and boats use CANbus).

I also installed "ip-full" and the "link/[280]" output becomes "link/can"

Thanks !

Project Manager
Yousong Zhou commented on 28.04.2017 06:29

I just check with mips_24kc, the new fixed ubox package is now available. "opkg install ubox" should bring it up to date.

Ken commented on 06.05.2017 18:02

That works.

I did "opkg upgrade ubox" and then "opkg install kmod-can" and there was no error.

FYI, "opkg install kmod-can-usb-8dev" installs the CANbus device driver and plugging the device in shows "usb_8dev 1-1:1.0 can0: firmware: 1.7, hardware: 1.0" in dmesg.

Thanks!

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing