Closed jaghatei closed 6 months ago
You are correct. I am no longer adding the server node id. As far as I can tell that was a convenience feature added to other libraries (notably CANopenNode which I was testing with). I removed it with the goal of making Eds entries more intentional and not assuming what the user wanted.
I am updating the example as you suggested, and adding another entry to the porting guide on the README to highlight the change.
I fixed the (cobIdRx & 0xF) == 0x0) bug for the deprecated addServer/addClient API. Good catch there. I also removed some vestigial code from upload/download which used to support that sort of "wildcard" SDO server entry.
Change should be reflected in 6.0.1 shortly.
I recently upgrade an old project from canopen 2.8.2 to 6.0.0 and found all SDO uploads failing with timeout. The reason is that the cobIdTx and cobIdRx are in version 6.0.0 no longer automatically enriched with the server node id. CAN traffix while SDO timeout in canopen 6.0.0:
CAN traffic without SDO timeout in canopen 2.8.2:
possible workaround in 6.0.0 is to call
device.eds.addSdoClientParameter(0x20, 0x600|0x20 ,0x580|0x20);
to manually set correct effective cobId(Tx/Rx), instead ofdevice.eds.addSdoClientParameter(0x20, 0x600 ,0x580);
if looks odd to me that you are checking like this if serverId already has been applied to cobId(Tx/Rx):
I assume this more should be
as node ids are valid from 1 to 127 and not just from 1 to 15. Please review if this is a bug or a desired behaviour, but if it is desired you at least need to update the SDO examples to reflect the changed call of addSdoClientParameter.