SteelSeries / gamesense-sdk

472 stars 146 forks source link

Keyboard Oled not responding to successfully sent bitmaps #119

Closed spoopr closed 2 years ago

spoopr commented 2 years ago

I've been playing around with the SteelSeries SDK, and I've been having trouble getting OLED bitmaps to actually work, let me explain. I've been sending events like this;

{'game': 'REACTIVE_KEYBOARD_WIDGET', 'event': 'KEY_UPDATE', 'data': {'frame': {'image-data-128x40': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 254, 64, 16, 196, 242, 254, 64, 16, 196, 242, 254, 64, 0, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 232, 250,
 256, 128, 130, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 232, 250, 256, 128, 130, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160,
 232, 250, 256, 128, 130, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 232, 250, 256, 128, 130, 0, 0, 2, 256, 128, 160, 232, 250, 256,
 128, 160, 232, 250, 256, 128, 130, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 232, 250, 256, 128, 130, 0, 0, 0, 254, 64, 16, 196,
 242, 254, 64, 16, 196, 242, 254, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 196,
 242, 254, 64, 16, 196, 242, 254, 64, 16, 194, 0, 0, 0, 0, 32, 232, 250, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 32, 232,
 250, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 32, 232, 250, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 32,
 232, 250, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 32, 232, 250, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0,
 32, 232, 250, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 16, 196, 242, 254, 64, 16, 196, 242, 254, 64, 16, 194, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 64, 16, 196, 242, 254, 64, 16, 194, 0, 0, 0, 0, 0, 0,
 2, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 0, 0, 2, 256,
 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 0, 0, 2, 256, 128, 160,
 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 0, 0, 2, 256, 128, 160, 232, 250, 256, 128, 160, 226, 0, 0, 0, 0, 0, 0, 0, 254, 64, 16, 196, 242,
 254, 64, 16, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 256, 256, 256,
 256, 256, 256, 256, 256, 0, 0, 0, 0, 0, 0, 0, 32, 256, 256, 256, 256, 256, 256, 256, 256, 130, 0, 0, 0, 0, 0, 0, 32, 256, 256, 256, 256, 256,
 256, 256, 256, 130, 0, 0, 0, 0, 0, 0, 32, 256, 256, 256, 256, 256, 256, 256, 256, 130, 0, 0, 0, 0, 0, 0, 32, 256, 256, 256, 256, 256, 256,
 256, 256, 130, 0, 0, 0, 0, 0, 0, 32, 256, 256, 256, 256, 256, 256, 256, 256, 130, 0, 0, 0, 0, 0, 0, 16, 256, 256, 256, 256, 256, 256, 256,
 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}}}

with game event handlers like this;

{'game': 'REACTIVE_KEYBOARD_WIDGET', 'event': 'KEY_UPDATE', 'handlers': [{'datas': [{'has-text': False, 'frame': {'image-data-128x40': []}}], 'device-type': 'screened-128x40', 'mode': 'screen', 'zone': 'one'}]}

With these, I get 200 response codes, but no reaction from the OLED I've been sending this to, my apex 7, just black. Any help would be appreciated, thank you!

JHunz commented 2 years ago

I don't see the value_optional flag set on your event handler binding, which is needed if you want to send data that's purely part of the context frame and doesn't have a "value" property. It's mentioned right before the example JSON in the documentation section about dynamic image data: https://github.com/SteelSeries/gamesense-sdk/blob/master/doc/api/json-handlers-screen.md#sending-dynamic-images-in-event-data.

Can you try adding that and let me know if it still doesn't work?

spoopr commented 2 years ago

Thanks for the response

I added the value_optional flag right before the has-text flag, but I still get the same reaction :/

JHunz commented 2 years ago

Sorry, looking back I was unclear. The value_optional property is a property of the event, not the handler, so it goes at the same level as 'game', 'event', and 'handlers'

spoopr commented 2 years ago

Alright, now with the value_optional flag at the same level as game and event, and after handlers, I still get nothing, anything else that could be wrong?

spoopr commented 2 years ago

Oh and, is there any way to clear custom gamesense apps and settings? I messed around with them once and I want to see if that changes anything.

spoopr commented 2 years ago

Aight, it's been a while.

I've been working on the problems I've had every now and then for a while, and here are some things I've found to work for me. Handlers;

{"game": "REACTIVE_KEYBOARD_EVENT",
                    "event": "KEY_UPDATE",
                    "handlers": [{
                        "datas": [{
                            "has-text": False,
                            "image-data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}],
                        "device-type": "screened-128x40",
                        "mode": "screen",
                        "zone": "one"}]}

Event;

{"game": "REACTIVE_KEYBOARD_WIDGET",
                    "event": "KEY_UPDATE",
                    "data": {
                             "value": /*Put a changing interger here*/,
                             "frame": {
                                 "image-data-128x40": /*Your array and or hopes and dreams here*/
                             }}}

I'll list the changes/things I've realized while fixing the events and handlers above;

I'm going to leave this here for others who might be having trouble with this too. Also, I'd just like to give credit where credit is due, JHunz for helping me, if only a little, and wolfinabox, for leaving me a bread crumb trail of clues to fixing my problems.