Wlan pin assignments for Plasma 2350 and RM2

OK, so I bought by mistake a Plasma 2350 without W. No problem, I though, I’ll get an RM2 and connect using the SP/CE cable, there’s sample code. Did that, tried to run the example. Thonny shows me an ‘invalid pin’ error in this line:
wlan = network.WLAN(network.STA_IF, pin_on=32, pin_out=35, pin_in=35, pin_wake=35, pin_clock=34, pin_cs=33)

, so now I wonder if the pin assignments in the example a right for the device. Any help?

RM2 Breakout example?
You will likely have to edit that line to match the pins used by the Plasma 2350’s SP/CE connector.

Right, makes sense, but the code wants 6 pin numbers, that list only has 5. Havcen’t found a clue yet for the pin number for pin_on, and the l;in number for pin_wake isn’t clear from the diagram.

This might help, I got it from here,
plasma2350_non_w.sch

@hel

thanks, I’ll continue experimenting!

What happens if you try one of these examples?
pimoroni-pico-rp2350/micropython/examples/plasma_2350_w at main · pimoroni/pimoroni-pico-rp2350

I have a Plasma 2350, but I don’t have the RM2 addon.

Try this :)

"""
Get a cat fact from t'internet!
You will need to add your wireless SSID and password to secrets.py (and save this file to your Plasma)
"""

import network
import requests
from secrets import WIFI_SSID, WIFI_PASSWORD
from time import sleep

# Specify the pins that that wireless module is connected to
# The pins below are for a Plasma 2350 with a RM2 breakout connected via SP/CE
wlan = network.WLAN(network.STA_IF, pin_on=8, pin_out=11, pin_in=11, pin_wake=11, pin_clock=10, pin_cs=9)

# connect to wifi
wlan.active(True)
wlan.connect(WIFI_SSID, WIFI_PASSWORD)
while wlan.isconnected() is False:
    print('Waiting for connection...')
    sleep(1)

request = requests.get('http://catfact.ninja/fact').json()
fact = request['fact']
print('Cat fact!')
print(fact)
1 Like

Was going to add the Plasma flavoured RM2 example to Github but looks like it’s already there :)

1 Like

Excellent! That set of pin values worked. Not the same as the ones in the example on the pimoroni site and I’d NEVER have got them by trial and error. Thanks a lot!