Skip to content

A tool to help visualize the state of hardware sockets on WIZnet5k chipsets.

License

Notifications You must be signed in to change notification settings

fasteddy516/CircuitPython_Wiznet5k_Socket_Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircuitPython WIZnet5k Socket Visualizer

A tool to help visualize the state of hardware sockets on WIZnet5k chipsets in CircuitPython using Adafruit's WIZnet5k driver.

Written by Edward Wright (fasteddy516).

Available at https://github.com/fasteddy516/CircuitPython_Wiznet5k_Socket_Visualizer

Description

Socket Visualizer is a CircuitPython script that was created to help test the WIZnet5k driver provided by Adafruit. It creates a simple server that listens for TCP connections and displays a table in the serial console containing hardware socket status information ('reservation' state, status and connected client) as connections are made and broken. When clients connect, the server sends a string indicating which hardware socket the client is connected to. While the client is connected, the server sends out 'heartbeat' strings every 2 seconds.

Below is an example of the Socket Visualizer's output:

An example of Socket Visualizer's output

Dependencies

You will need the following CircuitPython drivers to run this script:

  • Adafruit_CircuitPython_BusDevice

  • Adafruit_CircuitPython_Wiznet5k

    The easiest way to install these drivers on your CircuitPython device is using Adafruit's circup tool.

  • Colors and unicode characters are used in the console output, so be sure to use a terminal application that supports these features.

  • While these aren't exactly dependencies, it should be noted that this tool was developed and tested using CircuitPython 8.2.0 and Adafruit_CircuitPython_Wiznet5k driver version 3.0.0 on a Raspberry Pi Pico attached to a WIZnet Ethernet Hat with a w5100s chipset. Output was verified in the SimplySerial terminal application running in PowerShell on Windows 11.

    This tool accesses private variables/properties (socket._socknum, socket._status, and WIZNET5K._sockets_reserved) which are not part of the official driver API and may be changed in driver versions beyond 3.0.0 which would break this tool.

Using Socket Visualizer

  • Install the dependencies listed above on your CircuitPython device

  • Copy main.py from this repository to your CircuiytPython device.

    If there is already a code.py file on your device, you will need to delete or rename it to allow main.py to run.

  • Make sure the variables in the CONFIGURATION section (near the top of the script just after all the import statements) are set appropriately for your device/environment.

  • Connect to the CircuitPython serial console and restart the script.

  • Use a tool like PuTTy to connect to your CircuitPython device and watch the socket status update in the serial console.

About

A tool to help visualize the state of hardware sockets on WIZnet5k chipsets.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages