geodave 9 Posted December 1, 2013 Share Posted December 1, 2013 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/RF24. Class reference is here: http://maniacbug.github.io/RF24/classRF24.html There is also a newer python library but I haven Quote Link to post Share on other sites
ecrampton 0 Posted December 13, 2013 Share Posted December 13, 2013 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... Quote Link to post Share on other sites
spirilis 1,265 Posted December 13, 2013 Share Posted December 13, 2013 Rx pipe 0 is fine if your module never transmits. It's used to receive autoack packets when using enhanced shockburst in TX mode (1Mbps and 2Mbps only) Sent from my Galaxy Note II with Tapatalk 4 Quote Link to post Share on other sites
geodave 9 Posted December 14, 2013 Author Share Posted December 14, 2013 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. Quote Link to post Share on other sites
ecrampton 0 Posted December 14, 2013 Share Posted December 14, 2013 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 radio.begin(); //radio.enableDynamicPayloads(); radio.setPayloadSize(32); radio.setAutoAck(1); radio.setRetries(15,15); radio.setDataRate(RF24_1MBPS); radio.setPALevel(RF24_PA_MAX); radio.setChannel(120); radio.setCRCLength(RF24_CRC_16); radio.openReadingPipe(1,pipes[1]); radio.startListening(); radio.printDetails(); printf("\n\rOutput below : \n\r"); usleep(1000); } Quote Link to post Share on other sites
ecrampton 0 Posted December 14, 2013 Share Posted December 14, 2013 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... Quote Link to post Share on other sites
geodave 9 Posted December 15, 2013 Author Share Posted December 15, 2013 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/bcm21radio 6 (mosi) to gpio10/bcm19radio 5 (sck) to gpio11/bcm23radio 4 (csn) to gpio8/bcm24radio 3 (ce) to gpio25/bcm22radio 2 (3.3v) to 3.3vradio 1 (gnd) to gnd Get it right or pay the price! spirilis 1 Quote Link to post Share on other sites
bluehash 1,581 Posted December 16, 2013 Share Posted December 16, 2013 @@geodave Happens to the best of us! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.