@@ -15,6 +15,14 @@ It also manually connects to the WiFi network.
15
15
:emphasize-lines: 12-17
16
16
:linenos:
17
17
18
+ It is also possible to use Ethernet instead of WiFi.
19
+ The only difference in usage is related to configuring the ``socket_source `` differently.
20
+
21
+ .. literalinclude :: ../examples/httpserver_ethernet_simpletest.py
22
+ :caption: examples/httpserver_ethernet_simpletest.py
23
+ :emphasize-lines: 13-23
24
+ :linenos:
25
+
18
26
Although there is nothing wrong with this approach, from the version 8.0.0 of CircuitPython,
19
27
`it is possible to use the environment variables <https://docs.circuitpython.org/en/latest/docs/environment.html#circuitpython-behavior >`_
20
28
defined in ``settings.toml `` file to store secrets and configure the WiFi network.
@@ -32,6 +40,7 @@ Note that we still need to import ``socketpool`` and ``wifi`` modules.
32
40
33
41
.. literalinclude :: ../examples/httpserver_simpletest_auto.py
34
42
:caption: examples/httpserver_simpletest_auto.py
43
+ :emphasize-lines: 11
35
44
:linenos:
36
45
37
46
Serving static files
@@ -76,7 +85,7 @@ a running total of the last 10 samples.
76
85
77
86
.. literalinclude :: ../examples/httpserver_start_and_poll.py
78
87
:caption: examples/httpserver_start_and_poll.py
79
- :emphasize-lines: 24,33
88
+ :emphasize-lines: 29,38
80
89
:linenos:
81
90
82
91
Server with MDNS
@@ -145,7 +154,7 @@ Tested on ESP32-S2 Feather.
145
154
146
155
.. literalinclude :: ../examples/httpserver_neopixel.py
147
156
:caption: examples/httpserver_neopixel.py
148
- :emphasize-lines: 25-27,39,51,60,66
157
+ :emphasize-lines: 26-28,41,52,68,74
149
158
:linenos:
150
159
151
160
Form data parsing
@@ -293,7 +302,7 @@ This might change in the future, but for now, it is recommended to use Websocket
293
302
294
303
.. literalinclude :: ../examples/httpserver_websocket.py
295
304
:caption: examples/httpserver_websocket.py
296
- :emphasize-lines: 10 ,16-17,60-67,76,81
305
+ :emphasize-lines: 9 ,16-17,60-67,76,81
297
306
:linenos:
298
307
299
308
Multiple servers
0 commit comments