I have troubles to connect a NRF24L01 to a Wemos D1 R2 board. I succeeded on an Arduino Uno. Does anyone knows the pinout?

I used (same as with Uno):

D13 - SCK
D12 - MI
D11 - MO

D8 and D9 for CE and CSN


#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

// NRF24 Radio
#define CE_PIN   'D8'
#define CSN_PIN  'D9'

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

  // NRF24 Radio
  if (!radio.isChipConnected()) {
    Serial.println("ERROR: NRF24 Chip not connected");
  } else {
    Serial.println("NRF24 Chip connected");
    radio.setDataRate( RF24_250KBPS );
    radio.setRetries(3,5); // delay, count

Result: ERROR: NRF24 Chip not connected

If I use

#define CE_PIN   8
#define CSN_PIN  9

then Wemos crashes (reboot exception (4)) so I tried with D, but I get warning, maybe related:

 warning: multi-character character constant [-Wmultichar]
   22 | RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
      |            ^~~~~~
 warning: multi-character character constant [-Wmultichar]
   22 | RF24 radio(CE_PIN, CSN_PIN); // Create a Radio 
  • Does anyone knows the pinout? ... pinout of what?
    – jsotola
    Apr 18 at 23:53
  • always format error messages as code ... fixed it for you
    – jsotola
    Apr 18 at 23:57
  • 1
    strings are defined by double quote marks, eg. "abc123" ... single characters are defined by single quote marks, eg. 'e' ... two characters inside single quotes are illegal syntax, eg. 'D8' ... remove the single quotes in the two define statements .... you are doing RF24 radio('D8', 'D9');, when you should be doing RF24 radio(D8, D9);
    – jsotola
    Apr 19 at 0:11
  • @jsotola Did not know that. Thanx!
    – FredV
    Apr 20 at 8:05
  • FredV, answers go into the Answer box
    – Juraj
    Apr 20 at 9:49

1 Answer 1


Select Wemos D1 R2/mini in Tools menu in IDE. Then you can use the Dx names of the pins. Don't put them in quotes.

Since D8 is CS pin at the Uno pin 10 location, you can't use it as CE. And because esp8266 has less pin than Atmega328 of Uno, there is no pin D9. I recommend you to use pins D1 and D2 for CE and CSN.

RF24 radio(D1, D2);

Here you can read how the Dx pins are mapped to esp8266 pins and what is the common function of the pins.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.