How to run Microdot webframework
Posted: Tue Sep 14, 2021 8:13 pm
Dear forum,
I'm more or less new to Python and especially to MicroPython.
My aim is to have a small webserver running on an ESP8266 connected to my local network, so I can access it any time from my smart phone. At the end of the day some live sensor readings should be shown on the webpage and I would like to control some GPIOs by means of "Push the Button".
I started the project using an old Raspberry Pi which runs a Flask webserver. For now all basic functionalities are implemented, I guess. And they work. Due to it's low prize I would love to do the same with the ESP8266.
There are some few examples on how to use Microdot, but I actually found no information about how to RUN it. According to a Git question how to install it https://github.com/miguelgrinberg/microdot/issues/13 I just copied the file microdot.py to my device. Now I have boot.py, main.py and microdot.py.
After running the boot.py script in Thonny I can see the device actively registered in my routers device list. But when I run the main.py, which only contains the code from this Microdot example https://github.com/miguelgrinberg/micro ... s/hello.py it throws an error "cannot import name Microdot"
I highly appreciate any help on this, how to execute the code and get this little example running.
Many thanks and best regards
Nico
I'm more or less new to Python and especially to MicroPython.
My aim is to have a small webserver running on an ESP8266 connected to my local network, so I can access it any time from my smart phone. At the end of the day some live sensor readings should be shown on the webpage and I would like to control some GPIOs by means of "Push the Button".
I started the project using an old Raspberry Pi which runs a Flask webserver. For now all basic functionalities are implemented, I guess. And they work. Due to it's low prize I would love to do the same with the ESP8266.
There are some few examples on how to use Microdot, but I actually found no information about how to RUN it. According to a Git question how to install it https://github.com/miguelgrinberg/microdot/issues/13 I just copied the file microdot.py to my device. Now I have boot.py, main.py and microdot.py.
After running the boot.py script in Thonny I can see the device actively registered in my routers device list. But when I run the main.py, which only contains the code from this Microdot example https://github.com/miguelgrinberg/micro ... s/hello.py it throws an error "cannot import name Microdot"
I highly appreciate any help on this, how to execute the code and get this little example running.
Many thanks and best regards
Nico