Skip to content

Commit b18901f

Browse files
author
brentru
committed
update readme
1 parent 530aca0 commit b18901f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

README.rst

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Introduction
1515

1616
Pure-Python interface for WIZNET 5k ethernet modules.
1717

18-
NOTE: This library does not currently contain a DNS client. You will need to include a server ip address and destination port in your code.
19-
2018
Dependencies
2119
=============
2220
This driver depends on:
@@ -67,24 +65,21 @@ wifitest.adafruit.com.
6765
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET
6866
import adafruit_wiznet5k.adafruit_wiznet5k_socket as socket
6967
70-
# Name address for wifitest.adafruit.com
71-
SERVER_ADDRESS = (('104.236.193.178'), 80)
72-
7368
cs = digitalio.DigitalInOut(board.D10)
7469
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
7570
7671
# Initialize ethernet interface with DHCP
77-
eth = WIZNET(spi_bus, cs)
72+
eth = WIZNET5K(spi_bus, cs, debug=True)
7873
7974
print("DHCP Assigned IP: ", eth.pretty_ip(eth.ip_address))
8075
8176
socket.set_interface(eth)
8277
83-
# Create a new socket
84-
sock = socket.socket()
78+
host = 'wifitest.adafruit.com'
79+
port = 80
8580
86-
print("Connecting to: ", SERVER_ADDRESS[0])
87-
sock.connect(SERVER_ADDRESS)
81+
addr_info = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)
82+
sock = socket.socket(addr_info[0], addr_info[1], addr_info[2])
8883
8984
print("Connected to ", sock.getpeername())
9085

0 commit comments

Comments
 (0)