Title: SDO Block Transfer fails with "Unknown SDO command specified" error · Issue #599 · canopen-python/canopen · GitHub
Open Graph Title: SDO Block Transfer fails with "Unknown SDO command specified" error · Issue #599 · canopen-python/canopen
X Title: SDO Block Transfer fails with "Unknown SDO command specified" error · Issue #599 · canopen-python/canopen
Description: SDO Block Transfer fails with "Unknown SDO command specified" error Hi everyone, I'm trying to send a binary file over SDO Block Transfer. I've created a Python SDO client that sends to an SDO server (ESP32-based CANopen node). Environme...
Open Graph Description: SDO Block Transfer fails with "Unknown SDO command specified" error Hi everyone, I'm trying to send a binary file over SDO Block Transfer. I've created a Python SDO client that sends to an SDO serv...
X Description: SDO Block Transfer fails with "Unknown SDO command specified" error Hi everyone, I'm trying to send a binary file over SDO Block Transfer. I've created a Python SDO client that se...
Opengraph URL: https://github.com/canopen-python/canopen/issues/599
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SDO Block Transfer fails with \"Unknown SDO command specified\" error","articleBody":"## SDO Block Transfer fails with \"Unknown SDO command specified\" error\n\nHi everyone, I'm trying to send a binary file over SDO Block Transfer. I've created a Python SDO client that sends to an SDO server (ESP32-based CANopen node).\n\n### Environment\n- Python canopen version: 2.3.0\n- Platform: Windows\n- CAN Interface: PCAN USB\n\n### Issue Description\nThe block transfer fails with error `Code 0x05040001, Unknown SDO command specified`. The server logs show a sequence error during the transfer.\n\n### Code to Reproduce\n```python\nimport canopen\nprint(canopen.__version__)\nimport os\n\nfilename = 'data/data.bin'\nnetwork = canopen.Network()\nnode = canopen.BaseNode402(10, \"path_to_od.eds\")\nnetwork.add_node(node)\nnetwork.connect(interface='pcan', channel='PCAN_USBBUS1', bitrate=125000)\n\nfilesize = os.path.getsize(filename)\nprint(f\"File size: {filesize} bytes\")\n\ntry:\n # Send file size\n filesize_bytes = filesize.to_bytes(4, byteorder='little', signed=False)\n node.sdo.download(0x2005, 2, filesize_bytes)\n \n # Send file data using block transfer\n with open(filename, 'rb') as infile, \\\n node.sdo[0x2005][3].open('wb', size=filesize, block_transfer=True) as outfile:\n while True:\n data = infile.read(1024)\n if not data:\n break\n outfile.write(data)\n \n print(\"Block transfer successful!\")\n \nexcept Exception as e:\n print(f\"Block transfer failed: {e}\")\n \nnetwork.disconnect()\n```\n### Error output\n```\nBlock transfer failed: Code 0x05040001, Unknown SDO command specified\n```\n\n### ESP32 Logs\n```\nI (41404) CO_driver: CANRX id: 0x60a, dlc: 8, data: [35 5 32 2 244 0 0 0]\nI (41413) CO_driver: CANRX id: 0x60a, dlc: 8, data: [198 5 32 3 244 0 0 0]\nI (41422) CO_driver: CANRX id: 0x60a, dlc: 8, data: [1 0 0 0 0 49 57 55]\nI (41423) CO_driver: CANRX id: 0x60a, dlc: 8, data: [2 48 45 48 49 45 48 49]\nI (41425) CO_driver: CANRX id: 0x60a, dlc: 8, data: [3 84 48 48 58 48 49 58]\nI (41431) CO_driver: CANRX id: 0x60a, dlc: 8, data: [4 53 50 0 0 0 0 0]\nI (41438) CO_driver: CANRX id: 0x60a, dlc: 8, data: [5 0 0 0 0 0 0 0]\nI (41444) CO_driver: CANRX id: 0x60a, dlc: 8, data: [6 0 115 121 115 116 101 109]\nI (41451) CO_driver: CANRX id: 0x60a, dlc: 8, data: [7 0 0 0 0 0 0 0]\nI (41457) CO_driver: CANRX id: 0x60a, dlc: 8, data: [8 0 0 0 0 0 0 0]\nI (41463) CO_driver: CANRX id: 0x60a, dlc: 8, data: [11 50 53 45 48 54 45 50]\nI (41470) CO_SDO: sub-block, rx WRONG: sequno=0B, previous=08\nI (41476) CO_driver: CANRX id: 0x60a, dlc: 8, data: [17 0 0 0 0 0 0 0]\nI (41482) CO_driver: CANRX id: 0x60a, dlc: 8, data: [23 0 0 0 0 0 0 0]\nI (41488) CO_driver: CANRX id: 0x60a, dlc: 8, data: [31 128 63 0 0 224 64 0]\nI (41498) CO_driver: CANRX id: 0x60a, dlc: 8, data: [197 81 178 0 0 0 0 0]\n```\n\n`CO_SDO: sub-block, rx WRONG: sequno=0B, previous=08` -\u003e Maybe a packet lost ?\n\n### EDS Configuration\n```\n[2005]\nParameterName=File transfert\nObjectType=0x9\nSubNumber=0x5\n\n[2005sub0]\nParameterName=Highest sub-index supported\nObjectType=0x7\nDataType=0x0005\nAccessType=ro\nDefaultValue=0x04\nPDOMapping=0\n\n[2005sub1]\nParameterName=File name\nObjectType=0x7\nDataType=0x0009\nAccessType=rw\nDefaultValue=0\nPDOMapping=0\n\n[2005sub2]\nParameterName=File size\nObjectType=0x7\nDataType=0x0007\nAccessType=rw\nDefaultValue=0\nPDOMapping=0\n\n[2005sub3]\nParameterName=File data\nObjectType=0x7\nDataType=0x000F\nAccessType=rw\nHighLimit=65536\nLowLimit=0\nDefaultValue=\nPDOMapping=0\n\n[2005sub4]\nParameterName=Transfert status\nObjectType=0x7\nDataType=0x0005\nAccessType=ro\nDefaultValue=0\nPDOMapping=0\n```\n\n### Questions\n1. Is my Python code correct for SDO block transfer?\n2. Could this be a configuration issue on the ESP32 server side?\n3. Is SDO block transfer fully supported in the Python canopen library? I've seen that the feature might not work correctly on every implementation.\n\nThanks in advance for any help!","author":{"url":"https://github.com/dhugoexe","@type":"Person","name":"dhugoexe"},"datePublished":"2025-07-08T08:10:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/599/canopen/issues/599"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7deb7301-dd77-c73d-9fc2-900bd2db95a2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACC6:5592:6946463:910265A:6A5E8A6D |
| html-safe-nonce | 7f9dffed30ea187a284fb00863cb7cf1679f941660261ba97797154783dc9e3d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0M2OjU1OTI6Njk0NjQ2Mzo5MTAyNjVBOjZBNUU4QTZEIiwidmlzaXRvcl9pZCI6IjEwNDQ4MDI4Njc2MDE0MzQ2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | adfea257373763ea87cfdafb411da00e1c1160978836d0bf4f716d9341bb0c45 |
| hovercard-subject-tag | issue:3211502463 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/canopen-python/canopen/599/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e5e0f099fd152325fe6c869f1a56ee1fc80d4f17a614ceb76aeeb93e0423d33b/canopen-python/canopen/issues/599 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e5e0f099fd152325fe6c869f1a56ee1fc80d4f17a614ceb76aeeb93e0423d33b/canopen-python/canopen/issues/599 |
| og:image:alt | SDO Block Transfer fails with "Unknown SDO command specified" error Hi everyone, I'm trying to send a binary file over SDO Block Transfer. I've created a Python SDO client that sends to an SDO serv... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dhugoexe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6846168613b61074bf9dc18814ffe7596f4950f1f3b3070cfea5af602ccb3327 |
| turbo-cache-control | no-preview |
| go-import | github.com/canopen-python/canopen git https://github.com/canopen-python/canopen.git |
| octolytics-dimension-user_id | 200581454 |
| octolytics-dimension-user_login | canopen-python |
| octolytics-dimension-repository_id | 68737600 |
| octolytics-dimension-repository_nwo | canopen-python/canopen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 68737600 |
| octolytics-dimension-repository_network_root_nwo | canopen-python/canopen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5d2e2a84380a21e7a59801a38bee3d8a5f0e822d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width