View Categories

Sony foot control unit FS-85USB

Information #

  • idVendor=054c
  • idProduct=0104

dmesg #

usb 6-1: new low-speed USB device number 12 using ohci-platform
usb 6-1: New USB device found, idVendor=054c, idProduct=0104, bcdDevice= 3.10
usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 6-1: Product: ICD-FootControlUnit
usb 6-1: Manufacturer: Sony


udevadm info /dev/input/event0 #

P: /devices/platform/soc/1c1b400.usb/usb6/6-1/6-1:1.0/0003:054C:0104.0002/input/input1/event0
M: event0
R: 0
U: input
D: c 13:64
N: input/event0
L: 0
S: input/by-path/platform-1c1b400.usb-usb-0:1:1.0-event-kbd
S: input/by-id/usb-Sony_ICD-FootControlUnit-event-kbd
E: DEVPATH=/devices/platform/soc/1c1b400.usb/usb6/6-1/6-1:1.0/0003:054C:0104.0002/input/input1/event0
E: DEVNAME=/dev/input/event0
E: MAJOR=13
E: MINOR=64
E: SUBSYSTEM=input
E: USEC_INITIALIZED=83025288369
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_BUS=usb
E: ID_MODEL=ICD-FootControlUnit
E: ID_MODEL_ENC=ICD-FootControlUnit
E: ID_MODEL_ID=0104
E: ID_SERIAL=Sony_ICD-FootControlUnit
E: ID_VENDOR=Sony
E: ID_VENDOR_ENC=Sony
E: ID_VENDOR_ID=054c
E: ID_REVISION=0310
E: ID_TYPE=hid
E: ID_USB_MODEL=ICD-FootControlUnit
E: ID_USB_MODEL_ENC=ICD-FootControlUnit
E: ID_USB_MODEL_ID=0104
E: ID_USB_SERIAL=Sony_ICD-FootControlUnit
E: ID_USB_VENDOR=Sony
E: ID_USB_VENDOR_ENC=Sony
E: ID_USB_VENDOR_ID=054c
E: ID_USB_REVISION=0310
E: ID_USB_TYPE=hid
E: ID_USB_INTERFACES=:030101:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH=platform-1c1b400.usb-usb-0:1:1.0
E: ID_PATH_TAG=platform-1c1b400_usb-usb-0_1_1_0
E: LIBINPUT_DEVICE_GROUP=3/54c/104:usb-1c1b400.usb-1
E: DEVLINKS=/dev/input/by-path/platform-1c1b400.usb-usb-0:1:1.0-event-kbd /dev/input/by-id/usb-Sony_ICD-FootControlUnit-event-kbd
E: TAGS=:power-switch:
E: CURRENT_TAGS=:power-switch:


Keypresses #

In order to see wicht keypresses the pedal emulates we can use:

sudo showkey

Pressing leftside of the pedal:

keycode 105 press
keycode 105 release

Pressing center of the pedal:

keycode 106 press
keycode 106 release

Pressing right side of the pedal:

keycode  68 release
keycode  87 release

evtest #

sudo apt install evtest

Left side PRESSED:

Event: time 1733136794.861150, -------------- SYN_REPORT ------------
Event: time 1733136795.021191, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1733136795.021191, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1733136795.021191, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70050
Event: time 1733136795.021191, type 1 (EV_KEY), code 105 (KEY_LEFT), value 0
Event: time 1733136795.021191, -------------- SYN_REPORT ------------
Event: time 1733136795.421145, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1733136795.421145, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1733136795.421145, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70050
Event: time 1733136795.421145, type 1 (EV_KEY), code 105 (KEY_LEFT), value 1

Left side HOLD:

Event: time 1733136716.918978, -------------- SYN_REPORT ------------
Event: time 1733136717.191634, type 1 (EV_KEY), code 105 (KEY_LEFT), value 2
Event: time 1733136717.191634, -------------- SYN_REPORT ------------
Event: time 1733136717.231641, type 1 (EV_KEY), code 105 (KEY_LEFT), value 2
Event: time 1733136717.231641, -------------- SYN_REPORT ------------
Event: time 1733136717.271652, type 1 (EV_KEY), code 105 (KEY_LEFT), value 2
Event: time 1733136717.271652, -------------- SYN_REPORT ------------
Event: time 1733136717.311636, type 1 (EV_KEY), code 105 (KEY_LEFT), value 2

Middle PRESSED:

Event: time 1733136754.038112, -------------- SYN_REPORT ------------
Event: time 1733136755.062102, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1733136755.062102, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1733136755.062102, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004f
Event: time 1733136755.062102, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1
Event: time 1733136755.062102, -------------- SYN_REPORT ------------
Event: time 1733136755.335637, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 2
Event: time 1733136755.335637, -------------- SYN_REPORT ------------
Event: time 1733136755.350090, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1733136755.350090, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1733136755.350090, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004f
Event: time 1733136755.350090, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0

Middle HOLD:

Event: time 1733136827.427633, -------------- SYN_REPORT ------------
Event: time 1733136827.467633, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 2
Event: time 1733136827.467633, -------------- SYN_REPORT ------------
Event: time 1733136827.507633, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 2
Event: time 1733136827.507633, -------------- SYN_REPORT ------------
Event: time 1733136827.547634, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 2
Event: time 1733136827.547634, -------------- SYN_REPORT ------------
Event: time 1733136827.587633, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 2
Event: time 1733136827.587633, -------------- SYN_REPORT ------------
Event: time 1733136827.627633, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 2

Right PRESSED:

Event: time 1733136862.283525, -------------- SYN_REPORT ------------
Event: time 1733136864.827500, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70043
Event: time 1733136864.827500, type 1 (EV_KEY), code 68 (KEY_F10), value 1
Event: time 1733136864.827500, -------------- SYN_REPORT ------------
Event: time 1733136864.835471, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70043
Event: time 1733136864.835471, type 1 (EV_KEY), code 68 (KEY_F10), value 0
Event: time 1733136864.835471, -------------- SYN_REPORT ------------
Event: time 1733136865.051464, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70044
Event: time 1733136865.051464, type 1 (EV_KEY), code 87 (KEY_F11), value 1
Event: time 1733136865.051464, -------------- SYN_REPORT ------------
Event: time 1733136865.059451, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70044
Event: time 1733136865.059451, type 1 (EV_KEY), code 87 (KEY_F11), value 0

Readout keypressed with node-red #

With node-red we can read-out the keypressed with evtest by filtering the output:

Function node:

if (msg.payload) {
    // Splits de payload in regels
    let lines = msg.payload.split('\n');
    
    // Definieer de sleutelwoorden die je wilt detecteren
    let keysToFilter = ['(KEY_LEFT)', '(KEY_RIGHT)', '(KEY_F10)', '(KEY_F11)'];

    // Zoek naar regels met de gewenste sleutelwoorden en waarden
    for (let line of lines) {
        for (let key of keysToFilter) {
            if (line.includes(key)) {
                // Zoek de waarde (bijvoorbeeld 0, 1, 2) in de regel
                let match = line.match(/value (\d+)/);
                if (match) {
                    let value = match[1]; // Pak de waarde uit de match
                    // Stel de payload in op KEY_RIGHT_1, KEY_LEFT_0, etc.
                    msg.payload = `${key}_${value}`;
                    return msg;
                }
            }
        }
    }
}

// Retourneer niets als er geen match is
return null;

Debug output:

Example FLOW

[
    {
        "id": "ef101a8bf14c7170",
        "type": "exec",
        "z": "ee06b2afe8e78a1e",
        "command": "evtest /dev/input/event0",
        "addpay": false,
        "append": "",
        "useSpawn": "true",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 330,
        "y": 280,
        "wires": [
            [
                "e60ea5fbac6f1d61"
            ],
            [],
            []
        ]
    },
    {
        "id": "b3eea446bd16b143",
        "type": "inject",
        "z": "ee06b2afe8e78a1e",
        "name": "Start",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "5",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 150,
        "y": 280,
        "wires": [
            [
                "ef101a8bf14c7170"
            ]
        ]
    },
    {
        "id": "e60ea5fbac6f1d61",
        "type": "function",
        "z": "ee06b2afe8e78a1e",
        "name": "Decode",
        "func": "if (msg.payload) {\n    // Splits de payload in regels\n    let lines = msg.payload.split('\\n');\n    \n    // Definieer de sleutelwoorden die je wilt detecteren\n    let keysToFilter = ['(KEY_LEFT)', '(KEY_RIGHT)', '(KEY_F10)', '(KEY_F11)'];\n\n    // Zoek naar regels met de gewenste sleutelwoorden en waarden\n    for (let line of lines) {\n        for (let key of keysToFilter) {\n            if (line.includes(key)) {\n                // Zoek de waarde (bijvoorbeeld 0, 1, 2) in de regel\n                let match = line.match(/value (\\d+)/);\n                if (match) {\n                    let value = match[1]; // Pak de waarde uit de match\n                    // Stel de payload in op KEY_RIGHT_1, KEY_LEFT_0, etc.\n                    msg.payload = `${key}_${value}`;\n                    return msg;\n                }\n            }\n        }\n    }\n}\n\n// Retourneer niets als er geen match is\nreturn null;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 280,
        "wires": [
            [
                "9a16335bdbe14406"
            ]
        ]
    },
    {
        "id": "9a16335bdbe14406",
        "type": "debug",
        "z": "ee06b2afe8e78a1e",
        "name": "Debug OUTPUT",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 680,
        "y": 280,
        "wires": []
    }
]