Update:
I managed to get it working!
I found a helpfull thread in the MicroPython Forum (Archive)
I modified Robin2's SimpleTx.ino example for the Arduino Uno (I switched to an Uno because its power is more reliable). (Also I got the common library working.)
Next I modified the micropython code from the forum for the Pi Pico.
I hope you find this helpful!
Here is the code:
arduino_tx.ino
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 9
#define CSN_PIN 10
//addresses
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
//setting up nrf24l01 object
RF24 radio(CE_PIN, CSN_PIN);
char dataToSend[10] = "Message 0";
char txNum = '0';
bool rslt = false;
void setup() {
Serial.begin(9600);
Serial.println("Arduino TX Starting");
if (!radio.begin()) {
Serial.println("Radio not initialized!");
while (!radio.begin()) {}
}
radio.setDataRate( RF24_250KBPS );
radio.openWritingPipe(pipes[0]);
radio.openReadingPipe(1,pipes[1]);
radio.setPALevel(RF24_PA_HIGH);
radio.setChannel(100);
radio.powerUp();
Serial.println("TX Ready...");
}
void loop() {
//sending message
rslt = radio.write( &dataToSend, sizeof(dataToSend) );
Serial.print("Data Sent - ");
Serial.print(dataToSend);
if (rslt) {
Serial.println(" - Acknowledge received");
updateMessage();
}
else {
Serial.println(" - Tx failed");
}
//sleeping for 1 second
delay(1000);
}
void updateMessage() {
//updating message so you can see that new data is beeing sent
txNum += 1;
if (txNum > '9') {
txNum = '0';
}
dataToSend[8] = txNum;
}
pico_rx.py
import utime
from machine import Pin, SPI
from nrf24l01 import NRF24L01
#addresses
pipes = (b'\xe1\xf0\xf0\xf0\xf0', b'\xd2\xf0\xf0\xf0\xf0')
#turning on picos built-in LED to indicate that power is on
led = Pin(25, Pin.OUT)
led.value(1)
print('Pico RX Starting')
#setting up nrf24l01 object
spi = SPI(0, sck=Pin(6), mosi=Pin(7), miso=Pin(4))
csn = Pin(14, mode=Pin.OUT, value=1)
ce = Pin(17, mode=Pin.OUT, value=0)
nrf = NRF24L01(spi, csn, ce, channel=100, payload_size=32)
#opening listening pipe
nrf.open_tx_pipe(pipes[1])
nrf.open_rx_pipe(1, pipes[0])
nrf.start_listening()
print('RX Ready. Waiting for packets...')
while True:
utime.sleep(1)
#checking for a message on the nrf24l01
if nrf.any():
print('Received something!:')
package = nrf.recv()
msg = package.decode()[0:9]
print(msg)