I'm trying to connect my Arduino Nano RP2040 with MicroPython to my local WiFi network and make a HTTP request.
The Nina W102 uBlox module on the board is an ESP32 and connects to the RP2040 via SPI (I'm not sure what this means but I thought it might be relevant).
I've found this code snippet that seems to do what I want
def do_connect():
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('SKYNET', 'G1V31NT3RN3T')
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
do_connect()
But it breaks with:
Traceback (most recent call last): File "", line 1, in ImportError: no module named 'network'
Im using Thonny as an editor and tried to search their packages for something called "Network" and found a match. But that gives me the below error/warning.
Any help or tips greatly appreciated.
UPDATE 1: Found this example with WiFi using CircuitPython. Would prefer to use MicroPython, but if all else fails I might have to switch firmwares. https://learn.adafruit.com/circuitpython-on-the-arduino-nano-rp2040-connect/wifi
UPDATE 2: Opted to use CircuitPython. Getting WiFi was then quite easy.