Skip to content

Websocket from vscode vex extention #32

Description

@Voidless7125

The websocket server allows you open a websocket connection to the User Port when a brain or controller is detected and selected by the VEX Extension. You could use it to stream data from your robot to a webpage. Any data you send to the interactive terminal, using printf() for example, gets forwarded to the websocket. But you must have a usb connection between either a brain or controller and your computer.

The data flow through the VEX Extension look like this.
(VEX User Port) Serial Port Connection → Websocket Server → Websocket Client

I don’t modify the data in any way, so what you send to the user port is what the Websocket will receive.

In ts you could do the following to create a websocket connection:

// CONFIG
const PORT = '7071';
const IP = 'localhost';
const deviceUrl = `ws://${IP}:${PORT}/vexrobotics.vexcode/device
let webSocket = new WebSocket(deviceUrl);

websocket should be written in python. The data should be read from the function of the motor checks, temps, etc. But I will want more info, rpm, etc. This should also be saved onto a file if needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions