foxxyz / loupedeck

Node.js API for Loupedeck Controllers
MIT License
85 stars 9 forks source link

Razer Stream Controller X - Touch #30

Open snsuJH opened 6 months ago

snsuJH commented 6 months ago

Hi,

when running the simple example, it can connect to my Stream Controller and is able to draw to the buttons. But it does not react to any touch event.

Thanks for helping :)

serial number PM2312L06601175 software version 0.2.26

foxxyz commented 6 months ago

The Razer Stream Controller X doesn't have a touchscreen, so it does not emit touch events.

It should emit down and up events when you press the keys though. Are you getting those?

snsuJH commented 5 months ago

Unfortunately it doesn't emit anything. I can see the key-press-handle in your code, but that is not triggered by pressing a key. If I take a look at cat /dev/ttyACM0, I can see the handshake but nothing more.

cat /dev/ttyACM0
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: ALtlZo9FMEUEQleXJmq++ukUQ1s=

A console.info(response) inside onReceive(buff) of device.js (line 198) delivers the following on startup, but doesn't react to button press.

<Buffer 17 73 00 43 6f 6e 6e 65 63 00 60 00 60 30 31 31 37 35 20 20 20 20 20>
<Buffer 16 73 00 55 70 67 72 61 64 00 60 00 60 30 31 31 37 35 20 20 20 20>
<Buffer 1d 73 00 53 65 63 2d 57 65 00 60 00 60 30 31 31 37 35 20 20 20 20 20 20 20 20 20 20 20>
<Buffer 04 73 00 0a>
<Buffer 1f 73 00 57 65 62 53 6f 63 00 60 00 60 30 31 31 37 35 20 20 20 20 20 20 20 20 20 20 20 20 20>
<Buffer 1c 73 00 57 65 62 53 6f 63 00 60 00 60 30 31 31 37 35 20 20 20 20 20 20 20 20 20 20>
PM2312L06601175
0.2.26
<Buffer 04 09 03 01>
<Buffer 04 10 04 01>
<Buffer 04 0f 05 00>
<Buffer 04 10 06 01>
<Buffer 04 0f 07 00>
<Buffer 04 10 08 01>
<Buffer 04 0f 09 00>
<Buffer 04 10 0a 01>
<Buffer 04 0f 0b 00>
<Buffer 04 10 0c 01>
<Buffer 04 0f 0d 00>
<Buffer 04 10 0e 01>
<Buffer 04 0f 0f 00>
<Buffer 04 10 10 01>
<Buffer 04 0f 11 00>
<Buffer 04 10 12 01>
<Buffer 04 0f 13 00>
<Buffer 04 10 14 01>
<Buffer 04 0f 15 00>
<Buffer 04 10 16 01>
<Buffer 04 0f 17 00>
<Buffer 04 10 18 01>
<Buffer 04 0f 19 00>
<Buffer 04 10 1a 01>
<Buffer 04 0f 1b 00>
<Buffer 04 10 1c 01>
<Buffer 04 0f 1d 00>
<Buffer 04 10 1e 01>
<Buffer 04 0f 1f 00>
<Buffer 04 10 20 01>
<Buffer 04 0f 21 00>
snsuJH commented 5 months ago

It seems to be a firmware related problem. If I downgrade to 0.2.23 (press and hold Button0 and Button14 on startup until the display blinks), everything works fine. Unfortunately I have to reset the device on every startup because it switches back to 0.2.26 automatically. At least it's a workaround.

foxxyz commented 5 months ago

Oh, that's interesting. So far I haven't been able to test 0.2.26 yet, so more of your observations would be valuable to figure out what's different.

With the console.log you have set above, could you comment out lines 20-22 in the simple example (just to prevent irrelevant output and/or commands that may lock comms) and paste any output you get on key presses?

snsuJH commented 5 months ago

Still the only output is from initialization. No output on keys.

node ./loupedeck/examples/simple/index.mjs 
✅ Connected to Razer Stream Controller X at /dev/ttyACM1
<Buffer 13 73 00 47 45 54 20 2f 69 00 00 00 00 00 00 00 00 00 00>
<Buffer 0c 73 00 48 54 54 50 2f 31 00 00 00>
<Buffer 17 73 00 43 6f 6e 6e 65 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
<Buffer 16 73 00 55 70 67 72 61 64 00 00 00 00 00 00 00 00 00 00 00 00 00>
<Buffer 1d 73 00 53 65 63 2d 57 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
<Buffer 04 73 00 0a>
<Buffer 1f 73 00 57 65 62 53 6f 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
<Buffer 1c 73 00 57 65 62 53 6f 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
PM2312L06601175
0.2.26
Device serial number PM2312L06601175, software version 0.2.26
foxxyz commented 5 months ago

Hm, strange. Thanks anyway for trying - I guess I will need to get my hands on a 0.2.26 firmware device to test for myself.

I'll keep this open until then - let me know if you find out anything else.

Julusian commented 5 months ago

The loupedeck software was able to update the firmware on my device from 0.2.23 to 0.2.26 making this easy to reproduce.

I am struggling to figure out what has changed here, it appears to simply not sending presses back to nodejs making it look like some setup is missing perhaps?

interestingly, without any changes this appears to be working on windows (tested using webserial, and node), and working in node on macos, but not on linux with either node or webserial. what os are you trying this on?

snsuJH commented 5 months ago

I'm on ubuntu 20.04.