danjperron
Posts: 2971
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: NRF24L01 RF Transceiver

Sat Feb 17, 2018 4:14 am

Ok I was able to check your code and compare to my code.

I read my notes and I found out that I had that problem.

You need to set the SPI clock to 8Mhz!

insert the spi clock speed at line 374 in lib_nrf24.py

Code: Select all

def begin(self, csn_pin, ce_pin=0):   # csn & ce are RF24 terminology. csn = SPI's CE!
        # Initialize SPI bus..
        # ce_pin is for the rx=listen or tx=trigger pin on RF24 (they call that ce !!!)
        # CE optional (at least in some circumstances, eg fixed PTX PRX roles, no powerdown)
        # CE seems to hold itself as (sufficiently) HIGH, but tie HIGH is safer!
        self.spidev.open(0, csn_pin)
        self.spidev.max_speed_hz=8000000
        self.ce_pin = ce_pin
After that your python code should work!

_lev_
Posts: 4
Joined: Wed Feb 14, 2018 8:53 pm
Location: Poland

Re: NRF24L01 RF Transceiver

Tue Feb 20, 2018 8:36 am

It works !

I owe You one !

Just from curiosity what are the differences between Your and his library?

danjperron
Posts: 2971
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: NRF24L01 RF Transceiver

Tue Feb 20, 2018 12:17 pm

My python library is the same but I did struggle with it 2 years ago.

I don't remember if I found the solution on the net or it was by trial on error.

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 4 guests