Rahul - I am trying to work with this code but have lot of issues. As I am very new to Raspberry Pi and Arduino. So wondering if you can check my code and wiring and help me troubleshoot.....please advise.
I haven't posted my code yet but can do. However if possible I would like to have video conf so we can check if any of my lib is corrupt. So if you are OK with video conf then please advise or let me know where to post my code for your review.
Fantastic tutorial, worked out great for me. I would recommend adding "GPIO.cleanup()" to the very end of the program on the RPi due to constant "pin-in-use" warnings before the program is run after previously being executed
If it helps anyone i had a lot of trouble with setting the radio on the pi with the python script. The displayed data (printDetails) was not what i set, just random. I added a line in the lib : self.spidev.max_speed_hz = 1000000 after spidev.open and it fixed it. 1MHz may be a bit conservative but i'm guessing the default speed was just too fast and was causing corrupted data to be set on the radio. All good now and great tutorial!
I was busy for so long trying to figure out what i was doing wrong. Then one day i saw this comment. Really helped me out dude! Thanks a lot! I still don't really understand why this helped but it probably has to do with what you said. (You are probably way better at this then I am) Again man thanks a lot!!
Thanks Richard for spi speed tip. I'm converting my wx station over to python 3 and encountered the same problem. Your tip saved me loads of time! I may have never figured this out... Sincere thanks! Works sweet. FWIW.. I tried 1mhz, 4mhz, 8mhz, & 10mhz max_speed spi polling data from 3 wireless Arduino temp and humidity sensors... All spi speeds worked well.
Good to year Michael and great job determining some other working speeds! I've read somewhere that the max for the NRF is 10Mhz so that fits. When i tried it it was out of sheer desperation and i had run out of ideas, glad i tried it now though!
+iCore My goodness, how embarrassing. You are absolutely right! I mention pin 6 on the table but messed up on my diagram! Thanks for the catch. This issue is present on the other tutorial for pi-pi communication. I will edit the videos and re-upload this weekend. Thanks for the feedback!
*IMPORTANT FOR PIE 4 B USERS WITH ARUDINO NANO* The library does not work with this setup because of the different clock speed. I've fixed it. Use this lib instead: github.com/trueToastedCode/Python/blob/master/Fix/lib_nrf24.py and use "radio.begin(0, 17, 4000000)" instead of "radio.begin(0, 17)"
It has taken me a bit of work to get the RasPi 3 Model B+ working with the Arduino Uno, but there are a few things you need to check, first make sure your PIN config is right for the RP3, if you look close enough on this video you will see that Alexander is using RPi2 so make sure you change the GND PIN on your RPi3 to PIN 6 NOT PIN2 (5V), next if you are getting a whole lot of screen messages coming up with UNI codes like 251 etc then you need to add the line that RCHype put into the Lib_nrf24.py file ... self.spidev.max_speed_hz=4000000 ..... that fixed my problem and now I can move onto the next tutorial, hope that helps everyone!
Im having same problem with NRF24L01+PA+LNA paired with RPi3b. When the listening rpi should not receive anything the script keeps showing me numbers like 11/13/17 which change randomly. Already checked the wiring and also tested with rpi zero with same script and same configuration. Powering the arduino up seems to take 0 effect to received data what could be caused by this garbage data that the listening end is somehow hearing. Both of the NRF24L01+PA+LNA adapters should work (previously used with communicating between 2 arduino nanos, which worked perfectly). The listening NRF24 has the external power circuit that regulates 5v to 3.3. Could you point out more info for me of this ... self.spidev.max_speed_hz=4000000 ... I didnt find that line from the lib_nrf24.py
you need to insert .... self.spidev.max_speed_hz=4000000 into your Lib_nrf24.py file, after that I started to get the message transmitting and being received as it should, I will copy the Lib_nrf24.py file and post it if you can't get it working, let me know how you get on?
I am trying to run this on Raspberry pi version 1, but I get no signal on Rpi, pin configuration are as follow: nrf24l01 RPi vcc 3v3 GND ground (pin 6) CE GPIO22 (pin 15) CSN GPIO8(pin 24) MOSI GPIO10( pin 19) MISO GPIO9 (pin 21) SCK GPIO11(pin 23) I changed the code line radio.begin(0,17) to radio.begin(0,22) and still have no signal to RPi. Looking forward for a reply. Thank you.
Hi, when I run the script on the pi, it prints "Received: [195, 0, 0, 0, 0 ...0] and there is no decoded message. Could you offer any reason why this may be?
I followed your video exactly and used the same coding on the same hardware, but when I run I get a totally different result( meaning a bad one). When I run it an error occurs that causes the while loop to continue to run infinitely at full speed. And when i stop the program this is displayed " Traceback (most recent last): File "/home/pi/Desktop/NRF24L01?arduinotopi.py", line 34, in print("translating received...") File "/usr/lib/python3.4/idlelib/PyShell.py", line 1352, in write return self.shell.write(s, self.tags) I was hoping you could help me with this issue as I have been struggling with these modules and your tutorial has been most helpful Thanks, Danny
Whenever I attempt to run this, it stops at the while not radio.available(0) line which tells me that the arduino is not sending anything. After checking the code over and over again, I see no inconsistencies and the wiring looks correct (including the ground error). The only thing that I caught that was different was in the final python3 run window at 20:15 CONFIG is listed at 0x0c and mine is listed at 0x0f. Is that a clue to what is wrong?
For the Raspberry Pi pin mapping...you verbally say "GND to GND", the table says GND/GND/6...but on the visual of your Pi, you show the NRF24L01+ "GND" connected to pin 2 of Raspberry Pi, which is 5V. Did you make a mistake in your visual of RaspPi? I assume if you connect the table pins, it all works out (but some confirmation would be great). Thanks!
After scrolling down (which I should have focused a bit more on first), I got the following answer from the video publisher. Perhpas update the video :) Other than that, thanks so much, I really appreciate people like you! Alexander Baran-Harper (3-YEARS AGO): My goodness, how embarrassing. You are absolutely right! I mention pin 6 on the table but messed up on my diagram! Thanks for the catch. This issue is present on the other tutorial for pi-pi communication. I will edit the videos and re-upload this weekend. Thanks for the feedback!
I have no idea if this will randomly help anyone, but it threw me off for 2 days until I stumbled up a "solution". If your RPi printout is not saying it's receiving anything, try unplugging your CSN pin on the arduino. With that pin floating, mine works as intended... but when I plug it back in? The RPi stops getting data. No clue what causes this, but I figured I'd put a note here for any other people in my situation.
Hey thank u for the video very helpful for beginners like me. I had like to ask u a question, i would like to know what the function setAutoAck() does and what difference does it make when setting it to true or false. Thank u
Hi Great Tutorial. I got mine working a described in the video but I was wondering if there is a way to have the arduino send over a struct then have the pi translates it and print the outputs.
Excellent video! I wanting to do this exact thing - communicating between my Pi and Arduinos. Quick question though... Should this still work if I don't use the exact pin-out that you're using for the Pi and Arduino? I sure the MISO/MOSI pins have to be used as you demonstrated, but how about CE/CSN? And how about the pipes and addresses? Can i use any set of 5 hex values here, or is there something hardcoded in the libraries that we downloaded preventing us from using anything else? I'm also getting the same RuntimeWarning as Brent, so maybe I'll try adding his try statement. Thanks again and I look forward to watching more of your videos.
+Ben Reese The SPI pin configuration (MOSI/MISO/CLK) needs to be maintained. The pi is able to communicate with two devices through SPI, differentiated by the chip select pins. The chip selection pins on the pi are labeled CE0 and CE1, corresponding to GPIO 8 and GPIO 7 (or even pin 24, 26) respectively. You can choose to use CE1 instead of CE0 (what I show in the video). This pin needs to marry up with the appropriate NRF24L01 CSN pin, the chip select pin on the unit (see pg 11 of the datasheet). CE on the NRF24L01 is the 'Chip Enable' pin, responsible for activated RX or TX mode. I assume this is a simple digital input and thus shouldn't require anything special. There's nothing special about the GPIO 17 I use, but whatever you choose, the code needs to be adjusted accordingly. If you choose to change your chip select pin you'll need to adapt the code accordingly too (radio.begin). I don't see why a different set of hex values wouldn't work for the address. I followed a couple tutorials when I was learning how to do this first and I saw variation in addresses indicated nothing is hard coded. Something I realize I've omitted from the tutorial is that the Arduino end does have some default settings I didn't specify. Like data rate. I specified this on the pi script, not the Arduino code. Just be wary of this while you tinker! Happy learning!
Thank you for your quick response! I'll play around more and see what I can figure out. I've watched several tutorials and yours is probably the best I've found so far. I've got my CSN wire connected to the same pin as CE1, so that could be causing me problems.
I am new to raspberry Pi, but I have done arduino uno, trinket, and pro trinket projects. What is the blue part on the bread board going to the raspberry with of the gray wire? What else should I have when I purchased my first raspberry pi? Things have changed since I graduated in computers in 1999.
+Timothy Carey The Raspberry Pi I'm using in this tutorial is the newer style with a 40 pin GPIO header (I think the old versions have 24 pin GPIO headers). The black cable is a standard hard drive 40 pin cable. The blue adaptor is a 'Pi Cobbler,' T style. It simply brings the Pi's header to the bread board and conveniently labels the pins. It's easier to breadboard with a pi and one of these units, I recommend it. However, it's not necessary to complete this tutorial; everything can be done with jumper wires straight off the header.
Hi, i have a question, i can use the nrf24 network library of arduino with the raspberry and same library or i have to use another library to make a network? Thanks
OK, so i have a 5" touch screen that snapes onto my GPIO taking up a good chunk of the pins, can i tell the pi to utilize my unused pins? or are the ones you used absolutely needed? and all i get is an array of [255,255,255....]
Hello tried using this video/code. Initially the code was running but I was not seeing any rcvd message. So I tried to check my wiring but I still rewired to rule out wiring issue. However now my code is not running at all. It basically stops after processing line PA Power = PA_MIN and does not move further. Any idea as what am I doing wrong? Any help/pointer is greatly appreciated
I followed your tutorial and it worked great. I am now interested in creating a NRF24L01 NETWORK between Arduino and Raspberry Pi. Is there a chance you could create such a tutorial or provide some guidance?
i tried following you but then got error like below, i can't find how to fix it, can you give me a solution File "sendreceivepi.py", line 11, in radio.begin(0,17) File "/home/pi/Desktop/NRF24L01/lib_nrf24.py", line 373, in begin self.spidev.open(0, csn_pin) FileNotFoundError: [Errno 2] No such file or directory
Hello, I want to ask about autoAck(). If we'll enable it wouldn't that mean that it will auto acknowledge packet for us? Why do we need to send extra [1]? I'm trying to communicate with a couple AVRs and I've written code, that uses auto-ack feature and I've set maximum retransmission count (15). Also, I don't send any ack payload and it works flawlessly between AVRs, but now I want to make RPi as master and this part confuses me a little bit. EDIT: also why do you use two different addresses for pipes? With AVRs I only use pipe 0, where RX and TX addresses are same. Datasheet says they need to match for auto ack to work.
Thank you for the video but I have question with radio module. I too connected everything like u said in the video. It first connects and shows the hello world message and then after I disconnect the radio module and connect it again nothing shows u know. After a setup a new radio module again it shows the output but after disconnecting and connecting again never shows the output. From last two days I am having these problem please help me out. Thank you
Thanks for your comments! Comments like yours really make me happy :). I don't have anything other than what you can find on my channel. I'm working on a new set of tutorials focusing on the Arduino - so you can stay tuned for that. Eventually I will have a website up and running that allows for a bit better explanations of things. No books in the near future though :(
thank you Alexander for this useful tutorial i have learnt alot from it but i have some problem that i hope you coulde help me with it it is that when i connect the raspberry with nrf24 i do not use T-cobbler plus i connected directly to the raspberry pi pins so... what change will be in the code that is in raspberry pi?? h
Awesome Tutorial! Worked for me for a couple of minutes, but after using ctrl c and rerunning the program, the RPi got stuck after: PA Power = PA_MIN I don't know if the Arduino Pro Mini is no longer communicating with the RPi, or if the Python code on the RPi isn't working properly, or what. Potted capacitors are soldered and connecting V+ to GND on both modules. Also, it first worked by powering the Arduino through a usb to serial FTDI, but stopped. I tried powering with 2s lipo battery, and Arduino turns on fine, but still my RPi recieves nothing. Please Help!!
hi Alexander Baran-Harper thank u for uploading this video,this was really helpful but i m having trouble with receiving the data sent from arduino to raspbery pi.My arduino is sending and the contents are visibile in serial monitor but raspberry pi is not receiving.The code is stuck in the radio.avaliable function and it is going to continuous sleep.How can i fix this?? Thanks in advance....... :)
Hi. I am planning to use that communication to read a value from ultrasonic sensor connected to Arduino pro mini and main issue is to have integer values instead text. How solve that problem?
I am not getting any message in the raspberry pi end. I have done all the things, It is receiving [0,0...] and after that as usual not decoding anything. Can you tell me what is the problem? Mr. Alex.
don't follow the pin setup in this video....I think it shorted out the 3v3 pin on my pi because it wont boot anymore. At around 0:40, the ground is actually connected to the pi's 5V pin.
Other comments fixed it, you have to add a line of code into the lib_nrf24.py file. Just search trough a few comments, the issue has been adressed multiple times.
I have Raspberry pi 3 b+ model. Program ran but didn't transfer any message. Recieved [] and sometimes random values. TX_FULL=1, RX_ADDR is also different from the one I set. Random. CRC Length is showing disabled.Is there a proper solution to this ?
I have done as instructed and have quadruple checked everything, and I can only get this error code: File "recv.py", line 11, in radio.begin(0, 17) File "/home/pi/Desktop/NRF24L01/lib_nrf24.py, line 373, in begin self.spidev.open(0, csn_pin) IOError: [Errrno 2] No such file or directory Any help would be appreciated. thanks!
For anyone else having this problem, make sure the first parameter of radio.begin() is 0, such as radio.begin(0, 17). Changing 0 to anything else will cause this problem.
Great Stuff! From what I understand , you can then communicate with several arduinos on different channels? I'm going to get started on something in a few weeks/months - I was thinking of adding authentication with anti-replay too if anyone is interested.... Any commands which affect the physical relays sent from the Pi would not be encrypted, but have a signature appended on the end which would be calculated from a hard coded key + the command. On the receiving side, the Arduino would have the same key and algorithm to check the signature is consistent with the command. To prevent replay of recorded commands, the Arduino would also accept an unsigned command (which the Pi would send before each "Real" command) to transmit a counter. The Pi would then include this counter in the signed command and the signature would be calculated from the command + counter. The Arduino would only accept commands with that counter value and then increment the counter. No two command packets from the Pi would ever be the same. I'd probably implement a counter reset too, but nothing like OTA key updates.
Hello, Thank you so much for the tutorial. I am getting everything except string. Received: [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 0] Translating our output into meaningfull way Our received message decodes to: So I am not getting the "hello world" message. Can you please help me with this ?? Thanks in advance
Great tutorial, but my arduino doesn't seems to be writing the message, it hangs on the radio.write(&text,sizeof(text)); and in my raspberry I only see Received: [127, 127, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 127, 127, 127, 255, 127, 127, 127, 127, 127, 127, 255, 255]. Anyone had a similar problem?
Hi I am trying to get the RPI part to work but I get the following error on that part: Traceback (most recent call last): File "/home/pi/Desktop/NRF24L01/lib_nrf24/recievertest.py", line 29, in while not radio.available(0): File "/home/pi/Desktop/NRF24L01/lib_nrf24/lib_nrf24.py", line 523, in available self.write_register(NRF24.STATUS, _BV(NRF24.RX_DR)) File "/home/pi/Desktop/NRF24L01/lib_nrf24/lib_nrf24.py", line 245, in write_register return self.spidev.xfer2(buf)[0] TimeoutError: [Errno 110] Connection timed out I hope someone can point me in the right direction. My full code is: import RPi.GPIO as GPIO from lib_nrf24 import NRF24 import time import spidev GPIO.setmode(GPIO.BCM) pipes = [[0xE8, 0xE8, 0xF0, 0xF0, 0xE1], [0xF0, 0xF0, 0xF0, 0xF0, 0xE1]] radio = NRF24(GPIO, spidev.SpiDev()) radio.begin(0, 17) radio.setPayloadSize(32) radio.setChannel(0x76) radio.setDataRate(NRF24.BR_1MBPS) radio.setPALevel(NRF24.PA_MIN) radio.setAutoAck(True) radio.enableDynamicPayloads() radio.enableAckPayload() radio.openReadingPipe(1, pipes[1]) radio.printDetails() radio.startListening() while True: while not radio.available(0): time.sleep(1/100) recivedMessage = [] radio.read(recivedMessage, radio.getDynamicPayloadSize()) print("Recieved: {}".format(recivedMessage)) print("Translating our recieved message into unicode characters...") string = "" for n in recivedMessage: if (n >= 32 and n
Hello, ty for this tutorial, but i have a little problem. When i launch the command "sudo python3 receiv......py" i have too many empty line with our Received Message decode to : "", and sometimes i have Received:[255, 255, 255, 255, 255, 255, 255, 255 ...] Do u have any idea ? Please help me.
i had the same problem before, i found out my rpi to nrf connection is wrong. the gnd of nrf is not connected to 5v of rpi, it should be connected to gnd of rpi
Most probably you connect ground to the second pin instead of 6th, cause in the schema connection there is an error in the video (check pins according to the table) th-cam.com/video/_68f-yp63ds/w-d-xo.html
Thanks for the tutorials on the NRF24. Been playing with other libraries, but the libraries you used, and the code demonstrated are much easier to work with. It all makes sense now.The basic scripts on the Pi and Arduino were working with out any issues a few days ago. Now when I run, I get these RuntimeWarning messages. If I reboot the Pi, and run the scripts, the Pi displays the first item transferred, and then nothing after that. If I then hit Ctrl-C to exit the running script on the Pi, then any further attempts running the script generates this error message, and I get no values from the Arduino. Any ideas? My script is exactly as you have yours, and was working fine a few days ago? /home/bob/scripts/NRF24L01 $ sudo python recvArduino.py /home/bob/scripts/NRF24L01/lib_nrf24.py:377: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. self.GPIO.setup(self.ce_pin, self.GPIO.OUT) STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0 RX_ADDR_P0-1 = 0xe8e8f0f0e1 0xf0f0f0e1e1 RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6 TX_ADDR = 0xe8e8f0f0e1 RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00 EN_AA = 0x3f EN_RXADDR = 0x03 RF_CH = 0x76 RF_SETUP = 0x01 CONFIG = 0x0f DYNPD/FEATURE = 0x3f 0x06 Data Rate = 1MBPS Model = nRF24l01+ CRC Length = 16 bits PA Power = PA_MIN
Ok, looks like I solved both issues. To address the "channel already in use" error, I added the following code changes: try: while True: except KeyboardInterrupt: GPIO.cleanup() The other issue with only the first transmitted value showing up turns out to have been an issue on the Arduino side. I had the FTDI Friend attached for uploading scripts, but no power running to the RF24 chip. Strange that the chip would send one value and then stop. Once things were properly powered up, everything started working correctly. Note that I am using a Trinket Pro 5V to run everything. So far, everything is up and running again.
Could someone help? Everybody is asking this: Nothing is received after PA_MIN! It only sends once. And then, when I reset, everything vanishes and stops after PA_MIN I’ve read every single comment however, nane of them worked! Please help me!
hi everyone Recently i´ve been trying to connect my raspberry pi 3+ with arduino nano. The raspberry pi seems to be working too fast and the message is only elegible in the first number [64,0,0...] Any idea? anyone can help? thanks in advance
oh jeez.. of course you should check the pinouts with google.. to prevent other people from this failure, could you just place some text over the wiring diagram? this is easily done in youtube. now going to wire the ground to the real ground and hope it works. nicely explained though;)
guys, for me it keeps printing an empty recieved message even if the arduino is not connected, I think that it doesn't go into the "while not", does any one know why and whats wrong??!!
Hi! Sorry to bother you, but I keep getting this error. I did this a while back and it worked, but I don't know what has happened. Everything is exactly the same to the best of my knowledge. Traceback (most recent call last): File "sendArduino1.py", line 11, in radio.begin(0, 17) File "/home/pi/Desktop/NRF24L01/lib_nrf24.py", line 373, in begin self.spidev.open(0, csn_pin) IOError: [Errno 2] No such file or directory Thanks, have a great day!
I had a clean HypriotOS (version of raspbian) and I was missing something python things. This maybe helpful to somebody else who did not setup python before. sudo apt-get install python-dev python3-dev gcc python3-setuptools python3-pip sudo pip3 install RPi.GPIO
Hi there! during the past week i faced a couple of issue with this library(lib_nrf24.py)!! first, CRC Length was always returning disabled. Second, after using a GPiopin as CE(in the tutorial he used the 17) in raspberry(My one is 3plus) i cound't use the same pin again, i simple had to change to gpio 26 or anyother. To figure it out took me some time OMG google was my b*! -The first issue was solved using the JakFourie advice from github(github.com/nRF24/RF24/issues/485), thank you JakS2 -the Second, (fork me the second!!!!!) this was a bit by my on, using an voltimeter(not required).... Aparently, after the firts time the program runed, it changed the CE pin's state, and when i re-runed the same code it wouldn't work........ To fixed this, i had to add the GPIO.cleanup() with a try block.(raspi.tv/2013/rpi-gpio-basics-3-how-to-exit-gpio-programs-cleanly-avoid-warnings-and-protect-your-pi) but is was not enough........ to killed it once and for all i had to force the CE pin to be GPIO.OUT and change the state to False, just before the radio.begin() method. i'm using the raspberry 3 plus, i don't know if he is guitty for this issues... anyway, I hope this helps anyone, carry on!!!! sorry for my bad english
@@cyboticIndustries github.com/matmany/lib_nrf24 this is the lib that i`ve changed!!! u can use the same example in the video, just replace the lib_nrf24.py file. Hope it wokes, anything let me know
first of all thank u for your solution, but it didn't help me...Im also using a 3b+, but the radio.available()is always true, even if I connect nothing to the pi. I tried add "self.spidev.max_speed_hz = 100000",nothing changes. This thing is driving me crazy!!Could u help me?
Great tutorial! Raspberry Pi 3 users: note that Ground is at Pin6, different from the diagram in the video. Worked great as soon as I made the change.
Rahul - I am trying to work with this code but have lot of issues. As I am very new to Raspberry Pi and Arduino. So wondering if you can check my code and wiring and help me troubleshoot.....please advise.
Sachin Verma sure, do you have your code posted anywhere?
I haven't posted my code yet but can do. However if possible I would like to have video conf so we can check if any of my lib is corrupt. So if you are OK with video conf then please advise or let me know where to post my code for your review.
Thanks for this video! There's a lot of confusing/problematic info and tutorials out there, this worked perfectly the first time I tried it!
Excellent tutorial! Just received my first two NRF24L01 and this was the first video I found. Thanks for sharing!
Fantastic tutorial, worked out great for me. I would recommend adding "GPIO.cleanup()" to the very end of the program on the RPi due to constant "pin-in-use" warnings before the program is run after previously being executed
I am getting warnings, even with GPIO.cleanup() in my code.
Great tutorial! I love how you have a drive called POOP at 15:42 :)
If it helps anyone i had a lot of trouble with setting the radio on the pi with the python script. The displayed data (printDetails) was not what i set, just random. I added a line in the lib : self.spidev.max_speed_hz = 1000000 after spidev.open and it fixed it. 1MHz may be a bit conservative but i'm guessing the default speed was just too fast and was causing corrupted data to be set on the radio. All good now and great tutorial!
I was busy for so long trying to figure out what i was doing wrong. Then one day i saw this comment. Really helped me out dude! Thanks a lot! I still don't really understand why this helped but it probably has to do with what you said. (You are probably way better at this then I am) Again man thanks a lot!!
No problem!, glad i helped someone.
Thanks Richard for spi speed tip. I'm converting my wx station over to python 3 and encountered the same problem. Your tip saved me loads of time! I may have never figured this out... Sincere thanks! Works sweet. FWIW.. I tried 1mhz, 4mhz, 8mhz, & 10mhz max_speed spi polling data from 3 wireless Arduino temp and humidity sensors... All spi speeds worked well.
Good to year Michael and great job determining some other working speeds! I've read somewhere that the max for the NRF is 10Mhz so that fits. When i tried it it was out of sheer desperation and i had run out of ideas, glad i tried it now though!
Thank you so much @Richard Law, you saved my day.
Is it me or the wiring for the Raspberry Pi to NRF24 is wrong ?
Looks like the ground of the module is connected to the 5V of the Raspberry Pi
+iCore My goodness, how embarrassing. You are absolutely right! I mention pin 6 on the table but messed up on my diagram! Thanks for the catch. This issue is present on the other tutorial for pi-pi communication. I will edit the videos and re-upload this weekend. Thanks for the feedback!
+iCore I thank u dear stranger, this comment of yours just help me figure out why the hell my raspberry couldnt function as in tutorial..Thank you!
Note to self, read the comment section prior to testing/troubleshooting. Thank you!
Video not changed!! Wiring still wrong.
Perfect tutorial. Easiest way to make communication I've found in the internet. It's awesome how easy it is to build own devices now. Best wishes
Hi I m getting a Name Error for the pipe address specifically 0xE1 any idea why ?
Can you post full error message?
Well apparently the error disappeared but now I don't receive any data from the Arduino. [ 0, 0, 0, 0, 0, 0,....]
Thank you, Alexander Baran-Harper, for sharing your knowledge! A long way to go for me to learn as much as you :)
*IMPORTANT FOR PIE 4 B USERS WITH ARUDINO NANO*
The library does not work with this setup because of the different clock speed. I've fixed it. Use this lib instead: github.com/trueToastedCode/Python/blob/master/Fix/lib_nrf24.py
and use "radio.begin(0, 17, 4000000)" instead of "radio.begin(0, 17)"
The link is not working for me. Can you please add back the library? Thank you
@@ayushbanerjee1187 fixed it… Link should work now
@@trueToastedCode So this libary that you mentioned, can fix errors like "Received: [195, 0, 0, 0, 0 ...0] ?
Bro ive spent way to much time on the thing im working, if your solution works u deserve a virtual kiss
U deserve a kiss
Around 40sec, the table is correct, but the scheme is wrong at the connection of Ground. It should be connected to pin 6 (GND), not pin 2 (5V)
It has taken me a bit of work to get the RasPi 3 Model B+ working with the Arduino Uno, but there are a few things you need to check, first make sure your PIN config is right for the RP3, if you look close enough on this video you will see that Alexander is using RPi2 so make sure you change the GND PIN on your RPi3 to PIN 6 NOT PIN2 (5V), next if you are getting a whole lot of screen messages coming up with UNI codes like 251 etc then you need to add the line that RCHype put into the Lib_nrf24.py file ... self.spidev.max_speed_hz=4000000 ..... that fixed my problem and now I can move onto the next tutorial, hope that helps everyone!
Im having same problem with NRF24L01+PA+LNA paired with RPi3b. When the listening rpi should not receive anything the script keeps showing me numbers like 11/13/17 which change randomly. Already checked the wiring and also tested with rpi zero with same script and same configuration. Powering the arduino up seems to take 0 effect to received data what could be caused by this garbage data that the listening end is somehow hearing. Both of the NRF24L01+PA+LNA adapters should work (previously used with communicating between 2 arduino nanos, which worked perfectly). The listening NRF24 has the external power circuit that regulates 5v to 3.3. Could you point out more info for me of this ... self.spidev.max_speed_hz=4000000 ... I didnt find that line from the lib_nrf24.py
you need to insert .... self.spidev.max_speed_hz=4000000 into your Lib_nrf24.py file, after that I started to get the message transmitting and being received as it should, I will copy the Lib_nrf24.py file and post it if you can't get it working, let me know how you get on?
@@cdellis69 please can you post it
Sir you should add it after spidev.open.
Thank you so much! This was exactly what was happening for me!!
I am trying to run this on Raspberry pi version 1, but I get no signal on Rpi,
pin configuration are as follow:
nrf24l01 RPi
vcc 3v3
GND ground (pin 6)
CE GPIO22 (pin 15)
CSN GPIO8(pin 24)
MOSI GPIO10( pin 19)
MISO GPIO9 (pin 21)
SCK GPIO11(pin 23)
I changed the code line
radio.begin(0,17) to radio.begin(0,22) and still have no signal to RPi.
Looking forward for a reply.
Thank you.
Hi, when I run the script on the pi, it prints "Received: [195, 0, 0, 0, 0 ...0] and there is no decoded message. Could you offer any reason why this may be?
did you ever get this fixed?
same here
did you guys fixed it ?
i have te same problem, idk how to resolve it
I followed your video exactly and used the same coding on the same hardware, but when I run I get a totally different result( meaning a bad one). When I run it an error occurs that causes the while loop to continue to run infinitely at full speed. And when i stop the program this is displayed
"
Traceback (most recent last):
File "/home/pi/Desktop/NRF24L01?arduinotopi.py", line 34, in
print("translating received...")
File "/usr/lib/python3.4/idlelib/PyShell.py", line 1352, in write
return self.shell.write(s, self.tags)
I was hoping you could help me with this issue as I have been struggling with these modules and your tutorial has been most helpful
Thanks,
Danny
It's a hail mary but did you ever resolve this? I'm also running into this problem. thanks
Great video. Thanks for the kickstarter.
👏🏻👏🏻👏🏻simple on point. Respect sir!
How do I send and receive Integers instead of string?
Thankyou! Got it working this far. VERY good tutorial.
Whenever I attempt to run this, it stops at the while not radio.available(0) line which tells me that the arduino is not sending anything. After checking the code over and over again, I see no inconsistencies and the wiring looks correct (including the ground error). The only thing that I caught that was different was in the final python3 run window at 20:15 CONFIG is listed at 0x0c and mine is listed at 0x0f. Is that a clue to what is wrong?
daBatman2 i also got the same problem like u. Did u manage to solve it?
For the Raspberry Pi pin mapping...you verbally say "GND to GND", the table says GND/GND/6...but on the visual of your Pi, you show the NRF24L01+ "GND" connected to pin 2 of Raspberry Pi, which is 5V.
Did you make a mistake in your visual of RaspPi? I assume if you connect the table pins, it all works out (but some confirmation would be great). Thanks!
After scrolling down (which I should have focused a bit more on first), I got the following answer from the video publisher. Perhpas update the video :) Other than that, thanks so much, I really appreciate people like you!
Alexander Baran-Harper (3-YEARS AGO): My goodness, how embarrassing. You are absolutely right! I mention pin 6 on the table but messed up on my diagram! Thanks for the catch. This issue is present on the other tutorial for pi-pi communication. I will edit the videos and re-upload this weekend. Thanks for the feedback!
I have no idea if this will randomly help anyone, but it threw me off for 2 days until I stumbled up a "solution". If your RPi printout is not saying it's receiving anything, try unplugging your CSN pin on the arduino. With that pin floating, mine works as intended... but when I plug it back in? The RPi stops getting data. No clue what causes this, but I figured I'd put a note here for any other people in my situation.
I want to connect NRF to Two different Pi's and want to see text message and audio stream to another pi when both are in range
Hey thank u for the video very helpful for beginners like me. I had like to ask u a question, i would like to know what the function setAutoAck() does and what difference does it make when setting it to true or false. Thank u
Hi Great Tutorial. I got mine working a described in the video but I was wondering if there
is a way to have the arduino send over a struct then have the pi translates it and print the outputs.
Excellent video! I wanting to do this exact thing - communicating between my Pi and Arduinos.
Quick question though... Should this still work if I don't use the exact pin-out that you're using for the Pi and Arduino? I sure the MISO/MOSI pins have to be used as you demonstrated, but how about CE/CSN? And how about the pipes and addresses? Can i use any set of 5 hex values here, or is there something hardcoded in the libraries that we downloaded preventing us from using anything else?
I'm also getting the same RuntimeWarning as Brent, so maybe I'll try adding his try statement.
Thanks again and I look forward to watching more of your videos.
+Ben Reese The SPI pin configuration (MOSI/MISO/CLK) needs to be maintained. The pi is able to communicate with two devices through SPI, differentiated by the chip select pins. The chip selection pins on the pi are labeled CE0 and CE1, corresponding to GPIO 8 and GPIO 7 (or even pin 24, 26) respectively. You can choose to use CE1 instead of CE0 (what I show in the video). This pin needs to marry up with the appropriate NRF24L01 CSN pin, the chip select pin on the unit (see pg 11 of the datasheet).
CE on the NRF24L01 is the 'Chip Enable' pin, responsible for activated RX or TX mode. I assume this is a simple digital input and thus shouldn't require anything special. There's nothing special about the GPIO 17 I use, but whatever you choose, the code needs to be adjusted accordingly. If you choose to change your chip select pin you'll need to adapt the code accordingly too (radio.begin).
I don't see why a different set of hex values wouldn't work for the address. I followed a couple tutorials when I was learning how to do this first and I saw variation in addresses indicated nothing is hard coded.
Something I realize I've omitted from the tutorial is that the Arduino end does have some default settings I didn't specify. Like data rate. I specified this on the pi script, not the Arduino code. Just be wary of this while you tinker!
Happy learning!
Thank you for your quick response! I'll play around more and see what I can figure out. I've watched several tutorials and yours is probably the best I've found so far.
I've got my CSN wire connected to the same pin as CE1, so that could be causing me problems.
Worked like a charm! Thanks a lot!
radio.availabe() seems to be always true. anyone else has this problem?
@@ElectronicManiacLars Yes, did you ever end up solving it?
I am new to raspberry Pi, but I have done arduino uno, trinket, and pro trinket projects. What is the blue part on the bread board going to the raspberry with of the gray wire? What else should I have when I purchased my first raspberry pi?
Things have changed since I graduated in computers in 1999.
+Timothy Carey The Raspberry Pi I'm using in this tutorial is the newer style with a 40 pin GPIO header (I think the old versions have 24 pin GPIO headers). The black cable is a standard hard drive 40 pin cable. The blue adaptor is a 'Pi Cobbler,' T style. It simply brings the Pi's header to the bread board and conveniently labels the pins. It's easier to breadboard with a pi and one of these units, I recommend it. However, it's not necessary to complete this tutorial; everything can be done with jumper wires straight off the header.
Can we use this module to send/receive voice?
@12:29 Ctrl-V [ESc] Sequenzer. KEY.sets asMatrix. Faulty ALT FN Shift Funktion Keys????¿¿¿¿‽
Thank you very much. That helped me a lot!
Hi, i have a question, i can use the nrf24 network library of arduino with the raspberry and same library or i have to use another library to make a network? Thanks
Hi, thanks for your time.
Earlier it was working OK, but now it won't work until i disconnect CE pin. Any idea why this is happening?
What is the use of the IRQ pin on the NRF24L01?
OK, so i have a 5" touch screen that snapes onto my GPIO taking up a good chunk of the pins, can i tell the pi to utilize my unused pins? or are the ones you used absolutely needed?
and all i get is an array of [255,255,255....]
Me too what can i do to remove this problem
I have same problem :'(
Me too :(
This does'nt work so I gave up and went for a bluetooth module which works seamlessly
Pin 2 is 5V change the jumper to Pin 6
Hello tried using this video/code. Initially the code was running but I was not seeing any rcvd message. So I tried to check my wiring but I still rewired to rule out wiring issue. However now my code is not running at all. It basically stops after processing line PA Power = PA_MIN and does not move further. Any idea as what am I doing wrong?
Any help/pointer is greatly appreciated
The same for me. Sometimes the message also says the channel is already in use, then ends with that information.
Check the indentation in the while loop. Have fun
@@quippyc maybe this will help with that problem. raspi.tv/2013/rpi-gpio-basics-3-how-to-exit-gpio-programs-cleanly-avoid-warnings-and-protect-your-pi
Will this work on an arduino nano?
Is it possible to connect 2 or more adruinos to the pi , a form of intranet over wifi ?
I followed your tutorial and it worked great.
I am now interested in creating a NRF24L01 NETWORK between Arduino and Raspberry Pi. Is there a chance you could create such a tutorial or provide some guidance?
i tried following you but then got error like below, i can't find how to fix it, can you give me a solution
File "sendreceivepi.py", line 11, in
radio.begin(0,17)
File "/home/pi/Desktop/NRF24L01/lib_nrf24.py", line 373, in begin
self.spidev.open(0, csn_pin)
FileNotFoundError: [Errno 2] No such file or directory
@@vietthangnguyen6608 Enable the SPI in the raspi config
Hello, I want to ask about autoAck(). If we'll enable it wouldn't that mean that it will auto acknowledge packet for us? Why do we need to send extra [1]? I'm trying to communicate with a couple AVRs and I've written code, that uses auto-ack feature and I've set maximum retransmission count (15). Also, I don't send any ack payload and it works flawlessly between AVRs, but now I want to make RPi as master and this part confuses me a little bit.
EDIT: also why do you use two different addresses for pipes? With AVRs I only use pipe 0, where RX and TX addresses are same. Datasheet says they need to match for auto ack to work.
Thank you for the video but I have question with radio module. I too connected everything like u said in the video. It first connects and shows the hello world message and then after I disconnect the radio module and connect it again nothing shows u know. After a setup a new radio module again it shows the output but after disconnecting and connecting again never shows the output. From last two days I am having these problem please help me out. Thank you
Great job Alexander, you have a serious gift for teaching! Thanks so much! Do you have any books or teachings that I can purchase?
Thanks for your comments! Comments like yours really make me happy :). I don't have anything other than what you can find on my channel. I'm working on a new set of tutorials focusing on the Arduino - so you can stay tuned for that. Eventually I will have a website up and running that allows for a bit better explanations of things. No books in the near future though :(
thank you Alexander for this useful tutorial i have learnt alot from it
but i have some problem that i hope you coulde help me with it
it is that when i connect the raspberry with nrf24 i do not use T-cobbler plus
i connected directly to the raspberry pi pins so...
what change will be in the code that is in raspberry pi?? h
T-cobbler does not change anything except it makes it easier for you to understand the pins.
Hello. Is this a process on how to receive data in a raspberry coming from arduino? Does this work if I used xbee pro as a transceiver? Thank you sir
Can these same args work with Tkinter? Also bidirectional communication from Arduino to pi to alter graphics in TKinter buttons or labels?
Anthony were you able to download the stuff we need from the link?
Excellent, thank you Alexander!
+Finn Borge You're welcome! There will be more to come!
Awesome Tutorial! Worked for me for a couple of minutes, but after using ctrl c and rerunning the program, the RPi got stuck after:
PA Power = PA_MIN
I don't know if the Arduino Pro Mini is no longer communicating with the RPi, or if the Python code on the RPi isn't working properly, or what. Potted capacitors are soldered and connecting V+ to GND on both modules. Also, it first worked by powering the Arduino through a usb to serial FTDI, but stopped. I tried powering with 2s lipo battery, and Arduino turns on fine, but still my RPi recieves nothing. Please Help!!
I have gotten it to work one - three times reliably per RPi boot up. Any suggestions to fix this would be much
appreciated!
I have the same problem.
Did you check the wiring on arduino?
hi Alexander Baran-Harper thank u for uploading this video,this was really helpful but i m having trouble with receiving the data sent from arduino to raspbery pi.My arduino is sending and the contents are visibile in serial monitor but raspberry pi is not receiving.The code is stuck in the radio.avaliable function and it is going to continuous sleep.How can i fix this??
Thanks in advance....... :)
Would be awesome if you wrote a tutorial about it at Instructables. Would be alot easier for us to implement, but neverthless, great video. Thank you.
For anyone having the same troubles as me. My raspberry was undervoltaged. I changed the power adapter. It worked
Hi Alexander,
Thanks Alot For great videos and very useful Tutorials...
I, in turn, appreciate your efforts.
Good luck. Comrade.
Hi. I am planning to use that communication to read a value from ultrasonic sensor connected to Arduino pro mini and main issue is to have integer values instead text. How solve that problem?
Did you resolve it ?
I am doing a similar project so I need help
working on a same project, need help
Excellent video. How can I do this communication between raspberry and pic 16f877!! thanks
I am not getting any message in the raspberry pi end. I have done all the things, It is receiving [0,0...] and after that as usual not decoding anything. Can you tell me what is the problem? Mr. Alex.
don't follow the pin setup in this video....I think it shorted out the 3v3 pin on my pi because it wont boot anymore. At around 0:40, the ground is actually connected to the pi's 5V pin.
which could be causing the 3v3 to short^
Can you give a detailed view or steps for connecting multiple arduinos wirelessly with raspberry pi using wifi?
VERY well done! Thank you!
Can we used nrf24l01 instead of NRF24l01+
as long as you match the PIN configurations then it should work!
I get this Error: Message recieved: [128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Anyone know Why?
Other comments fixed it, you have to add a line of code into the lib_nrf24.py file. Just search trough a few comments, the issue has been adressed multiple times.
sir, thanks very much for this tutorial, its helpful
Can this work on rPi 4 B??
Hallo. I did exacltly the same as you but no communication so far. I'm using a RPI 2 and a Arduino Pro Mini 3.3V. Any idea?
Hi, do you mind to tell me how to i enable SPI on Orange Pi One? Thanks!
I have Raspberry pi 3 b+ model. Program ran but didn't transfer any message. Recieved [] and sometimes random values. TX_FULL=1, RX_ADDR is also different from the one I set. Random. CRC Length is showing disabled.Is there a proper solution to this ?
I have the exact same question, do u know how to fix it now?
Thank you, this helps so much.
how to enable CRC please help me when i run code it showing CRC length = Disabled.please help
I have done as instructed and have quadruple checked everything, and I can only get this error code:
File "recv.py", line 11, in
radio.begin(0, 17)
File "/home/pi/Desktop/NRF24L01/lib_nrf24.py, line 373, in begin
self.spidev.open(0, csn_pin)
IOError: [Errrno 2] No such file or directory
Any help would be appreciated. thanks!
For anyone else having this problem, make sure the first parameter of radio.begin() is 0, such as radio.begin(0, 17). Changing 0 to anything else will cause this problem.
Great Stuff! From what I understand , you can then communicate with several arduinos on different channels?
I'm going to get started on something in a few weeks/months - I was thinking of adding authentication with anti-replay too if anyone is interested....
Any commands which affect the physical relays sent from the Pi would not be encrypted, but have a signature appended on the end which would be calculated from a hard coded key + the command. On the receiving side, the Arduino would have the same key and algorithm to check the signature is consistent with the command. To prevent replay of recorded commands, the Arduino would also accept an unsigned command (which the Pi would send before each "Real" command) to transmit a counter. The Pi would then include this counter in the signed command and the signature would be calculated from the command + counter. The Arduino would only accept commands with that counter value and then increment the counter. No two command packets from the Pi would ever be the same. I'd probably implement a counter reset too, but nothing like OTA key updates.
Hello, Thank you so much for the tutorial. I am getting everything except string.
Received: [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 0]
Translating our output into meaningfull way
Our received message decodes to:
So I am not getting the "hello world" message.
Can you please help me with this ??
Thanks in advance
I'm having same problem can you help me out
I just checked and it is ascii in decimal form, so if you convert it into ascii it should work
Great tutorial, but my arduino doesn't seems to be writing the message, it hangs on the
radio.write(&text,sizeof(text));
and in my raspberry I only see
Received: [127, 127, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 127, 127, 127, 255, 127, 127, 127, 127, 127, 127, 255, 255].
Anyone had a similar problem?
+Caetano J I guess the problem is that I need a capacitor, when using an arduino Nano and jumping wires
Connect gnd pin of nrf sensor to pin number 6 not 2
Hi
I am trying to get the RPI part to work but I get the following error on that part:
Traceback (most recent call last):
File "/home/pi/Desktop/NRF24L01/lib_nrf24/recievertest.py", line 29, in
while not radio.available(0):
File "/home/pi/Desktop/NRF24L01/lib_nrf24/lib_nrf24.py", line 523, in available
self.write_register(NRF24.STATUS, _BV(NRF24.RX_DR))
File "/home/pi/Desktop/NRF24L01/lib_nrf24/lib_nrf24.py", line 245, in write_register
return self.spidev.xfer2(buf)[0]
TimeoutError: [Errno 110] Connection timed out
I hope someone can point me in the right direction. My full code is:
import RPi.GPIO as GPIO
from lib_nrf24 import NRF24
import time
import spidev
GPIO.setmode(GPIO.BCM)
pipes = [[0xE8, 0xE8, 0xF0, 0xF0, 0xE1], [0xF0, 0xF0, 0xF0, 0xF0, 0xE1]]
radio = NRF24(GPIO, spidev.SpiDev())
radio.begin(0, 17)
radio.setPayloadSize(32)
radio.setChannel(0x76)
radio.setDataRate(NRF24.BR_1MBPS)
radio.setPALevel(NRF24.PA_MIN)
radio.setAutoAck(True)
radio.enableDynamicPayloads()
radio.enableAckPayload()
radio.openReadingPipe(1, pipes[1])
radio.printDetails()
radio.startListening()
while True:
while not radio.available(0):
time.sleep(1/100)
recivedMessage = []
radio.read(recivedMessage, radio.getDynamicPayloadSize())
print("Recieved: {}".format(recivedMessage))
print("Translating our recieved message into unicode characters...")
string = ""
for n in recivedMessage:
if (n >= 32 and n
Hello, ty for this tutorial, but i have a little problem. When i launch the command "sudo python3 receiv......py" i have too many empty line with our Received Message decode to : "", and sometimes i have Received:[255, 255, 255, 255, 255, 255, 255, 255 ...] Do u have any idea ? Please help me.
i had the same problem before, i found out my rpi to nrf connection is wrong. the gnd of nrf is not connected to 5v of rpi, it should be connected to gnd of rpi
hi Alex
how can i send integer from raspberry pi to the arduino >>>>instead of string
I'd just parse it.
This just doesn't work for me. I've tried it several times now. Also your TX and RX addresses do not match the ones you entered in the python script?
Hey did you find any solution me to stuck like you!!
Hi I think the masted.dev library in github is not present, Could you suggest a solution for this
can u help me to build and access iot cloud from the raspberry pi please
when I connect nrf to pi3 , the pi3 doesn't start
the red and green leds are "on" all the time but no response on the screen
any solution ??
Most probably you connect ground to the second pin instead of 6th, cause in the schema connection there is an error in the video (check pins according to the table) th-cam.com/video/_68f-yp63ds/w-d-xo.html
can someone help i dont get any message printed off everything done the same why
Hi , I followed all your steps and when I run the Python program execution stays stop in PA POWER = PA_MIN . Why?? Thx
The connections and the programs are same as in the video, I don't understand.
I have the same issue. Did you every get yours working?
Can you please tell me how to send sensor readings taken in arduino to raspberry pi ..!
HEMANTH KUMAR MADDI bro did u figure out how? can i refer your code for my current sensor?
Anyone know how many NRFs i can connect to a raspberry pi?
Thanks for the tutorials on the NRF24. Been playing with other libraries, but the libraries you used, and the code demonstrated are much easier to work with. It all makes sense now.The basic scripts on the Pi and Arduino were working with out any issues a few days ago. Now when I run, I get these RuntimeWarning messages. If I reboot the Pi, and run the scripts, the Pi displays the first item transferred, and then nothing after that. If I then hit Ctrl-C to exit the running script on the Pi, then any further attempts running the script generates this error message, and I get no values from the Arduino.
Any ideas? My script is exactly as you have yours, and was working fine a few days ago?
/home/bob/scripts/NRF24L01 $ sudo python recvArduino.py
/home/bob/scripts/NRF24L01/lib_nrf24.py:377: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self.GPIO.setup(self.ce_pin, self.GPIO.OUT)
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe8e8f0f0e1 0xf0f0f0e1e1
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe8e8f0f0e1
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x76
RF_SETUP = 0x01
CONFIG = 0x0f
DYNPD/FEATURE = 0x3f 0x06
Data Rate = 1MBPS
Model = nRF24l01+
CRC Length = 16 bits
PA Power = PA_MIN
Ok, looks like I solved both issues.
To address the "channel already in use" error, I added the following code changes:
try:
while True:
except KeyboardInterrupt:
GPIO.cleanup()
The other issue with only the first transmitted value showing up turns out to have been an issue on the Arduino side. I had the FTDI Friend attached for uploading scripts, but no power running to the RF24 chip. Strange that the chip would send one value and then stop. Once things were properly powered up, everything started working correctly. Note that I am using a Trinket Pro 5V to run everything. So far, everything is up and running again.
rpi to nrf connection is wrong. the gnd of nrf is not connected to 5v of rpi, it should be connected to gnd of rpi. Thanks!
This is not working for me! I am just receiving an array of numbers like this: [128, 0, 0, 0, 0, 0, 0, 0]. Can someone please help me out?
Did you solve your problem? I am currently dealing with it :(
Great Video
Could someone help? Everybody is asking this: Nothing is received after PA_MIN! It only sends once. And then, when I reset, everything vanishes and stops after PA_MIN I’ve read every single comment however, nane of them worked! Please help me!
hi everyone
Recently i´ve been trying to connect my raspberry pi 3+ with arduino nano.
The raspberry pi seems to be working too fast and the message is only elegible in the first number [64,0,0...]
Any idea? anyone can help?
thanks in advance
You connected the the GND wire to the RPI 5V in the diagram!! Ruined my RF module -__-
oh jeez.. of course you should check the pinouts with google.. to prevent other people from this failure, could you just place some text over the wiring diagram? this is easily done in youtube.
now going to wire the ground to the real ground and hope it works.
nicely explained though;)
link doesnot work anymore
i tried it many time but not receiving data any one please help me
Thanks it worked for me
guys, for me it keeps printing an empty recieved message even if the arduino is not connected, I think that it doesn't go into the "while not", does any one know why and whats wrong??!!
Try to connect 4.7 microF capacitor with nrf
@@khaleddarwesh4877 tried, but it didn't help
Thank you!!
Anyone else not able to find the master.zip file?
It says master.zip not found
+Ivan Georgiev Ensure you've typed the link correctly.
github.com/Gadgetoid/py-spidev/archive/master.zip
It works.
Yea it was my mistake thank you really nice tutorial :)
Hi! Sorry to bother you, but I keep getting this error. I did this a while back and it worked, but I don't know what has happened. Everything is exactly the same to the best of my knowledge.
Traceback (most recent call last):
File "sendArduino1.py", line 11, in
radio.begin(0, 17)
File "/home/pi/Desktop/NRF24L01/lib_nrf24.py", line 373, in begin
self.spidev.open(0, csn_pin)
IOError: [Errno 2] No such file or directory
Thanks, have a great day!
Are you using Raspberry Pi 3? If so, make sure SPI is enable. You can enable it under Raspberry Pi Configuration from Preferences (Start Menu).
Thanks for the response, but no, this was not on a raspberry pi. I did, however, just recently acquire one. I'll test it out.
@@InfinityBalance Thank you for this. Saved me alot of time :)))
I had a clean HypriotOS (version of raspbian) and I was missing something python things.
This maybe helpful to somebody else who did not setup python before.
sudo apt-get install python-dev python3-dev gcc python3-setuptools python3-pip
sudo pip3 install RPi.GPIO
Hi there! during the past week i faced a couple of issue with this library(lib_nrf24.py)!! first, CRC Length was always returning disabled. Second, after using a GPiopin as CE(in the tutorial he used the 17) in raspberry(My one is 3plus) i cound't use the same pin again, i simple had to change to gpio 26 or anyother. To figure it out took me some time OMG google was my b*!
-The first issue was solved using the JakFourie advice from github(github.com/nRF24/RF24/issues/485), thank you JakS2
-the Second, (fork me the second!!!!!) this was a bit by my on, using an voltimeter(not required).... Aparently, after the firts time the program runed, it changed the CE pin's state, and when i re-runed the same code it wouldn't work........ To fixed this, i had to add the GPIO.cleanup() with a try block.(raspi.tv/2013/rpi-gpio-basics-3-how-to-exit-gpio-programs-cleanly-avoid-warnings-and-protect-your-pi) but is was not enough........
to killed it once and for all i had to force the CE pin to be GPIO.OUT and change the state to False, just before the radio.begin() method.
i'm using the raspberry 3 plus, i don't know if he is guitty for this issues...
anyway, I hope this helps anyone, carry on!!!! sorry for my bad english
Hey - Im still struggling with my Pi3+... could you post your code somewhere please? that sure would be helpful.. *THANKS!*
@@cyboticIndustries github.com/matmany/lib_nrf24 this is the lib that i`ve changed!!! u can use the same example in the video, just replace the lib_nrf24.py file. Hope it wokes, anything let me know
first of all thank u for your solution, but it didn't help me...Im also using a 3b+, but the radio.available()is always true, even if I connect nothing to the pi. I tried add "self.spidev.max_speed_hz = 100000",nothing changes. This thing is driving me crazy!!Could u help me?
working thanks