New and exciting project: EV3 web interface! (aka CoNXTroll3r)
Basing my work off of my previous work with nxt-python (unreleased), I've done the following:
- Downloaded and installed the cherrypy python library (Google it, the forum only allows me 3 links per post)
- Written a wrapper for the python library of the EV3 api. You initialize it with some basic measurements, and then you can say "spin left 90 degrees", or "move forward 30 centimeters". It doesn't have to be centimeters, just whatever unit you measured in.
- Run a webcam streaming server on my laptop to do a live feed of the robot as it moves
- Written a basic webpage with some buttons that cause the EV3 to move
Put all together, you get https://github.com/G33kDude/CoNXTroll3r
Here's an image of the website it runs. The webcam feed goes where it says "offline". I didn't bother putting the feed up for the sake of this picture.
An exciting application of this is that you can then control it over HTTP via a simple API. I've used Snap!
to control the EV3 with its graphical programming language.
As for getting the EV3 onto the web without a WiFi adapter (I'm using the ethernet over USB feature of LeJOS firmware), I've done a simple bit of SSH port forwarding. I SSH into it with the PuTTY options to allow requests from other hosts, source port 8080, and destination 127.0.0.1:80. Make sure it is set to "Local", and "Auto". This will make all web requests to your computer on port 8080 go to the EV3 on port 80.
Please don't criticize my html/js/css too badly, I reused my nxt-python webpage, which was the first time I've endeavoured to write a real webpage.
Please do criticize my python code and tell me if I've done something odd, poorly, or just flat out incorrectly.
- Get webcam to interface with EV3 (not sure about the feasibility of this, especially when taking power draw into account)
- Get a dedicated setup to run this
- Get a (micro) WiFi adapter that works with the EV3 so I can stop jerry rigging the port forwarding