no sdo response recieved

1k views Asked by At

I'm working on creating a virtual canopen slave with python to communicate with an existing master. when running my script I keep getting this error "no sdo response recieved". As far as I know, I need an sdo server to send response to the master, is it possible to create a virtual sdo server that does the job? otherwise, does anyone have an idea on how to fix that problem?

1

There are 1 answers

0
Filip Kubicz On

Yes, it's possible to create a virtual CAN device that will have a SDO server. You can use it together with virtual CAN bus (vcan on Linux) to test your CAN communication before you have your hardware available.

  1. Enable vcan:
 $ modprobe vcan
 $ sudo ip link add dev vcan0 type vcan
 $ sudo ip link set up vcan0
  1. Start a virtual CAN device with SDO server:

From the tags in question I assume you use python-canopen. So you can use this one https://canopen.readthedocs.io/en/latest/sdo.html#canopen.sdo.SdoServer, that will read your node.eds or node.xdd file. Run this Python script in one terminal. Remember to use vcan0 interface. network.connect(channel='can0', bustype='socketcan')

  1. Run your "master" SDO client script in second terminal. It will read the SDO from your virtual device. Remember to use vcan0 interface.