Title: LocalNode not emitting TPDOs · Issue #328 · canopen-python/canopen · GitHub
Open Graph Title: LocalNode not emitting TPDOs · Issue #328 · canopen-python/canopen
X Title: LocalNode not emitting TPDOs · Issue #328 · canopen-python/canopen
Description: Great library. Generally it has been nice to use, but I'm having some trouble with PDOs. I would like to use the canopen library to simulate a number of slave devices. Configuration of the slaves will be read from an eds/dcf file and the...
Open Graph Description: Great library. Generally it has been nice to use, but I'm having some trouble with PDOs. I would like to use the canopen library to simulate a number of slave devices. Configuration of the slaves w...
X Description: Great library. Generally it has been nice to use, but I'm having some trouble with PDOs. I would like to use the canopen library to simulate a number of slave devices. Configuration of the slav...
Opengraph URL: https://github.com/canopen-python/canopen/issues/328
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"LocalNode not emitting TPDOs","articleBody":"Great library. Generally it has been nice to use, but I'm having some trouble with PDOs.\r\n\r\nI would like to use the canopen library to simulate a number of slave devices. Configuration of the slaves will be read from an eds/dcf file and thereafter the bus master may make further configuration changes to the slave devices PDOs. In the final application the bus master will be a separate physical device (_not_ the canopen library).\r\n\r\nTo begin I am trying to set up a single slave and get it to transmit a PDO. For convenience I am using the canopen library to also simulate my bus master. I have two python repls open. Top left is the bus master, bottom left is the slave and right is a dump of the virtual CAN bus they are communicating over.\r\n\r\nMy expectation was that a slave with event-driven asynchronous TPDOs configured would start transmitting the TPDO as soon as it was put into 'OPERATIONAL' mode. I'm new to CANOpen, so I'm not sure if this expectation is correct. But this is the case with an actual CANOpen sensor (encoder) that I've been experimenting with. You can see in the screen capture that I've tried to configure the slave PDO (most of the config and mappings are already done in the DCF file) and put it into operational mode, but I don't get any PDOs in the candump.\r\n\r\n\r\n\r\nI notice that there is a `tpdo.start(interval)` function in the API, but I don't quite understand how this works. Is this supposed to be called on the device that is emitting the TPDO (the slave device in my case)? How do I use this if I don't know in advance which PDOs the master will configure? Is there some kind of callback that I should invoke it from when the slave is put into operational mode?\r\n\r\nAlso, when I call the `start()` function I am getting an error:\r\n```\r\n\u003e\u003e\u003e node.tpdo[1].start(1)\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/home/nick/.local/lib/python3.10/site-packages/canopen/pdo/base.py\", line 498, in start\r\n self._task = self.pdo_node.network.send_periodic(\r\n File \"/home/nick/.local/lib/python3.10/site-packages/canopen/network.py\", line 233, in send_periodic\r\n return PeriodicMessageTask(can_id, data, period, self.bus, remote)\r\n File \"/home/nick/.local/lib/python3.10/site-packages/canopen/network.py\", line 311, in __init__\r\n self.msg = can.Message(is_extended_id=can_id \u003e 0x7FF,\r\nTypeError: '\u003e' not supported between instances of 'NoneType' and 'int'\r\n```","author":{"url":"https://github.com/nick-wlink","@type":"Person","name":"nick-wlink"},"datePublished":"2022-09-20T03:51:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/328/canopen/issues/328"}
| 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:cb585f36-acd2-77dc-ba17-7f3d484aaec6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA72:10A28F:7C811E:A24F8C:6A5EC530 |
| html-safe-nonce | 37a960b1b8d900a995dd78fba6430c9043126d539674d71bd1dd494307a7f4e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTcyOjEwQTI4Rjo3QzgxMUU6QTI0RjhDOjZBNUVDNTMwIiwidmlzaXRvcl9pZCI6IjUwNjM3MzA0MjE4Nzc4ODQyMDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a6a209fa320f612e36f4be5a12a6e9804dc684ab957669884a9297414d89fe34 |
| hovercard-subject-tag | issue:1378778332 |
| 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/328/issue_layout |
| twitter:image | https://opengraph.githubassets.com/72cba9465fb026829a9828ac974aca614092c76e538630943a6743ba86b8acca/canopen-python/canopen/issues/328 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/72cba9465fb026829a9828ac974aca614092c76e538630943a6743ba86b8acca/canopen-python/canopen/issues/328 |
| og:image:alt | Great library. Generally it has been nice to use, but I'm having some trouble with PDOs. I would like to use the canopen library to simulate a number of slave devices. Configuration of the slaves w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nick-wlink |
| hostname | github.com |
| expected-hostname | github.com |
| None | fbe2b3a3baf2f0e0ac1671a4d190d9de098dcf218eb73137ad46da364d3df398 |
| 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 | 0cd844a7ab298ec8d89b66ef4b195d158229d335 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width