---
title: "CIrcuitpython with W55RP20"
url: "https://maker.wiznet.io/forum/15290"
markdown_url: "https://maker.wiznet.io/forum/15290/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "awoodbridge"
created: "2024-10-03T01:40:02+09:00"
last_activity: "2024-10-17T13:02:03+09:00"
language: "en"
tags: ["CircuitPython"]
views: 12
replies: 4
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# CIrcuitpython with W55RP20

## Question

Asked by awoodbridge on 2024-10-03 in Ethernet Chips.

I'm attempting to use the existing 5500 library for circuitpython, but I'm getting an Invalid Pin error when I try to setup the SPI. If it's an easy fix, I can move forward.

The error is being thrown spi_bus declaration line.

This is the example code:

```plaintext
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import board
import busio
import digitalio
import adafruit_connection_manager
import adafruit_requests
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K

print("Wiznet5k WebClient Test")

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_URL = "http://api.coindesk.com/v1/bpi/currentprice/USD.json"

cs = digitalio.DigitalInOut(board.GP20)
spi_bus = busio.SPI(clock=board.GP21, MOSI=board.GP23, MISO=board.GP22)

# Initialize ethernet interface with DHCP
eth = WIZNET5K(spi_bus, cs)

# Initialize a requests session
pool = adafruit_connection_manager.get_radio_socketpool(eth)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(eth)
requests = adafruit_requests.Session(pool, ssl_context)

print("Chip Version:", eth.chip)
print("MAC Address:", [hex(i) for i in eth.mac_address])
print("My IP address is:", eth.pretty_ip(eth.ip_address))
print(
    "IP lookup adafruit.com: %s" % eth.pretty_ip(eth.get_host_by_name("adafruit.com"))
)


# eth._debug = True
print("Fetching text from", TEXT_URL)
r = requests.get(TEXT_URL)
print("-" * 40)
print(r.text)
print("-" * 40)
r.close()

print()
print("Fetching json from", JSON_URL)
r = requests.get(JSON_URL)
print("-" * 40)
print(r.json())
print("-" * 40)
r.close()

print("Done!")
```

## Replies

### Reply 1 by awoodbridge, 2024-10-03

I have verified the AI suggestions and it didn't fix the issue.

### Reply 2 by Alan, 2024-10-07 (in reply to reply 1)

CircuitPython is currently under development and is scheduled to be shared in two weeks.

### Reply 3 by viktor, 2024-10-07

Hello, thanks for contacting us.

The CircuitPython support is now being developed. The basic examples won't work as the RP2040 and W5500 are connected not via SPI pins of RP2040, but via general GPIO. You would need to make a PIO program to convert GPIO pins to serve as SPI.

### Reply 4 by WIZnet, 2024-10-17

I wanted to let you know that we now have an updated link for the Circuit Python firmware, which might address the issue you're encountering. The link will be continuously updated to ensure the latest support.

<https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-Circuitpython>

Feel free to check it out, and let us know if you have any questions!

---

Source: https://maker.wiznet.io/forum/15290
