The WEB server
When writing a WEB server for your sensors and actuators you have 3 possible options:
When writing a simplistic WEB Server, serving only static HTML pages then you may well write it yourself, making use of the uscocket library in MicroPython. If you want to use more complex pages e.g. using templates or you need dynamic pages e.g. to display incoming data from your sensors, then it may be easier to rely on work other people have prepared for you. On MicroPython two options are available:
- picoweb: a very small WEB server sufficient for our purposes. Picoweb comes with many example programs demonstrating all the features of the WEB server. These examples are extremely useful when trying to implement your own code. You should have a close look at them and try them one by one. Only small modifications are needed to run them on our system.
- microdot is very similar to picoweb, but offers documentation in addition.
Both frameworks are already included in your MicroPython interpreter.
--
Uli Raich - 2020-06-08
Comments