Can anyone point me in the right direction? We want to run an http server on the EV3 using the EV3 version of micropython.

We've had some success. When ssh'ing into the EV3 we can run python -m SimpleHTTPServer and, python3 -m HTTPServer they both work fine. They print out serving http on blah blah etc. So clearly they exist on the EV3 in the micropython code.

However, if in the python code we try to import http.server it says import error, no module named http.server and for SimpleHTTPServer it says import error, no module named SimpleHTTPServer. (But if we try to import http in the python script it does not throw any errors).

By running the command python3 on the EV3 (via ssh) it will open up the python3 interactive console, and running import http.server it runs without any errors. If we run the command python then import SimpleHTTPServer it also runs without errors. So how do we get it to read from the actual python script? Any ideas how to do this?

We've read Lego's micropython documentation https://pybricks.com/ev3-micropython/ but don't see a direction to go in from the docs.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.