Venus changes
jhofstee opened this issue · 7 comments
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...
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.
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
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.
[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:
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.
thank you very much for your valuable time and effort !