Hello Robert,

-----Ursprüngliche Nachricht-----
Von: "Robert Haddon" <[email protected]>
Gesendet: 10.02.2011 17:29:58
An: "Lukas Siebicke" <[email protected]>
Betreff: Re: [Socketcan-users] "ifconfig slcan0 up" fails on Ubuntu

>
>On 2/9/11 11:00 PM, "Oliver Hartkopp" 
>wrote:
>
>>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-td2
>>>4621697.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
>
>
>I'm guessing that after running both slcan_attach and then slcand shortly
>after caused the kernel to pick a new network device name for the slcan
>interface, like slcan1 or slcan2.  Other than that, I cannot think of why

No, i don't think so. I had tried with and looked for slcan0, slcan1 ... slcan9 
but they did not exist.

>it would be harmful to start and stop slcan_attach and then start slcand.
>Of course, there is no need to run both when operating normally.

Not running slcand solved the problem (as also stated in my reply to Oliver).

>
>Cheers,
>Robert
>

Thank you.
Best regards,
Lukas

___________________________________________________________
WEB.DE DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt mit 
gratis Handy-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to