Hello everyone, I use Wipy 2.0 in an esp32 wroom32 and I can not use a micropython library for nrf24l01. can anybody help me?
CE on P6 -> GPIO27
CSN on P21 ->GPIO26
SCK on P22 ->GPIO25
MISO on P12 -> GPIO21
MOSI on P20 -> GPIO33
b) The semantics of the SPI method may be different between the poerts. Please compare the different ports (Pycom and micropython) by printing the results and self.buf content from write_register and read_register.
pedrofelipest last edited by pedrofelipest
You have returned this error. And u checked nrf and it's working. I tested it in standard Arduino code.
File "<stdin>", line 1, in <module> File "boot.py", line 34, in master File "nrf24l01.py", line 77, in __init__ OSError: nRF24L01+ Hardware not responding
CE on P6
CSN on P21
SCK on P22
MISO on P12
MOSI on P20
self.spi.readinto(self.buf, 0x20 | reg)
According to the documentation, the syntax is:
self.spi.readinto(self.buf, write=(0x20 | reg))
If that works, you have to change the other places too.
I set the pins to use the SPI
csn = Pin(cfg['csn'], mode=Pin.OUT, value=1) ce = Pin(cfg['ce'], mode=Pin.OUT, value=0) spi = SPI(0, pins=('P22','P20','P12')) nrf = NRF24L01(spi, csn, ce, payload_size=8)
Make a mistake in the library
def reg_write(self, reg, value): self.cs(0) self.spi.readinto(self.buf, 0x20 | reg) # The mistake happens here. More arguments than necessary ret = self.buf self.spi.readinto(self.buf, value) self.cs(1) return ret
@pedrofelipest Yes, and my other question:
- how do you call that module? Which parameters do you use?
- What is the result of the call. Any error messages?
@pedrofelipest Please give a link to that library, post the section of code in which you use the library and what kind of response you get.