Jump to content

nRF24L01+, Raspberry Pi, and MSP430G2553

Recommended Posts

I couldn't find an example of someone using the Raspberry Pi as a receiving hub for sensor nodes that use the spirilis nRF24L01+ library and a MSP430G2553. I thought I would give it a shot since I think this would be beneficial to the community. I found a C library for the Raspberry Pi and nRF24L01+: https://github.com/stanleyseow/RF24Class reference is here: http://maniacbug.github.io/RF24/classRF24.html 


There is also a newer python library but I haven

Link to post
Share on other sites
  • 2 weeks later...

Have you gotten this working?  The first thing I noticed on the Raspberry pi side is you are opening the RX pipe on pipe 0.  From what I have read Pipe 0 isn't the as reliable for receiving its better suited to be used as a TX pipe.  Unfortunately I don't have the source for where I read that at, but I would try opening a different pipe.  


Now I have a very similar set up to yours.  I do have it working, but it seems to be dropping a lot of packets on the Raspberry pi side.  I tried using GPIO to attach to the IRQ thinking there was a weird timing issue with the FIFO but that didn't help.  I have tested this with two msp430's and I can go from one side of my house to the other without dropping packets the raspberry pi however is in the same room and its having difficulty receiving all the packets.


If you have made any progress please post it maybe these problems are related...

Link to post
Share on other sites

Sadly I have not gotten it working yet but it is good to know someone has. It just means I am doing something wrong. When I call printDetails() it doesn't show the address or setting that I have specified. I thought it might be the wiring to the pi but I have checked them about 10 times and they are right. Maybe I didn't install and configure the library correctly.  Not sure.


My two MSP430's talk find across the house as well. 


Would you mind posting you MSP430 and Raspberry Pi code? I will load it up and see if I can get it to work and see if it also has packet issues.

Link to post
Share on other sites

I think I see your problem, however I am now having trouble even getting data using my GPIO interrupt on Raspberry pi.  I do have a version that is just like yours without GPIO.  I think I may see your problem when using the MSP430 code the payload is fixed to 32 bytes, but on the raspberry pi you have dynamic payload enabled.  Try this for you Setup().

void setup(void)
	// Refer to RF24.h or nRF24L01 DS for settings


	printf("\n\rOutput below : \n\r");
Link to post
Share on other sites

I am sure this won't help but it seems all I needed to do to get my pi and msp430 talking without any packet loss was I just unplugged the nrf24l01 from the raspberry pi 3.3V and back in and everything seems to be happy and running now. Not sure what I may have done to it, but if all else fails power cycle...

Link to post
Share on other sites

I am embarrassed to admit the my CE and CSN lines were switched. I checked it at least 10 times over the course of two weeks. I guess in life sometime it takes 11 tries. Code works as is! Hopefully this post will be useful to someone. No packet loss. Haven't tested the distance yet. Wiring for the Pi is as follows:


radio 7 (miso) to gpio9/bcm21
radio 6 (mosi) to gpio10/bcm19
radio 5 (sck) to gpio11/bcm23
radio 4 (csn) to gpio8/bcm24
radio 3 (ce) to gpio25/bcm22
radio 2 (3.3v) to 3.3v
radio 1 (gnd) to gnd


Get it right or pay the price!



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...