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

Venus changes #6

Open
jhofstee opened this issue Jul 12, 2022 · 7 comments
Open

Venus changes #6

jhofstee opened this issue Jul 12, 2022 · 7 comments

Comments

@jhofstee
Copy link

Just to drop you a note, since Venus v2.90~17 there is no longer a limit for 2 CAN-bus interfaces. Services will now be automatically created for new CAN interfaces. You can name them from udev if you like, see victronenergy/meta-victronenergy@e9ba448. And slcan no longer needs the bitrate.

There is a script as well in /opt/victronenergy/venus-platform/svectl to install services.

Feel free to close this issue, since it actually isn't an issue, just a note...

@kwindrem
Copy link
Owner

Is there documentation for this somewhere? I'd like to update my VeCanSetup package to support more than 2 CAN ports. Is there a practical limit to the number of CANbus ports?

Thanks.

@jhofstee
Copy link
Author

No better, we have code ;), see below.

There is no longer a need to set the bitrate for slcan with -s.
An optional name can be set for a CAN-bus interface.
There is no longer any limit on the number of CAN-interfaces.

https://github.com/victronenergy/linux/commits/venus-5.10.109
victronenergy/meta-victronenergy@e9ba448

@kwindrem
Copy link
Owner

Do these changes obsolete VeCanSetup? Sorry, I it isn't clear from the links you sent if VeCanSetup will have any value after v2.90~17 and can't look at the code for this release since it's no longer on the development branch and I didn't snag a copy when it was there.

Just want to do the right thing here.

@kwindrem
Copy link
Owner

kwindrem commented Jul 25, 2022

[EDIT]

I've been doing a lot of work with v2.90~18 and believe I have a working system.

I have hot-plug working. I needed to add 'udevadm trigger -y can[port number]' to the add script.

I have discovered Venus OS configures some ports automagically. That's essentially USB devices that do not use slcand. This automatic configuration was in conflict with manual configuration of each port as was done prior to v2.90~18. If a port was configured automatically, any udev rules installed by VeCanSetup were ignored. So I had to insure that any ports configured by VeCanSetup did not use the same port identifiers. To do so, the first port I configure via VeCanSetup is can10. That means ports between can0 and can9 are up for built-in ports or automatic configuration by Venus OS. Ports can10 - can 19 are configured by VeCanSetup.

Interface names aren't working. According to comments by jhofstee I should be able to add VE_NAME to the udev rules but this isn't changing the name seen in the Service menu. Still just the port identifier (can0).

For ports using slcand this is because the device port runs slcand which creates a second port that becomes the CANbus interface for the rest of the system. The device port ends up with a name like ttyACM0. Parameters attached to udev for the device port aren't transferred to the port (can0) used by the rest of the system. Once that second port is created, there is no way to add parameters to it.

For ports that don't use slcand an are automatically configured, the OS provides no mechanism to set the name.

I'd like someone at Victron to confirm what I'm doing is correct. If not, what's the correct way?

I have placed a test version on GitHub for evaluation by others:

https://github.com/kwindrem/VeCanSetup/tree/beta

@claib
Copy link

claib commented Aug 13, 2022

Hi there
I'm playing around with my 2.9 22 version on my Raspi.
Done the script steps. Seems to be fine.
grafik
On the Remote Web Interface i see no Service ....
Are there compat issues ?
best
Christoph

@kwindrem
Copy link
Owner

The "latest" version of VeCanSetup is not compatible with v2.90 due to the changes in the way Venus OS now handles CANbus ports.

There is a beta version of VeCanSetup available but I'm still working on several issues. I have not had the opportunity to test with any of the CANbus hats but have reports of them working pre v2.90 for others.

@claib
Copy link

claib commented Aug 14, 2022

thank you very much for your valuable time and effort !

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

3 participants