Skip to content
Discussion options

You must be logged in to vote

I don't really know any Python, but there seem to be several WebSocket implementations for it. If I pip install websockets this works on my machine

import json
from websockets.sync.client import connect

delta_message = {
    "updates": [
        {
            "values": [
                {
                    "path": "navigation.speedOverGround",
                    "value": 3.5
                }
            ]
        }
    ]
}

def sendOnce():
    with connect("ws://localhost:3001/signalk/v1/stream?subscribe=none") as websocket:
        websocket.send(json.dumps(delta_message))

sendOnce()

Context defaults to self and the server will fill in $source and timestamp.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tkurki
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants