Am 09.02.2011 22:26, schrieb Lukas Siebicke:
Hello,

Hello Lukas,

I am trying to use a Lawicel CANUSB dongle (www.canusb.com) with
socketcan on Ubuntu but without success.
First I tested the communication with cutecom and that worked fine. To
use socketcan I have followed the instructions in a previous thread
(http://old.nabble.com/Some-problems-with-CANUSB-and-Ubuntu-8.04-9.04-td24621697.html)
which explained how to use the CANUSB hardware successfully with Ubuntu
9.04. Since I got make errors for socketcan in Ubuntu 10.10 (kernel
2.6.35) I tried with a fresh install of Ubuntu 9.04 using the same
kernel (2.6.28-11) as in the above mentioned tutorial post.

I think this part here is inthe tutorial pretty wrong:

8. Get serial interface "ttyUSB0" to networksocket "slc0"
---------------------------------------------------------
    - slcan_attach -o -s6 /dev/ttyUSB0
    - slcand ttyUSB0
    - ifconfig slc0 up


Now, here comes the problem:
Everything seems fine until the point where I can not bring slcan0 up,
not with

$ ifconfig slcan0 up
SIOCSIFFLAGS: no such device

(..)


$ slcan_attach -o -s6 /dev/ttyUSB0
attached tty /dev/ttyUSB0 to netdevice slcan0

$ slcand ttyUSB0
$ ip link set slcan0 type can
$ ifconfig slcan0 up
or
$ ip link set slcan0 up

here I get above reported error: no such device.

However,
$ ip link show slcan0
and
$ ifconfig -a
tell me that slcan0 exists but the state is DOWN.

I assume the problem when using both

    - slcan_attach

    - slcand

at the same time.

slcan_attach is a tool that can be used to attach the line discipline
from a terminal.

In your case, you attach the line discipline and then close the file
descriptor which kills it again. To omit this close, add a '-w' to the
slcan_attach (as shown in the help text).

Then you need to use a different terminal to continue :-)

The *other* way is to use slcand that runs as a daemon in the
background. Don't use both of these tools at the same time.

In general it's a good idea to play with a standard terminal programm (e.g. minicom) on /dev/ttyUSB0 first, to check whether the CANUSB works as expected when receiving CAN frames.

And when it does: Just type 'C' <enter> to close the adapter and quit
the terminal program. Then you can be sure that slcan_attach OR slcand
run in a working setup.

Regards,
Oliver

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to