From: Oliver Hartkopp <socketcan@hartkopp.net>
To: vklein <vk4514@arcor.de>, linux-can@vger.kernel.org
Subject: Re: how to check if can0 is up
Date: Wed, 06 May 2015 17:28:07 +0200 [thread overview]
Message-ID: <554A3307.8070409@hartkopp.net> (raw)
In-Reply-To: <5547C40E.9050107@arcor.de>
Hi Victor,
On 05/04/2015 09:10 PM, vklein wrote:
> I want to test the status of can0 on a BeagleBoneBlack with serial-can cape
> from Logic Supply.
>
> The interface is initialized with
> ip link set can0 type can bitrate 250000
> ifconfig can0 up
Good.
> I have tried
> cat /sys/class/net/can0/operstate
> but this does not work correctly
>
> if can0 is down, I get "down"
>
> if can0 is up , I get "unknown"
The question is whether operstate is always set correctly ...
> ifconfig says:
> can0 Link encap:UNSPEC HWaddr
> 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
> UP RUNNING NOARP MTU:16 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:10
> RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
> Interrupt:55
>
What does
ip -det link show can0
tell you?
Using the 'ip' tool is recommended to get the device state.
Maybe the setting of the operstate in sysfs has to be fixed ?!?
Regards,
Oliver
next prev parent reply other threads:[~2015-05-06 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 19:10 how to check if can0 is up vklein
2015-05-06 15:28 ` Oliver Hartkopp [this message]
2015-05-07 7:59 ` Kurt Van Dijck
2015-05-07 11:44 ` vklein
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=554A3307.8070409@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=vk4514@arcor.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.