fHDHR / fHDHR_plugin_origin_ceton

Do What The F*ck You Want To Public License
1 stars 4 forks source link

Add support for Ceton PCIe card(s) #17

Closed arrmo closed 2 years ago

arrmo commented 2 years ago

Updates as discussed at https://github.com/fHDHR/fHDHR_plugin_origin_ceton/issues/16

DanAustinGH commented 2 years ago

Looks clean and and sane to me. Since it imports glob can you add it to the plugin's requirements.txt? If @deathbybandaid does not have any objections I will merge this tomorrow.

deathbybandaid commented 2 years ago

Is there any way to use ceton api to determine device type?

If so, that would be preferable to a config value

deathbybandaid commented 2 years ago

Also read some docs on glob.glob and it appears to be Unix only. Does the Ceton pcie tuner work on Windows machines? If so I'd like to remove the glob.glob logic for something more like

# at top of file
import os

    if self.ceton_pcie:
        pciedevices = len([os.path.join("/dev/ceton/", x) for x in os.listdir("/dev/ceton/") if x.startswith("ctn91xx_ctl")])
        self.plugin_utils.logger.info('Ceton PCIe Device Count: %s' % pciedevices)

It might not be as pretty, but saves a dependency and retains an amount of compatibility.

arrmo commented 2 years ago

I'm fine with making this change, no issue at all @DanAustinGH - go this way, to also allow Windows support? If you're good with it as well, I'll update the PR.

Thanks!

deathbybandaid commented 2 years ago

@arrmo make sure you test that logic, I just typed it up, and have no way to test at the moment.

arrmo commented 2 years ago

Yes, absolutely!

DanAustinGH commented 2 years ago

@arrmo what does this return on your system? http://192.168.2001/get_var?i=0&s=diag&v=Host_Connection It shows 'Ethernet' for the standalone device

Best I can tell the PCI card was supported on windows prior to Win10, but then a driver architecture changed.

arrmo commented 2 years ago

It shows 'Ethernet' for the standalone device

Shows pci/ethernet for the internal card.