CANopen troubleshooting
Where to find the logs
Section titled “Where to find the logs”Open the device in the portal and the log of the canopen-connector process. The bus scan and the SDO probe log in the canopen-browsing-service process. Lines about the CANopen library carry the field source=gocanopen.
For more detail, set the log level of the process to Debug. The connector then logs one line per second with the PDO values that it reads (CANopen input PDO values) and writes (CANopen output PDO value). Set the level back to Info when you are done.
Log lines of the connector
Section titled “Log lines of the connector”| Log line | Meaning and action |
|---|---|
CANopen session ended, will open the interface again with pre-flight check: ... | The interface does not exist, is DOWN, or runs at another bit rate than the connection. The error text names the command to run. See Setting up the host. The connector tries again after 1 s, then 2 s, up to 30 s. |
Another process uses this CAN interface (a second connector or a bus scan of the browsing service), will retry | A second connector, or a bus scan, holds the interface. Use one connection per interface. A scan ends by itself. |
Node not started with identity mismatch: configured vendor ... device reports vendor ... | The device on this node id has another vendor ID, product code or revision than the device description. Check the node id, or import the right file. The other nodes run. |
Node not started with which is not byte-aligned | The device file maps an entry that is not a whole number of bytes. See PDO entries that are not byte aligned. |
Node did not answer, will try again | The node does not answer SDO requests. Check the node id, the bit rate, the wiring and the termination. The connector tries again every 10 s. |
NMT Start sent | The node was started. The line shows vendor ID, product code, revision, serial number and the heartbeat timeout. |
Node has no heartbeat producer ... | Object 0x1017 of the node is missing or 0. The connector cannot detect that the node stops. Set a producer time in the device. |
Heartbeat of the node lost / Heartbeat of the node is back | The node sent no heartbeat for the Heartbeat factor times its producer time. After the heartbeat returns, the connector sends NMT Start again. |
Boot-up message received, the node restarted | The node restarted. The connector sends NMT Start again. |
EMCY received | An emergency message with code, register and text (CiA 301 description). |
CAN bus error | SocketCAN reported an error. A bus-off error ends the session, and the connector opens the interface again after the wait. Other errors are only logged. Check cabling, termination and bit rate. |
NMT Enter Pre-Operational sent | The runtime stopped. |
Errors of the bus scan and the SDO probe
Section titled “Errors of the bus scan and the SDO probe”errorCode | Meaning and action |
|---|---|
INTERFACE_NOT_READY | The pre-flight check failed. The message names the host command. |
BUS_UNAVAILABLE | The interface cannot be opened. Check that the container sees the interface (host network). |
BUS_OWNED_NO_SNAPSHOT | The connector runs and has not read the nodes yet. Try again in a few seconds. |
BUS_BUSY | Another probe or scan runs. Try again in a few seconds. |
CONNECTOR_STARTING | The connector still does its start-up checks. Try again in a few seconds. |
SDO_TIMEOUT | The node did not answer within 1000 ms. Check node id, bit rate, wiring. |
INVALID_VALUE | The value does not fit the data type. |
DATA_TYPE_MISMATCH | The object is longer than the buffer, or its size does not fit the data type. |
BUS_ERROR | Another bus error. See the log of the browsing service. |
Common problems
Section titled “Common problems”- A variable does not change and the node is Operational. Check that the entry is in an active PDO of the device file and that the device really runs this mapping (the connector never writes it). Read the PDO mapping objects (0x1A00 and 0x1600 groups) with the SDO probe and compare them with the file.
- An output does not reach the device. Outputs are sent every Output cycle (ms). Check the value, and the debug line
CANopen output PDO value. - A synchronous input updates slowly. A synchronous TPDO sends on SYNC. Set the SYNC period of the connection, or use an event-driven PDO.
- Scan finds a node, but it is not added. Import the EDS or DCF file with the same vendor ID, product code and revision, then scan again.