From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Leo Stan <leo.stanislas@qut.edu.au>, linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: kvaser leaf and SocketCAN
Date: Thu, 30 Apr 2015 09:27:30 +0200 [thread overview]
Message-ID: <5541D962.5040103@hartkopp.net> (raw)
In-Reply-To: <5541D057.2020003@pengutronix.de>
On 30.04.2015 08:48, Marc Kleine-Budde wrote:
> On 04/30/2015 08:14 AM, Leo Stan wrote:
>> close(s);
>>
>> return 0;
>> }
>>
>> I get this flag :
>>
>> can0 at index 3
>> can raw socket read: Network is down
> ^^^^^^^^^^^^^^^
> You have to configure your CAN network device first, then bring it into
> an operational state, this means the network is "up".
>
> ip link set can0 type can bitrate 500000
> ip link set can0 up
>
> See section "6.5.1 Netlink interface to set/get devices properties"
> http://lxr.free-electrons.com/source/Documentation/networking/can.txt#L990
>
Yes.
Stan: please download
https://github.com/linux-can/can-utils
compile and install them (make && make install) or with autotools.
And use 'cansend' and 'candump' to check whether its working.
On recent Debian / Ubuntu you can try
apt-get install can-utils
Programming your own stuff makes sense when you have a working CAN setup.
But when you are fighting on the basic driver side *and* the userspace apps it
becomes very hard.
There are also code examples in
https://github.com/linux-can/can-tests
which will help you more than the Wikipedia code sniplet.
And read
https://www.kernel.org/doc/Documentation/networking/can.txt
which Marc already suggested.
Best regards,
Oliver
next prev parent reply other threads:[~2015-04-30 7:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 7:31 kvaser leaf and SocketCAN max
2015-04-22 8:03 ` Marc Kleine-Budde
2015-04-29 2:01 ` Leo Stan
2015-04-29 3:50 ` Austin Schuh
2015-04-29 4:39 ` Leo Stan
2015-04-29 5:20 ` Marc Kleine-Budde
2015-04-29 6:15 ` Leo Stan
2015-04-29 6:33 ` Alexander Stein
2015-04-29 6:34 ` Marc Kleine-Budde
2015-04-29 10:45 ` Ahmed S. Darwish
2015-04-30 3:11 ` Leo Stan
2015-04-30 6:04 ` Marc Kleine-Budde
2015-04-30 6:14 ` Leo Stan
2015-04-30 6:25 ` Leo Stan
2015-04-30 6:48 ` Marc Kleine-Budde
2015-04-30 7:27 ` Oliver Hartkopp [this message]
2015-05-04 1:52 ` Leo Stan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5541D962.5040103@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=leo.stanislas@qut.edu.au \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox