Comments (7)
In both of your outputs (ifconfig
and ip
) the txqueuelen
is 10
, to proper set the txqueuelen
use:
/sbin/ip link set can0 txqueuelen 1000 up type can bitrate 1000000 dbitrate 8000000 restart-ms 1000 berr-reporting on fd on
Are you actually using CAN-FD with a data bitrate of 8 Mbit/s?
The TX errors will not "disappear" as they are cumulative counters. Completely removing the device driver or a reboot will.
You have enabled bit error reporting, use candump any,0~0,#FFFFFFFF -cexdtA
to show and decode any bit errors on the bus.
If your devices goes into ERROR_PASSIVE
there's something wrong on the bus. Can you send me a candump any,0:0,#FFFFFFFF -cexdtA
of normal traffic, when your python code is running and communicating the the drives. Which CAN-IDs are you using to communicate with the drives? Which CAN-ID are they using to answer back?
from can-utils.
I modified the /etc/network/interfaces
as you suggested:
auto can0
iface can0 inet manual
pre-up /sbin/ip link set can0 down
pre-up /sbin/ip link set can0 txqueuelen 1000 up type can bitrate 1000000 dbitrate 8000000 restart-ms 1000 berr-rep>
up /sbin/ip link set can0 up
down /sbin/ip link set can0 down
Running ifconfig
at boot now correctly shows
Trying cangen candump
leads to the same error message of "write : No buffer space available". This was with the Power Supply on for the motors. However, after rebooting, this time turning on the motor's power supply only once the RPi is on, cangen candump
works (despite the TX errors).
Was a txqueuelen = 65536
too high?
For setting the bitrate to 8 MBit/s I followed what was indicated on their setting up page.
This is my candump can0
when running the python script (when it works):
These are the codes I use to communicate with the CAN:
class TMOTOR_SPECIAL_CAN_CODES:
ENABLE_CAN_DATA = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC] # Enables the motor
DISABLE_CAN_DATA = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD] # Disables the motor
ZERO_CAN_DATA = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE] # Sets current position to zero
The CAN_IDs I use for the motors are 3
and 4
. For the bus communication:
filters = [{"can_id": 0x000, "can_mask": 0x7FF, "extended": False}]
self.bus = Bus(channel="can0", bustype="socketcan", can_filters=filters, bitrate=1000000)
filters = [{"can_id": 0x003, "can_mask": 0x7FF, "extended": False}]
self.bus = Bus(channel="can0", bustype="socketcan", can_filters=filters, bitrate=1000000)
from can-utils.
Was a txqueuelen = 65536 too high?
No, don't know why this doesn't for for you.
For setting the bitrate to 8 MBit/s I followed what was indicated on their setting up page.
You should look at the datasheet of your drive, if they use CAN or CAN-FD and configure you raspi accordingly.
Can you send me a candump any,0:0,#FFFFFFFF -cexdtA
of normal traffic, when your python code is running and communicating the the drives.
There's CAN-ID 000
, 003
and 004
on this bus. Please tell me who is sending these CAN-IDs.
from can-utils.
This is what I get from candump any,0:0,#FFFFFFFF -cexdtA
The motors being different versions, one has CAN_ID = 3 / 0x003 in the filters, whilst the other has CAN_ID = 4 / 0x000 in the filters.
from can-utils.
I see CAN-ID 003
as RX and TX. Does doesn't look good. You cannot send the same CAN-ID from different CAN controllers.
from can-utils.
That is simply the way this motor is setup... I will see if I can change it but not sure.
from can-utils.
Related Issues (20)
- Miss frame when using canfdtest HOT 4
- CMake build broken due to ISOBUS HOT 2
- Any write to CAN_BCM socket returns -1 with errno = 22 HOT 7
- isobusfs throws warning when compiled with recent clang HOT 1
- can-j1939 - trying to emulate an entire truck HOT 22
- unable to transmit CAN frames with ixxat USB-to-CAN v2 HOT 6
- bcmserver: build issue with AOSP14 HOT 1
- can-calc-bit-timing - with an invalid option, exit code is 0
- CAN FD, data phase bitrate is equal to arbitration phase (RPI4 + MCP2518FD) HOT 3
- Error when using dbitrate with fd on : RTNETLINK answers : Operation not supported HOT 12
- New tools: canerrsim and canerrdump HOT 3
- Too many build systems HOT 2
- isobusfs_srv_cm: stringop-overflow HOT 1
- isobusfs_cmn: format-truncation warning
- gcc complains about unknown pragma
- HELP!! HOT 1
- That was easy to help on empty problems! HOT 3
- isobusfs_cmn: Werror=format HOT 1
- How do I compile AOSP without the Android.mk file? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from can-utils.