SteelSeries / gamesense-sdk

472 stars 146 forks source link

Can't write to oled screen on Arctis Wireless box. #54

Open snigel opened 5 years ago

snigel commented 5 years ago

Not sure what I'm doing wrong, trying to write text to the oled display on the Arctis wireless box.

Been fiddling around with writing context-handlers, prefix, suffix, icons and data handlers, but I just can't get anything to show up. Ideally I'd like to write custom text and/or graphics.

The application registers with SSE and all posts returns http 200.

When I try to configure the application within SSE, I can see the Arctis Wireless box displayed and a "add event"-button. Clicking that button crashes SSE.

Below is my test code. (I'm running python in the Linux subsystem if the path looks odd). I'm expecting it to write "38" to the screen, but it doesn't.

import json
import requests

game = "TEST_APPLICATION"
display_name="TEST_DISPLAY_NAME"
event = "DISPLAY"

corePropsPath = "/mnt/c/ProgramData/SteelSeries/SteelSeries Engine 3/coreProps.json"
sseAddress = json.load(open(corePropsPath))["address"]

def register_game():
    print "Registering game:"
    game_metadata = {
        "game": game,
        "game_display_name": display_name,
        "icon_color_id": 6
    }
    r = requests.post("http://"+sseAddress+"/game_metadata", json=game_metadata)
    print json.dumps(json.loads(r.text), indent=4)

def bind_event():
    print "Binding event:"
    screen_handler = {
        "game": game,
        "event": event,
        "icon_id": 16,
        "handlers": [
            {
               "device-type": "screened",
               "mode": "screen",
               "zone": "one",
               "datas": [
                   {
                       "has-text": "true",
                       "length-millis": 2000
                   }
               ]
            }
        ]
    }

    r = requests.post("http://"+sseAddress+"/bind_game_event", json=screen_handler)
    print json.dumps(json.loads(r.text), indent=4)

def send_event():
    print "Sending event:"
    event_data = {
        "game": game,
        "event": event,
        "data": { "value": 38 }
    }

    r = requests.post("http://"+sseAddress+"/game_event", json=event_data)
    print json.dumps(json.loads(r.text), indent=4)

register_game()
bind_event()
send_event()
fotex commented 5 years ago

Hey, try to change "has-text": "true" to "has-text": true It`s working on Rival 710.

snigel commented 5 years ago

Thank you! It works now. My bad for sending the wrong data type. Shouldn't report HTTP 200 for incorrect input though.