Logitech G29: Physical Maximum in HID Device Descriptor is to little - linux

I am using a Raspberry Pi (linux kernel 4.4) and "libusb" to read the steering angle of a Logitech G29 HID Device (PS3 mode). I get only one byte of data for the angle and that is far to little for the steering range of +-450° deg. The HID Device Descriptor shows the problem.
Item(Global): Physical Maximum, data= [ 0xff 0x00 ] 255
How could I change the Physical Maximum to 65535?

Why do you think that a number from 0 to 255 cannot be used to represent angles between -450 and +450? Isn't it possible that a value of 0 corresponds to -450 degrees and a value of 255 corresponds to 455 degrees? It's very unlikely that Logitech made a fatal design flaw in the HID interface of their device.
If you really want to change the HID interface, then, at a minimum, you would have to reprogram the firmware of your G29 device in order to change that descriptor and change the HID report it describes. It is very likely that the device is closed source and that there are no instructions for reprogramming the firmware, so you are probably out of luck. Adding more resolution to that measurement might also require hardware changes, which could be difficult.

Related

i2c and Linux (127 devices and i2cdetect question)

[Update: This is wrong]It seems that with the i2cdetect program in Linux, it only scans addresses from 0 to 7f, while you technically can have 127 devices on the bus (0 to FF).[End of Wrong]
Furthermore, I've found that for an address that you might expect at 0x22 shows up as 0x11 in the program. This suggests that the i2cdetect program is bit shifting the address and ignoring the least significant bit.
However, the device tree also seems to require the 0x11 address in the tree versus the expect 0x22 address. I.e. my device is not recognized unless I put the bit shifted address. I do not have a long past history with linux and hardware drivers, so I'm wondering if this is expected behavior? E.g. I'm looking at the PCA9655 I/O Expander.
https://www.onsemi.com/pdf/datasheet/pca9655e-d.pdf
Thanks,

Can a USB HID keyboard report be more than 8 bytes in size?

Can a USB HID keyboard report be more than 8 bytes in size? If yes what else is it related with except the report descriptor.
I would like to change the size of report and I'll accordingly modify the report descriptor. Is that all or should I modify any other descriptors as well.
I also have a doubt that if I increase the report size do I need to modify the endpoint buffer. Can someone help me understanding the relation between endpoint and report size?
HID Report descriptor is a descriptor for data stored in the reports that gets in and out of your device. Host knows the size of input reports by parsing this descriptor. If you want to change any report size, you need to modify its descriptor accordingly.
HID input reports are transported through USB Interrupt endpoints. Here you have limitations depending not on HID, but on USB version used: 8 bytes for low speed, 64 bytes for full speed, 1024 bytes for high speed. You should set relevant value in wMaxPacketSize field of the matching endpoint descriptor.
Your host application should submit a large-enough buffer to your host stack, of course.

How do I create a LIRC configuration file?

I'm trying to use Linux Infrared Remote Control LIRC library to record a custom signal from remote control and save it in a file. Then I will use these signals to send it back again through ir tx using raspberry pi
when I run test ir rx mode2 -d /dev/lirc1 the output seems good .
Using driver default on device /dev/lirc1
Trying device: /dev/lirc1
Using device: /dev/lirc1
space 16777215
pulse 9044
space 4463
pulse 601
space 1641
pulse 628
space 532
pulse 575
space 558
pulse 577
space 530
pulse 603
But when I open the /etc/lirc/lircd.conf file, this happens:
# Type of device controlled
# (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:
begin remote
name fan
bits 0
flags CONST_LENGTH
eps 0
aeps 0
one 0 0
zero 0 0
gap 50000
toggle_bit_mask 0x0
frequency 38000
begin codes
KEY_POWER 0x0
KEY_0 0x0
KEY_1 0x0
end codes
end remote
All saved keys are zeroes, so how do I solve this problem?
Your LIRC driver is configured and seems ok from this side. However it is worth double checking the driver has been set up correctly as I think this is the problem.
Assuming you are using T95m/T95N remote:
0x140 KEY_POWER
0x155 KEY_POWER
0x101 KEY_0
0x14e KEY_1
Try editing your etc/lirc/lircd.conf with the above values running it(blast some IR commands) and seeing if it turns the values back to 0x0 after.
I would suggest that you declare the transmitter GPIO pin first then the receiver
like this :
dtoverlay=gpio-ir-tx,gpio_pin=17
dtoverlay=gpio-ir,gpio_pin=18
and i would double check /etc/lirc/lirc_options.conf as TeeJay suggested
this fixed my problem on raspberrypi 3+

Bluetooth Low Energy [4.2 and later] - characteristics greater than 20 bytes with Qt on Linux

I'm not sure this would be better on Electronics Stack Exchange.
I've seen a few questions similar to this, but pre BLE 4.2 days, before it was possible to have characters of greater than 20 bytes, but these questions are outdated now.
To anyone who's not aware, from BLE 4.2 onwards, you have been able to send far more than 20 bytes in a characteristic. So, if you've not come across this, I have successfully been transferring characteristics of 240 odd bytes between iOS and a Silicon Labs device for well over a year.
I have recently set up a Nordic embedded device and knocked up a Qt GUI to transfer data between the Nordic device and the Qt app running on Linux, using the Bluez stack. It will transfer 20 byte characteristics just fine.
So, I increased the Nordic's characteristics to 40 bytes, but Qt is not playing at all with it.
I am confident things are right at the Nordic end because if I use a little Android app and query the 40 byte characteristic it reads all 40 bytes. This makes me think that the issue is at the Laptop end.
I have various unknowns:
Is my laptop really BT4.2. It's hard to know as Linux calls it an unknown device and its USB vendor and type number tell me it's an Intel device, yet the IDs seem to give me multiple possibilities.
hciconfig tells me that I am running HCI Version 4.2 and LMP Version 4.2. That, to me, suggests larger characteristics should work.
Can Linux itself cope with characteristics of greater than 20 bytes?
Can Qt cope with characteristics of greater than 20 bytes?
I am running Mageia 6 and Qt Creator 4.2.1 with Qt 5.9.4 kit.
I have no Windows or iOS device with LE new enough for larger characteristics. Also, Windows is a bit of a pain when it comes to LE...
Edit:
btmon gives this when it receives a 40 byte chatacteristic:
ACL Data RX: Handle 3585 flags 0x02 dlen 27 #1026 [hci0] 577.032058
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x0010
Data: 35303120546869732069732061206c6f6e672063
This is sending out a string from the Nordic:
"%1 This is a long characterstic %1",Messno,MessNo
MessNo gets incremented every time the Noridic sends out a message. This gets truncated to xxxx This is a long
So, this suggests to me that it's getting truncated either by the BT stack on the assumption that this is what the Qt app is digesting.
You should increase the MTU size from the nordic device. It has nothing to do with Qt.

ALIX 2D13, linux kernel error "serial number revalidation" using Compact Flash and Harddisk

i'm building a linux based firmare for an alix 2d13 using crosstools-ng, for the toolchain, buildroot, for the root filesystem, and vanilla kernel ... for the kernel.
I need to use compact flash and harddisk but, when i connect them to the alix, i get a really weird error:
[ 1.072380] ata1.00: CFA: CF Card, Ver2.34, max UDMA/100
[ 1.077738] ata1.00: 7880544 sectors, multi 0: LBA
[ 1.082670] ata1.00: limited to UDMA/33 due to 40-wire cable
[ 1.096260] ata1.00: serial number mismatch '6EB10703040700582043' != '6EB1p703040700582043'
[ 1.104738] ata1.00: revalidation failed (errno=-19)
[ 1.109740] ata1.00: limiting speed to UDMA/33:PIO3
.
.
.
[ 6.209775] ata1.00: serial number mismatch '6EB10703040700582043' != '6EB1p703040700582043'
[ 6.218324] ata1.00: revalidation failed (errno=-19)
[ 6.222235] ata1.00: disabled
All works fine if i detach the harddisk from alix. hdparm output is:
Model=CF Card , FwRev=Ver2.34 , SerialNo=6EB10703040700582043
Config={ HardSect NotMFM Fixed DTR>10Mbs }
RawCHS=7818/16/63, TrkSize=32256, SectSize=512, ECCbytes=4
BuffType=(2) DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=?1?
CurCHS=7818/16/63, CurSects=7880544, LBA=yes, LBAsects=7880544
IORDY=yes, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2
AdvancedPM=no
And alix configuration is
(C) CHS mode L LBA mode W HDD wait V HDD slave U UDMA enable
I tried using pata_amd and pata_cs5536 but the result is the same.
Full kernel output is here
http://pastebin.com/7wcvEdRG
You have a hardware problem or serious misconfiguration, where bits are getting scrambled between the device and host.
When the kernel tries to read the serial number from the drive (using an ATA identify device command), one of the bytes gets a bit flipped. Note that the bad character 'p' (0x70) is only one bit different from '0' (0x30).
It's likely that scrambling identify data is the least of your problems-- read/write data is probably unreliable as well.
If this only happens when you have two devices attached to the same ribbon cable, either one of two things is true:
The two devices are causing signal integrity problems when sharing the bus. Check all of your jumper settings. If everything else is correct, either find another device, a better cable, or give up and don't put them on the same cable.
Your kernel is misconfiguring the ATA controller when both devices are present.

Resources