Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thoughts/questions on the Node class and j1939_nodes example #25

Open
grant-allan-ctct opened this issue Dec 4, 2023 · 2 comments
Open

Comments

@grant-allan-ctct
Copy link

I am looking at the j1939_nodes.py example code and seeing the comment:

# This example is an attempt to operate two address endpoints concurrently.
#
# Currently it's not tested and I suspect it's not handling the address claims correctly
# among other things

In the code, we are giving node1 and node2 both the same j1939 name value (of 0), here. This might be getting get in the way of things working correctly? Part of the j1939 name is a unique ID, and so placing two nodes with identical uniqueID is possibly going to play havoc with j1939 name arbitration? To make the example more real-world, maybe make a tweak that gives the two nodes unique names.

One reason why I am here looking at this file is that this particular example code has the only usage I can find (here) for the function node.send_parameter_group. I am interested in this function because it calls a function Bus.write (on this line), which I would like to look at because it looks very useful, but I am having trouble finding it anywhere in the python-1939 codebase, nor in the python-can base class. Does the write function no longer exist, or is this pehaps a typo and a different function is intended?

@milhead2
Copy link
Owner

milhead2 commented Dec 5, 2023 via email

@grant-allan-ctct
Copy link
Author

Thank you for the reply @milhead2.

I think I have updated my python virtual environment with an older python-can version, and still not seeing a write function.

However, noting that Node.send_parameter_group has a comment saying that data is allowed to be up to 1785 elements in length, I think that the method we're trying to call is one defined by the j1939.Bus class - I think that write probably should just be send instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants