One of the biggest problems we've encountered in introducing the LEGO ev3 robotic kit into the classroom was the availability of laptops and software. This project intends to eliminate this barrier so that any classrooms with available networks could conduct activities using the ev3 kit.
This project adapts the concept of Internet of Things, that any hardware, which is connected to a network, could communicate with web browsers and achieve real-time control and data acquisition. To achieve this goal, we are running a linux OS on the ev3 brick,which enables us to have direct access to the hardware and write programs for network communications.
This project tries to introduce another approach to program the ev3. In a traditional approach, we load a pre-defined functionality to the ev3, and the ev3 will perform whatever instructions it received. But in our new approach, the action of ev3 will be determined by the real-time communication with the outside world. By setting up some communication protocols and data synchronizations, we could even make the ev3s talk to each other and create a real-time communication network among them.
And more importantly, this approach will only require an available network (even a local network), our server programs will run automatically when the system boot up and it could be operated on any devices (laptop, iPad, smartphone) as long as it has a fully functional web browser.
The picture below shows the basic package of the system. The Raspberry Pi is connected to a router, where the router is used to create a local network for this system to communicate with each other.
The web server will automatically start after the Pi boots up with a static IP address. The picture below shows the default web interface after the browser downloaded the source from the web server.
Next step is to get the ev3 register itself to the web server, this is done by running a program on the ev3. Currently, this program is set to be a python executable, therefore you can just run it from the ev3 (no SSH required). After the ev3 registered itself to the web server, the web server will put the information into a database with its current status (idle or busy).
Every time the web interface get refreshed or the update button is pressed, a request will be sent to the web server to retrieve the current status of the ev3s in the database. For example, the picture above shows there are two ev3s available for connection.To connect with one ev3, just click the corresponding IP address.
After you click the IP address, the browser will send a request to the web server to see if this ev3 is available, if it is, then another request will be directly sent to that ev3. If all these operations are successful, the background color of that IP address will become green. To disconnect, just press the 'Disconnect' button, then the browser will send request to the ev3 and then the web server to clear the binding.
When you try to retrieve the ev3 information, if any of these ev3s are busy, the background of their IP will be red and there will be an error message when you click it. There are also additional error-handling functions that will make sure the system running robustly.
This video is a demo to show how to connect the ev3 and do simple tasks, like moving the motors.
This demo shows how you can control a motor with a touch sensor.