You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run this binary, I get error "sendto failed: Cannot assign requested address".
Is there anything distinctly I'm doing wrong here? I tried to find the configured addressing/names but I do not have a /proc/net/can/j1939 file to cat.
I've confirmed the vcan interface is configured and up:
sudo ip -details link show vcan0
5: vcan0: <NOARP,UP,LOWER_UP> mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/can promiscuity 0 minmtu 0 maxmtu 0
vcan numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
and sudo modprobe vcan is successful.
The text was updated successfully, but these errors were encountered:
You are setting NAME for the bind address:
addr.can_addr.j1939.name = 0x01; // peer, name = 1
If you are doing it, you need to do address claiming and the kernel stack should see the address claiming on the bus. So, you should use j1939acd to claim the address, or add own code to do it, or set J1939_NO_NAME. Especially if you areldy set the address, name is not needed.
Except of this, you are trying to send a can frame as payload, this makes no sense. Payload is just a payload, everything else is done by the kernel stack. For example if it is more then 8 byte, it will be split and transferred by using transport protocol.
Looking for some assistance here - I am trying to create a simple program to send a j1939 message on a vcan interface.
My goals:
When I run this binary, I get error "sendto failed: Cannot assign requested address".
Is there anything distinctly I'm doing wrong here? I tried to find the configured addressing/names but I do not have a
/proc/net/can/j1939
file tocat
.I've confirmed the vcan interface is configured and up:
and
sudo modprobe vcan
is successful.The text was updated successfully, but these errors were encountered: