This simple web server for ev3dev enables the user to:
- Monitor sensor values and motor positions
- Control motors by sending commands
- Change sensor modes
- Steer the robot using a joystick-like interface
This project consists of two components:
- The actual web server, a Python script which sends values to clients and receives commands through WebSockets.
- A website which receives values through JavaScript and sends values to the server.
- Copy this repository to your ev3dev device, e.g. by cloning.
- Install
tornado
:
$ sudo apt install python3-tornado
- Run
python3 server.py
. - In a browser, open
<ev3dev ip>:8000
.
Access to the website can optionally be protected by a username and password, using HTTP Basic Authentication.
To enable password protection, follow these steps:
- Install
htpasswd
, which is included inapache2-utils
:
$ sudo apt install apache2-utils
cd
into theev3dev-web-server
directory, then create a.htpasswd
file (replace<username>
by a username of your choice):
$ htpasswd -c .htpasswd <username>
- Users are now asked to authenticate before they can access the website.
Note that you should change the password of the robot
user. Otherwise, anyone can log in via ssh using the default password (maker
) and delete or change the .htpasswd
file.
The password can be changed via sudo ev3dev-config
.
This project is licensed under the terms of the MIT license, see LICENSE.
This project uses Bootstrap v4.5.2, see website/bootstrap.min.css.