Program and control physical LEGO MINDSTORMS EV3s remotely over the Internet.
This collection of tools allows one or multiple users to connect the usual LEGO MINDSTORMS LabView programming environment to one or multiple EV3s via the Internet.
In other words: EV3s in another part of the world can be programmed and controlled as if they were right next to you. And not only by you, but by different users, thus also suitable for situations where there are more users than EV3s.
As of 2022 the world is still pretty much affected by the Covid pandemic, so presence lectures for students are not the best option. The only alternative for EV3 programming courses: simulators. But just staring at a simulator next to your programming environment is quite boring and does not offer the same learning experience as a physical robot.
The ev3-connect software has a better solution:
The EV3s are stationed at the lecturer's home (with a camera pointed to them). With ev3-connect, the students can use the LEGO MINDSTORMS LabView software to program one of the EV3s as usual and see the video stream of their robot. Ev3-connect ensures a rotation of programming access, so multiple students can work with one EV3.
The ev3-connect setup consists of three softwares:
- a controller client, run on the computer with the LEGO MINDSTORMS programming environment
- a server, which routes the commands from the controller client to
- an EV3 client, run on the computer that is connected to the EV3 via Bluetooth and passes the commands to the EV3 (and vice-versa)
The best: ev3-connect just passes the commands from the programming environment to the EV3 and vice-versa, thus supporting all features of a direct connection of environment and EV3.
See Technical Details for an in-depth explanation.
ToDo
- A Linux (tested) or Windows (currently not tested) PC with Bluetooth capabilities
- A stable internet connection
- Recommended: A webcam to transmit the video stream (the transmission part is not part of this software)
- At least one EV3
- A Windows Machine (Virtual Maschine should work)
- A stable internet connection
ToDo
- Download the
ev3
(Linux) orev3.exe
(Windows) binary and theev3.config.toml.example
file from the latest release - On Windows: You may have to convince Windows defender / Microsoft Edge that the file is not malicious :)
- Rename
ev3.config.toml.example
toconfig.toml
(you might need to enable filename extensions in the Windows Explorer) - Open
config.toml
and edit the details to match your (server) setup - Start your EV3 and enable Bluetooth on it
- On first connection only: Pair to the EV3 using your system's bluetooth management software (probably somewhere in the setting)
- Start the
ev3
/ev3.exe
binary (Windows Defender may warn you about the software being malicious - just execute anyways) - Your EV3 should now connect to the server and wait for a controller to connect
- Download the
controller.exe
binary and thecontroller.config.toml.example
file from the latest release - On Windows: You may have to convince Windows defender / Microsoft Edge that the file is not malicious :)
- Rename
controller.config.toml.example
toconfig.toml
(you might need to enable filename extensions in the windows explorer) - Open
config.toml
and edit the details to match your (server) setup. - Start the
controller.exe
and LEGO MINDSTORMS LabView (a specific order should not be necessary. Windows Defender may warn you about the software being malicious - just execute anyways) - If an EV3 is connected to the server, it should be listed in LabView's connection panel
- Connect to the EV3 as usual and start programming
- The controller client creates an encrypted WebSocket connection (
wss://
) to the server (specified insidecargo.toml
) - The controller client requests a specific EV3 (specified inside
cargo.toml
) - If the requested EV3 is not available: You receive control over an other EV3 or you are placed inside a queue for when the currently controlling person disconnects
- If the requested EV3 is available: You receive control over the EV3 and LEGO LabView will show the available EV3 inside the bottom right connection panel
- Connect to the EV3 inside LabView
- Every feature of LEGO LabView should work as expected (e.g.
Upload & Run
, Overview over connected sensors, ...)
- The EV3 client creates a connection to the specified EV3 (specified inside
config.toml
) via Bluetooth - The EV3 Client creates an encrypted WebSocket connection (
wss://
) to the server (specified insideconfig.toml
) - Every command received from the websocket connection will be relayed to the EV3 and every response (if there is one) will be relayed back to the websocket connection
- Download the repository via command-line git or the green button in the top right
- Make your changes
- use cargo build to compile your changes (debug build)
- use cargo run to build and run your changes (debug build; Caution: You need to put your
config.toml
inside the build output directory, otherwise you might not be able to connect to your expected services)
Try to connect first via your OS Bluetooth functionality (to finish the handshake). After that try again to connect. Also remember to put your bluetooth serial-number into the config.toml
file.
Linux users: Sometimes your Bluetooth interface might be blocked by rfkill
. Use rfkill list
to check that. If your bluetooth is softblocked use rfkill unblock bluetooth
to reenable the interface. (You need to be sudo
to do that)
Place your changed config.toml
in the same directory as the executable and change your current working directory to that directory too. Also make sure that you saved your changes.
Thanks to
- https://ev3directcommands.blogspot.com/ for providing an insight into the inner workings of the EV3 protocol
- http://www.monobrick.dk/guides/how-to-establish-a-wifi-connection-with-the-ev3-brick/ for providing the documentation on how to connect to the EV3 via WiFi (page is transmitted via http)
- SilvanVerhoeven for listening to me while i was solving stupid bugs and developing the server :)
- Lego Education for providing the source code / reference material for the EV3