scorp wrote on 2021-11-08, 14:12:
Well, unfortunately I have no Cyberman 2 here to investigate, so you will probably have to try to find out what is wrong on your own. I just can tell, that if the Joystick is recognized properly, then the adapter can read the packages from the joystick properly. So the issue must be somewhere in the state decoder. If really nothing moves, not one button works and no other things are happening, like for example you press a button and an axis is jumping, or other way around you move and axis and some buttons are jumping, then the decoder seems to stop the operation very early.
If you are in C/C++, I'd start with the check of the packet size. See Logitech.cpp:63. You can use Serial.print() to send some values onto the serial console and see in the Arduino IDE Serial Monitor what comes out. May be this way you can spot the line, where it fails. As I said, it's going to be very complicated for me to make a remote assumption. From the Logitech devices I have only the Wingman Extreme Digital and that's the only one I tested so far.
Hi!
So, I've fiddled a bit with the sketch, and added a serial dump of the received packet bits to the readPacket() function.
This shows that the readPacket function does not always read the packet correctly from the CyberMan 2, since it mostly returns packets made of only 1, 2 or 3 bits.
If in the update() function I put
if (packet.length != m_metaData.packageSize) {
enableDigitalMode();
const auto discardMetaPacket = readPacket();
return false;
}
which resets the digital mode, discards the metadata packet and then waits for the next update, then the first two or three packets after that do come in correctly (64bit packets), and then it goes back to 1/2/3 bit packets, and gets reset again, and so on...
In this strange way the adapter works properly, and in the joystick control panel I can see all the buttons and axes working properly, albeit a little slow!
Any hint on how can I proceed, what to check/test/change ?
Thanks!
Everything that deserves to be done, should be done right.