Git Product home page Git Product logo

Comments (18)

jontis avatar jontis commented on September 13, 2024

@fpoussin is it possible that your method could work here?

from opencorsairlink.

fpoussin avatar fpoussin commented on September 13, 2024

Hey,

Actually, it seems that i'm still having the issue if I don't "initialize" the psu through corsair link using usb over IP on my desktop. (the psu is on a server)
Corsair link reads 64 (empty) bytes from the control endpoint at each command, which we don't, that might be worth trying.

This is the first few packets.
There are no special init commands as far as I can tell.
There's only one configuration and one interface so no tricks here.
2017-06-25 17_03_11-utlog utl - sysnucleus usbtrace

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

I think this outside my comfort zone...
"In", is that going "in"to the PSU or "out" from the PSU?

from opencorsairlink.

fpoussin avatar fpoussin commented on September 13, 2024

USB packet directions are always related to the host, so IN is a read from the PSU.

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

I'm not used to this low level communication protocols.
Do you have a testbed where you can issue single commands and read responses without compiling C programs?

from opencorsairlink.

fpoussin avatar fpoussin commented on September 13, 2024

You can do that with python:
https://gist.github.com/fpoussin/6c10f4a80e2792aed91bfb20c868dbca

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

This was not my strong side:
~/code/openCorsairLink/py_usb $ sudo python3 py_usb.py
Traceback (most recent call last):
File "py_usb.py", line 60, in
dev.set_configuration()
File "/usr/local/lib/python3.5/dist-packages/usb/core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "/usr/local/lib/python3.5/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/usb/core.py", line 148, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "/usr/local/lib/python3.5/dist-packages/usb/backend/libusb1.py", line 794, in set_configuration
_check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))
File "/usr/local/lib/python3.5/dist-packages/usb/backend/libusb1.py", line 595, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 16] Resource busy

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

Ok, so on with the work. That error was because some kernel driver had claimed the device.
This releases is:
if dev.is_kernel_driver_active(0):
print('Kernel driver was active, detaching')
dev.detach_kernel_driver(0)

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

This is what I get out from it:
request_string(CLINK_GET_POWER)
Out[77]: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

In [78]: request_string(CLINK_GET_PRODUCT)
Out[78]: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

In [79]: request_string(CLINK_GET_INPUT)
Out[79]: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

Can the instructions in ep_write be different for this PSU?

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

Tinkered a bit, now running a virtualbox with windows and letting wireshark dump from usbmon.
These are the requests with answers so far:
(3, 154) = RM650i
(3, 216) = 2.0
(3, 142) = 42.0
(2, 0) = 0.0
(3, 0) = 0.0
(3, 150) =128.0

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

Or in hex:
CLINK_GET_PRODUCT_650 = (0xFE, 0x03)
CLINK_GET_WHAT1 = (0x03, 0xD8)
CLINK_GET_WHAT2 = (0x03, 0x8E)
CLINK_GET_WHAT3 = (0x02, 0x00)
CLINK_GET_WHAT4 = (0x03, 0x00)
CLINK_GET_WHAT5 = (0x03, 0x96)

from opencorsairlink.

fpoussin avatar fpoussin commented on September 13, 2024

Ah yes sometimes the device needs to be released.
I already have the commands, they are the same for all RMi PSUs.

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

My bad, I interpreted the different commands in the guist as that there were differences in the RMIs api.
So all commands are already known?

from opencorsairlink.

fpoussin avatar fpoussin commented on September 13, 2024

Maybe not all, but most of them: https://github.com/audiohacked/OpenCorsairLink/tree/master/protocol/rmi

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

Ok, I was assuming something was missing as the program only reads 0 for everything.

from opencorsairlink.

fpoussin avatar fpoussin commented on September 13, 2024

The commands are correct, but there's some init somewhere that we are missing

from opencorsairlink.

jontis avatar jontis commented on September 13, 2024

anything I can test to help?

from opencorsairlink.

audiohacked avatar audiohacked commented on September 13, 2024

Fix committed to master branch. Please test

from opencorsairlink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.