Skip to content

Commit c43147a

Browse files
authored
Merge pull request #106 from dhalbert/update-ether-example
Update Ethernet library usage
2 parents ca65b59 + d9fb1e5 commit c43147a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

docs/starting_methods.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ it may not be able to access the internet.
2828
Manual Ethernet
2929
---------------
3030

31-
Most of the time, the WiFi will be a preferred way of connecting to the network.
32-
Nevertheless it is also possible to use Ethernet instead of WiFi.
33-
The only difference in usage is related to configuring the ``socket_source`` differently.
31+
Ethernet can also be used to connect to the location network.
3432

3533
.. literalinclude:: ../examples/httpserver_simpletest_manual_ethernet.py
3634
:caption: examples/httpserver_simpletest_manual_ethernet.py
37-
:emphasize-lines: 7,10,12-24,37
35+
:emphasize-lines: 11-20
3836
:linenos:
3937

4038
Automatic WiFi using ``settings.toml``

examples/httpserver_simpletest_manual_ethernet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5+
import adafruit_connection_manager
56
import board
67
import digitalio
7-
from adafruit_wiznet5k import adafruit_wiznet5k_socket as socket
88
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
99

1010
from adafruit_httpserver import Request, Response, Server
@@ -20,10 +20,9 @@
2020
# Initialize ethernet interface with DHCP
2121
eth = WIZNET5K(spi_bus, cs)
2222

23-
# Set the interface on the socket source
24-
socket.set_interface(eth)
23+
pool = adafruit_connection_manager.get_radio_socketpool(eth)
2524

26-
server = Server(socket, "/static", debug=True)
25+
server = Server(pool, "/static", debug=True)
2726

2827

2928
@server.route("/")

0 commit comments

Comments
 (0)