lego-hub-tk icon indicating copy to clipboard operation
lego-hub-tk copied to clipboard

Establishing an upstream link between HUB and PC

Open Nurech opened this issue 3 years ago • 1 comments

Hello.

I am having trouble establishing an link for upstream/downstream data link. Could you please elaborate, perhaps with some examples, how to establish a 2-way data link between HUB <-> PC or is that something that is not possible with this tool?

The only option that I see, is possibility of activating different slots, but we can not call a function with variables passed down within a program, on a slot - am I correct?

Nurech avatar Jan 22 '22 14:01 Nurech

The example program "hubcontrol.py" demonstrates a bidirectional link -- in that you can send commands to start/stop a program on the hub and receive telemetry data (e.g. position variables).

But I think you are asking for something more. Are you asking how to send data to your program running on the hub? I don't know the answer to that question. You can see in HubClient.py and run_command.py a short list of commands that I learned from https://github.com/nutki/spike-tools. None of these will send data to a running program. But clearly it ought to be possible -- as the Mindstorms IDE has programs that run in "remote control" mode.

smr99 avatar Jan 23 '22 21:01 smr99