Skip to content

Commit

Permalink
Remove wsgiserver
Browse files Browse the repository at this point in the history
  • Loading branch information
justmobilize committed Apr 25, 2024
1 parent f78907e commit f1f9a55
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 446 deletions.
64 changes: 0 additions & 64 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,70 +108,6 @@ wifitest.adafruit.com.
print("Done!")
This example demonstrates a simple web server that allows setting the Neopixel color.

.. code-block:: python
import board
import busio
import digitalio
import neopixel
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
import adafruit_wiznet5k.adafruit_wiznet5k_wsgiserver as server
from adafruit_wsgi.wsgi_app import WSGIApp
print("Wiznet5k Web Server Test")
# Status LED
led = neopixel.NeoPixel(board.NEOPIXEL, 1)
led.brightness = 0.3
led[0] = (0, 0, 255)
# W5500 connections
cs = digitalio.DigitalInOut(board.D10)
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
# Initialize Ethernet interface with DHCP
eth = WIZNET5K(spi_bus, cs)
# Here we create our application, registering the
# following functions to be called on specific HTTP GET requests routes
web_app = WSGIApp()
@web_app.route("/led/<r>/<g>/<b>")
def led_on(request, r, g, b):
print("LED handler")
led.fill((int(r), int(g), int(b)))
return ("200 OK", [], ["LED set!"])
@web_app.route("/")
def root(request):
print("Root handler")
return ("200 OK", [], ["Root document"])
@web_app.route("/large")
def large(request):
print("Large pattern handler")
return ("200 OK", [], ["*-.-" * 2000])
# Here we setup our server, passing in our web_app as the application
server.set_interface(eth)
wsgiServer = server.WSGIServer(80, application=web_app)
print("Open this IP in your browser: ", eth.pretty_ip(eth.ip_address))
# Start the server
wsgiServer.start()
while True:
# Our main loop where we have the server poll for incoming requests
wsgiServer.update_poll()
# Maintain DHCP lease
eth.maintain_dhcp_lease()
# Could do any other background tasks here, like reading sensors
Documentation
=============

Expand Down
240 changes: 0 additions & 240 deletions adafruit_wiznet5k/adafruit_wiznet5k_wsgiserver.py

This file was deleted.

2 changes: 0 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@
.. automodule:: adafruit_wiznet5k.adafruit_wiznet5k_dns
:members:

.. automodule:: adafruit_wiznet5k.adafruit_wiznet5k_wsgiserver
:members:
Loading

0 comments on commit f1f9a55

Please sign in to comment.