[Raspberry Pi - Arduino ]Lamp Switch [Raspberry Pi - Arduino ]Lamp Switch[/caption]
A month ago we planned to manage our Arduino irrigator (aka Irrigatorino) through the NRF24l01+ wireless  module. Our little project has been subjected to a little change, since we decided to make our life easier (buahahah…) and remote control a light over a browser (yes, mobile too). Surprisingly, a lot of people liked the little demo I’ve made with some raw code and asked for a tutorial, so here we are:

Ladies and (more probably) Gentleman, I’m glad to present  you the lamp driven by a browser switch!

Nothing new actually, but still exciting!

Arduino Nano 328 connected with NRF24l01+ module and Lamp

Arduino Nano 328 connected with NRF24l01+ module and Lamp (in the background)

Hardware:

To test the wiring we suggest you to use the ping/pong test you can find  in the RF24 libraries (both, of the raspberry and the arduino).

Raspberry Pi

The connection between the Raspberry Pi and the NRF24l01+ module was a little bit tricky, so you have to double ( or triple) check the wiring before giving up. Here is the wiring scheme, the Raspberry Pi is a revision 2, and the module is the + (plus) version.

Raspberry Pi (rev2) - NRF24l01+ Diagram

Raspberry Pi (rev2) – NRF24l01+ Diagram

Arduino

The setup is easy and similar to a mix of our tutorials about Irrigatorino and NRF24l01+ Tests.
Just keep in mind that you are playing with dangerous voltage, so if you get struck, it’s only your fault. I would suggest, anyway, to check if everything (especially the relay board) is working with a multimeter, before connecting to a real lamp.

Arduino Nano - NRF24l01+ - Lamp Diagram

Arduino Nano – NRF24l01+ – Lamp Diagram

Software

Our plan to communicate between all this stuff is to use a Node.js application to run a binary ‘./switch -f On‘ and ‘./switch -f Off‘  sending a message to the Arduino with the text 1 and 0 .
When the arduino receive it, it then sends back an acknowledgment packet to the raspberry with the same message (yeah, like a parrot). In the meantime, if the message the arduino receive is 1  it will close a relay (turning on a light, like a good parrot), otherwise it will open it (I doubt a parrot could be so clever).

Sketching

The sketch for the Arduino Nano is nothing more than a Getting Started demo of the RF24 library. We just modified it to switch the relay on in case it receive a message with 1 as text, or open it otherwise. Of course you’ll need the RF24 library to make it work.

 

Enabling Raspberry Pi GPIO and Installing Node.js

First we enable the Raspy GPIO:

Method 2 (not tested, but should work):

Let’s install node.js.
If you don’t need the latest version you can install it from the repos:

Otherwise you can follow this instructions (under Ubuntu, Mint… section) to compile the latest version.

The Lamp Switch Application

What we need now is to write an application that will send a message to the arduino using the NRF24l01+ and the Raspi. So the first thing to do is download the RF24 library ported for Raspberry Pi.  I would suggest to use git.

Now let’s install the library:

 

And now we create the switch application,which will be the main binary we will use to send message to the arduino.

We compiled the Raspberry RF24 communication module on our Raspberry and you can find it on github:

Or you can compile it by yourself using the cpp file or creating a new file called remote.cpp in the ~/RF24/librf24-rpi/librf24/examples folder and past this code inside:

And now compile the application:

If everything went well you should be able to turn on (and off) the relay at this point using the ./remote -m 1  or 0 application, hearing the famous ‘click’ from the relay board.

We’ve left the debug printout in the code so you can easy arrange a solution in case of some bugs.

The Node.js Lamp Application

At  this point the only thing left is to build a little node.js server and bind a click  on a client browser to an exec function on the raspberry server.

Since it’s more than just a file, we’ve placed  a link to the repository on github. All the code is commented, so I hope everything is clear.

We are using git submodule to add the base node application RemoteRaspberry.  So here is a list of commands to clone the repo:

Anyway, since we were a little bit confused on our first node application we’ve decided to write down a little note to help you understand:

- lightSwitch.js   => is a link to the application  (remote.js) you need to run with “sudo node lightSwitch.js” (the sudo is NEEDED). This is the web server and will launch the client interface too.

- views (folder) => contains the main layout and the basic template.

- routes.js => contains the route to the template.

- RemoteRaspberry (folder) => the basic node app, which contains:

- package.json => required modules (with version) you need to run the application

- node_modules (folder) => it’s an auto generated folder which contains the modules

- public  (folder) => contains remoteClient.js, the javascript code loaded on the client and bootstrap folder for styling

- remote.js => the actual node app

 

To run the application you need to:

 

Authors note (31/3/2014)

We love the way you support each other in the comments! It’s really a satisfaction for us.
We can’t be always here to answer your questions or doubts, and all your contributions are a really great value you add to this website.
Thank you all!

Update  (10/5/2014)

We’ve refined a bit the code, making it more clean and definitely more readable. All you have to do now to add new buttons, is to create a new button in the node app views giving it a data-command tag. The value of that tag will be automagically passed to the old switch -f  binary (now called remote -m). Of course you still need to tell arduino how to interpret the message.  No more c++ recompiling.  Plus, we’ve made the web interface give you a visual feedback when the raspberry receive the ack package from arduino.

Have Fun!

 

 

Comments

109 Comments

Post a comment
  1. Dave #
    July 21, 2014

    Hello and thank you for the great post. I am a newbie to the raspberry pi and arduino, so forgive my lack of understanding. I was able to follow everything until the “To run the application you need to:”. I was able to type “./remote -m 0 or 1″ and turn on and off the light, but I haven’t been able to run the Node.js application. Below are the errors I got.

    #install the dependencies
    cd ~/RF24/librf24-rpi/librf24/examples/LightSwitchInNode/RemoteRaspberry
    ###(((okay, made it this far)))

    #but first clean the npm cache
    sudo npm cache clean
    ###(((at this point I get an error that states, sudo: npm: command not found)))

    npm install
    ###(((i get an error that states, bash: npm: command not found)))

    #run the application
    cd ../
    sudo node lightSwitch.js
    ###(((error, sudo: node: command not found)))

    Any help with these errors would be greatly appreciated.

    Thanks.

    • July 21, 2014

      Hi! It looks like you don’t have node and npm (which is node package manager) installed. Try to install it ( http://joshondesign.com/2013/10/23/noderpi ) and retry.
      So it is like “Hey Npm, clean your cache you dirty!” but no application named Npm is present in your raspy, so raspy says “Npm? Who’s this Npm? I can’t find him.”. Just a little example on how to interpret error messages.
      Let us know how it goes.

  2. Jean-Maurice #
    July 16, 2014

    Hi,

    Thanks a lot for your instructions and script! Everything worked well. I was able to use your script with python using the subprocess.call function and it worked well to send a message from the raspberry pi to the arduino.

    subprocess.call(["./remote", "-m", "0"])

    But I’m not able to use the answer (from the Arduino to my raspberry pi) in my python program. Does anyone know how to read and use the arduino’s message in a python program on the raspberry pi?

    • July 16, 2014

      I’m parsing the output of the c++ program as text with the node application. What exactly your python code does?

      • Jean-Maurice #
        July 18, 2014

        Hi Edoardo!
        Thanks for your interest and help. I got two projets :

        1) Automatic irrigation system: The arduino is connected to the pump and moisture sensor inside. I want to send wireless a command from the Raspberry Pi inside to the Arduino outside to activate the pump. I can do that with your remote.cpp file and it work well:

        subprocess.call(["./remote", "-m", "0"])

        Then I want the arduino to answer with the values of the moisture sensor. But I can’t use these values in my python code, I can received them with your remote.cpp, but I can’t use them in my python program….

        2) Automatic curtain: The Arduino control the motor to open or close the curtain. The Raspberry Pi is connected to internet. I’m able to send the command from the Raspberry Pi to the Arduino, but I want to use the answer from the Arduino to know if the curtain are open or closed.

        So my two projects are working only as a 1 way wireless communication…

        Thanks again for your help, I whish I can share my projet if some people are interested and if it’s working :-)

        Jean-Maurice

        • Neeraj #
          July 19, 2014

          HI Jean-Maurice, I working for complete home automation. Where all the electric goods will be controlled by mobile . same configuration i m using . Rpi+arduino+many sensor+mobile app+ dimmer + web APIs + DVR.

          Also I m thinking about for commercial production if project will be successful ..

  3. keg188 #
    July 13, 2014

    Has anyone got this working on the beaglebone black.

    everything seems fine but i get this:

    Preparing interface
    STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
    RX_ADDR_P0-1 = 0xffffffffff 0xffffffffff
    RX_ADDR_P2-5 = 0xff 0xff 0xff 0xff
    TX_ADDR = 0xffffffffff
    RX_PW_P0-6 = 0xff 0xff 0xff 0xff 0xff 0xff
    EN_AA = 0xff
    EN_RXADDR = 0xff
    RF_CH = 0xff
    RF_SETUP = 0xff
    CONFIG = 0xff
    DYNPD/FEATURE = 0xff 0xff
    Data Rate = 1MBPS
    Model = nRF24L01
    CRC Length = 16 bits
    PA Power = PA_HIGH

    Opening the gates…
    Now sending 1…ok…Got response 4294967295, round-trip delay: 140

    I get the same response when the nRF24L01+ is disconnected

    • keg188 #
      July 13, 2014

      When using the Beaglebone black be sure to use the correct SPI port.
      I now have the remote app compiled and running on BBB.

      Thanks for this guide.

  4. Omer #
    July 10, 2014

    What a wonderful tutorial!
    Very clear explanations – thank you! :)

    • Neeraj #
      July 10, 2014

      You have not faced any problem in implementation ???

      Can you please help me . I am getting below error.

      Preparing interface
      SPI device = /dev/spidev0.0
      SPI speed = 8000000
      CE GPIO = 25
      STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
      RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
      RX_ADDR_P2-5 = 0xe2 0xe3 0xe4 0xe5
      TX_ADDR = 0xf0f0f0f0e1
      RX_PW_P0-6 = 0×20 0×20 0×20 0×20 0×20 0×20
      EN_AA = 0x3f
      EN_RXADDR = 0x3f
      RF_CH = 0x4c
      RF_SETUP = 0×07
      CONFIG = 0x0f
      DYNPD/FEATURE = 0×00 0×04
      Data Rate = 1MBPS
      Model = nRF24L01+
      CRC Length = 16 bits
      PA Power = PA_MAX

      Opening the gates…
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.

      • Jean-Maurice #
        July 16, 2014

        Hi Neeraj,
        I got the same problem. In my case, it was a power problem. I solved it by connecting a .1uF to 10 uF (MicroFarad) capacitor between the module and the arduino (and also between the module and the raspberry) from +3.3V to Gnd (Watch + and – !)

        You can have more details in the “power problems” section of this website
        http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

        Cheers!

        • Neeraj #
          July 19, 2014

          Thanks ……………..

  5. wpk78 #
    July 8, 2014

    Super.

    Zadzialalo za pierwszym razem (It worked for the first time)

    • Neeraj #
      July 10, 2014

      You have not faced any problem in implementation ???

      Can you please help me . I am getting below error.

      Preparing interface
      SPI device = /dev/spidev0.0
      SPI speed = 8000000
      CE GPIO = 25
      STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
      RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
      RX_ADDR_P2-5 = 0xe2 0xe3 0xe4 0xe5
      TX_ADDR = 0xf0f0f0f0e1
      RX_PW_P0-6 = 0×20 0×20 0×20 0×20 0×20 0×20
      EN_AA = 0x3f
      EN_RXADDR = 0x3f
      RF_CH = 0x4c
      RF_SETUP = 0×07
      CONFIG = 0x0f
      DYNPD/FEATURE = 0×00 0×04
      Data Rate = 1MBPS
      Model = nRF24L01+
      CRC Length = 16 bits
      PA Power = PA_MAX

      Opening the gates…
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.
      Failed, response timed out.
      Now sending 1…failed.

  6. Neeraj #
    July 6, 2014

    We are getting below error . I have rechecked all the connection and libraries . Might be some problem in GPIO pin setting and status . Please help is anybody has resoled the problem .

    Preparing interface
    SPI device = /dev/spidev0.0
    SPI speed = 8000000
    CE GPIO = 25
    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
    RX_ADDR_P2-5 = 0xe2 0xe3 0xe4 0xe5
    TX_ADDR = 0xf0f0f0f0e1
    RX_PW_P0-6 = 0×20 0×20 0×20 0×20 0×20 0×20
    EN_AA = 0x3f
    EN_RXADDR = 0x3f
    RF_CH = 0x4c
    RF_SETUP = 0×07
    CONFIG = 0x0f
    DYNPD/FEATURE = 0×00 0×04
    Data Rate = 1MBPS
    Model = nRF24L01+
    CRC Length = 16 bits
    PA Power = PA_MAX

    Opening the gates…
    Now sending 1…failed.
    Failed, response timed out.
    Now sending 1…failed.
    Failed, response timed out.
    Now sending 1…failed.
    Failed, response timed out.
    Now sending 1…failed.
    Failed, response timed out.
    Now sending 1…failed.
    Failed, response timed out.

    • Suresh #
      July 28, 2014

      Hey Neeraj,

      I am facing the same problem. I tried the eample code with RF24 lib rpi-hub and pingtest(Arduino) they work fine.
      In case you found a solution, please help me with what worked for you.

      Thanks.

  7. Binh #
    June 12, 2014

    Hi Edoardo,
    How to encrypt string sender side and decrypt receiver side?

  8. FJaskolski #
    June 12, 2014

    Hello there! I am in the middle of nowhere, trying to make Atmega8A and RPi talk to each other with a help from NRF2401A.

    The thing, that troubles me the most is slightly different architecture of my radio modules (provided by local company). I found similar ones within SparkFun resources: https://www.sparkfun.com/products/152 . I also figured out how to use “DATA” pin (according to Nordic sheets, you just plug it to both MISO and MOSI pins through a 10k resistor).

    Knowing all this, I still cannot establish a working connection. The rpi-hub example gives me “Recv: size=127 payload= pipe=7″ no matter what. I thousand-checked all the hardware, and I am pretty certain about software on Atmega side.

    Could you please give me any hints on porting your library to NRF2401A modules? Is there something I can do to determine the centre of the problem?

    Cheers

  9. Kiaran #
    June 5, 2014

    Good day,
    First of all, great tutorial, I have it working using “./remote -m 1″, however, as soon as I type “sudo npm cache clean” or “npm install” I get the message “npm: command not found”. Any suggestions?
    Thanks in advanced.

    • Kiaran #
      June 16, 2014

      Got it working, installed npm a different way. Works perfectly. Thanks for sharing this

  10. Stephan #
    June 1, 2014

    Sorry, don’t know how to paste html code…testing

    in light.handlebars i add a checkbox and a slider:

    label style=”width:120px;”>PowerPowerFade</div

  11. Stephan #
    June 1, 2014

    Hi,

    i like your project very mutch and i want to use it for me.

    After i get it to run, i want to implement a toggle button and a slider control based on jquery into the page and it still does not work.
    In another project it worked fine.

    Heres my code:

    in light.handlebars i add a checkbox and a slider:

    //Power
    //
    //Power

    //Fade
    //

    in remoteClient.js i add a new function called initControls and call it from windows.onload function:

    function initControls(){
    // change checkbox to button
    $(“#power”).button();

    // define the slider
    $(“#slider”).slider({
    min:0,
    max:255,
    value: 0
    })
    }

    When i start now the app, the button is shown as a checkbox and the slider i can’t see (but is included in page).

    I’m new in javascript, jquery and node.js, can you help me with this problem. in another app (also node.js based) i do this by the same way,
    but there i have a html file with all the code in it and not separated.

    Sorry about my english…

    Greets from Germany
    Stephan

  12. Jody Roth #
    June 1, 2014

    I had my nRF24 modules working on the library examples and wanted to try out your web-controlled lamp version to learn a bit about the IoT side of things. Everything worked well except installing Nodejs required me to use the Adafruit site instructions at :https://learn.adafruit.com/raspberry-pi-hosting-node-red/setting-up-node-dot-js

    Thanks for putting this information onliine. Your tutorial is very well done!

    An additional feature request: Instructions to make the web page available via the internet rather than the local network. At least, that is what I’m off to find now.

    • June 8, 2014

      Hi! Glad you liked it! To reach the app from the internet: register no-ip account, install noip2 client on raspberry, log on the noip2 client with you credentials, open the choosen port on the router .
      Ex: if 192.168.1.2:3000 is your app raspy port, then you should open port 3000 on the router telling him to send connections on 192.168.1.2 on port 3000. You will then be able to connect on example.no-ip.org:3000.

    • xmh #
      June 10, 2014

      Wprogram.h is a header file from version of Arduino’s IDE earlier than 1.0.
      It’s now included in Arduino.h, so it’s common error when compiling sources from github. ;-)

  13. May 30, 2014

    when i build file c++ , it had a error: Wprogram.h no such directory. I have check All file of RF24, but I didn’t find Wprogram.h. Can you give me hand. Thank you.

  14. Binh #
    May 28, 2014

    Hi Edoardo Odorico,
    I’m trying to communicate and pi pic, but I have yet to communicate. Pic of the pipe address is 0x3f
    Pic is receive.
    Rpi is send.
    Can I use address pipe 1 bytes for Rpi?
    Ex: const uint64_t pipes=0x3F;
    https://drive.google.com/file/d/0B8OGy7vP_4y_TWJpOEhkSDNnTHc/edit?usp=sharing
    When I run the file rpi-hub model is nRF24L01, not nRF24L01+. I use IC as in your picture.
    This is 3 times test my rpi-hub, receive alway =ỹỹỹỹỹỹỹỹỹ…:
    https://docs.google.com/file/d/0B8OGy7vP_4y_SFp3RXVCWkZ2dUU/edit
    https://drive.google.com/file/d/0B8OGy7vP_4y_WXFsMThQenRqMTg/edit?usp=sharing
    https://drive.google.com/file/d/0B8OGy7vP_4y_RF8ydVBmd0h5amM/edit?usp=sharing
    Sorry for my english level.

    • June 8, 2014

      I’m sorry, would you explain it more clearly? I don’t understand your questions. Looks like you are trying to send a picture, maybe? I don’t think the plus sign is really a problem.

  15. May 20, 2014

    Nice work guys this is exactly what i am looking for at the moment. I have it working with a Pro Mini embedded within a light switch. However when i try to run it as a service i keep getting errors which i believe are related to file paths.

    Being a bit of a noob in the Linux area i’m fumbling my way through but cant seem to work out how to resolve the issue. I’ve tried using /etc/init.d creating a service and also trying to run it using “forever”. I’ve messed about with the path variables but it only ever works if ran using the command as described in the post from the LightSwitchInNode folder.

    Does anyone have any thoughts as to where i’m going wrong?

    Thanks

    • May 21, 2014

      Since I would like to have a kind of log of what I’m doing, I made it run on a screen instance.
      So:
      1- create a file called bootScript.sh, write inside:
      !/bin/bash
      cd /home/user/folderOfNodeApplication/
      sudo node remote.js

      and give it exec permissions (chmod +x)
      2- Write inside /etc/rc.local this:
      su -c 'screen -d -m -S lightApp /home/user/folderOfTheScript/bootScript.sh'

      3- reboot. You should now be able to acces the screen with the app running by going on sudo (sudo su) and then writing:
      screen -r lightApp

      • May 21, 2014

        Awesome, Works perfectly… Once I realized I had to install “screen”.

        Thanks

  16. May 9, 2014

    AFTER ADD LIBRARY RF FOR ARDUINO. I PASTE ALL COMMANDS IN SECTION “SKETCHING” INTO ARDUINO SOFTWARE. WHEN COMPLIE, PROGRAM HAVE ERRORS:
    1. printf.h:no such file or directory
    2.many many errors

    • May 9, 2014

      First, as you may know caps lock is equivalent to yell, and this is not a nice behaviour while asking help.
      For what concern you errors, the first usually happen when your arduino IDE is unable to find the printf library, check at beginning for the include.
      About the other errors, we recently used the same code to prepare another arduino, and everything worked flawlessy. Maybe you should send us the error.

      Have a nice day.

      • May 9, 2014

        I’m sorry about my behaviour. Thanks for your help. how to overcome about error “printf”. I have not understood how to check at beginning for the include. About 1 month ago, I have added printf library for arduino. If you have a printf library to surmount this error, Can you give me it? Thanks a lot.

        • May 9, 2014

          file switch.cpp. How to make it? Write on Rasp? thank you

          • Mohit #
            May 9, 2014

            If you have added the printf library to the Arduino IDE, just make sure the printf code is open in the IDE.

            Switch.cpp is to be compiled on the Pi .. follow the instructions in the blog post …

          • May 9, 2014

            Mohit#
            Comply error in sketch in Arduino, error about printf. IDE belongs to Raspberry. if you have a printf library. Can you send me a link to download. I have also a question. What program do we use to make Switch.cpp

          • May 9, 2014

            Here you can find all the informations needed for the printf library http://playground.arduino.cc/Main/Printf
            To write Switch.cpp code you can use whatever text editor you prefer (vim, emacs, sublime, nano… even, not recommended, Word)
            Just save the file with .cpp extension and compile it.

          • May 9, 2014

            thank you
            Edoardo Odorico #

          • May 9, 2014

            printf_begin is not decalred. I don’t know why?

  17. Matteo #
    May 1, 2014

    Hi, anyone know how can send string, and not only int?

    Thanks a lot!

    • May 8, 2014

      We are sending integers because it’s faster. I think that if you need to send a text you can just wrap it up in double apexes.
      Remember to double check types, since you are in C (like done = radio.read( &message, sizeof(unsigned long) );)
      Plus, don’t forget you have to compare strings instead of integers -> http://www.wikihow.com/Compare-Two-Strings-in-C-Programming

  18. Björn #
    April 18, 2014

    Hi, I’m pretty new on the linux environment and not sure what I’m doing. I’ve tried to use the guide but I’m getting the following error when trying to compile the switch program:

    pi@greenhouse ~/RF24/librf24-rpi/librf24/examples $ sudo g++ -Wall -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -L../librf24/ -lrf24 switch.cpp -o switch
    /tmp/ccm241WK.o: In function setup()':
    switch.cpp:(.text+0x14): undefined reference to
    RF24::begin()’
    switch.cpp:(.text+0×24): undefined reference to RF24::setRetries(unsigned char, unsigned char)'
    switch.cpp:(.text+0x30): undefined reference to
    RF24::setChannel(unsigned char)’
    switch.cpp:(.text+0x3c): undefined reference to RF24::setPALevel(rf24_pa_dbm_e)'
    switch.cpp:(.text+0x48): undefined reference to
    RF24::setPALevel(rf24_pa_dbm_e)’
    switch.cpp:(.text+0×58): undefined reference to RF24::openWritingPipe(unsigned long long)'
    switch.cpp:(.text+0x6c): undefined reference to
    RF24::openReadingPipe(unsigned char, unsigned long long)’
    switch.cpp:(.text+0×74): undefined reference to RF24::startListening()'
    switch.cpp:(.text+0x80): undefined reference to
    RF24::printDetails()’
    /tmp/ccm241WK.o: In function switchLight(int)':
    switch.cpp:(.text+0xa8): undefined reference to
    RF24::stopListening()’
    switch.cpp:(.text+0xc8): undefined reference to RF24::write(void const*, unsigned char)'
    switch.cpp:(.text+0xe0): undefined reference to
    RF24::startListening()’
    switch.cpp:(.text+0xe4): undefined reference to __millis'
    switch.cpp:(.text+0xf4): undefined reference to
    RF24::available()’
    switch.cpp:(.text+0×134): undefined reference to RF24::read(void*, unsigned char)'
    switch.cpp:(.text+0x138): undefined reference to
    __millis’
    switch.cpp:(.text+0×154): undefined reference to __msleep'
    switch.cpp:(.text+0x158): undefined reference to
    __millis’
    /tmp/ccm241WK.o: In function _GLOBAL__sub_I_radio':
    switch.cpp:(.text.startup+0x1c4): undefined reference to
    RF24::RF24(std::basic_string<char, std::char_traits, std::allocator >, unsigned int, unsigned char)’
    collect2: ld returned 1 exit status

    Any ideas what I’ve missed? Using 2014-01-07-wheezy.raspian

    • May 8, 2014

      Hi,
      looks like you are missing the RF24 library, since all the missing functions refer to it.

      • Anders #
        May 28, 2014

        I have the same problem. I had it working compiling just fine. Then one day it just started spitting out the same errors. I have RF24.h in place, I’ve even reinstalled the RF24 library a couple of times with no success.

        I can not figure out what’s wrong. (I’m a raspberry and linux beginner).

  19. Mohit #
    April 18, 2014

    Hey Guys,

    I’m building a system where my Pi (central unit) needs to connect to multiple Arduinos wirelessly.

    So I have one Pi and 3 Arduinos set up.

    Each Arduino has a variable called ID to help identify it.

    If my Pi want to talk to Arduino with ID = 1, it will send a message with the format : 1XXXX
    If it wants to talk to Arduino with ID =1, the message sent out will be : 2XXXX

    Even though all units are kept in the same room for now, I’m noticing major packet drops.

    One of my observations is this : when the Pi transmits, all the Arduinos receive, but if the ID does not match, they do nothing, only the Arduino with the correct ID will give an Acknowledgement back, but it turns out the Pi does not receive the Acknowledgement.

    What I can’t figure out is, whether my modules are faulty, or are they not designed to work this way ..??

    Thanks !

  20. sid #
    April 18, 2014

    Hi Edoardo,

    I have implemented this for a home automation system.
    This works but the problem is it works intermittently.

    At times it works really smooth.
    The next moment it stops working.
    After some investigation I found that the NRF24l01 on arduino receives the request works on it and sense the response back to NRF24l01 on raspberry. But the raspberry is not able to receive it resulting in packet drops.

    It enters the following part of cpp code

    while ( ! radio.available() && ! timeout ) {
    __msleep(100);
    if (__millis() – started_waiting_at > 1000 )
    timeout = true;
    }

    As radio.available never becomes true this thing times out.
    I increased the delay to 100 from 10 to give NRF24l01 on rpi time to find data sent from arduino, but that didn’t help.

    What surprises me is even the switch is not toggled by arduino.
    Range can’t be an issue as arduino and rpi are in same room.

    Can you please tell me what is the problem here.
    Is it the NRF24l01? Is it faulty?
    Or do i need to add anything in the code?

    • May 10, 2014

      Sorry for the delay, it has been a very busy period.
      Don’t know actually what could be the problem . I didn’t have any kind of problem like your.
      Before editing the code, since everything is working fine for me, I would suggest:
      1- double check wires (it happened to us faulty cables drive crazy)
      2- check the modules (they are really cheap and it’s always good to have one more for backup)
      3- check the arduino (it happened to us to lose a whole day with a broken arduino… )
      4- do not place the arduino nor the transmitter near wifi routers (same frequency 2.4GHZ)

      Let us know.

  21. Oscar #
    April 15, 2014

    Hi. Thanks a lot for sharing your jobs. I’ve done your project, in order to test miself!!. But now I have to implement my own solution. I want to control some blinds, each one with an arduino one, with a raspberry pi. But my problem is that I’m gonna use some wall blind switch. So I would need to transmit with the arduino to the raspberry when the switch its been activated, in order to memorize the new blind position on the raspberry. My first solution to do that it’s to have two different programs on the raspberry: One always running, just to listen when some arduino sends info to the raspberry with his new position. And another one program to control the blinds movement from remote.
    Do you think that’s a good solution?? Maybe I could have some collission problems when both programs will be running?
    Thanks a lot for you help

    • April 15, 2014

      Hi Oscar,
      hopefully I’ve understood the problem, please correct me if I’m wrong.
      Since you are sending a message to the arduino, I suppose that the message is different when opening and closing the blinds.
      Said that, the arduino actually replies with the same message you’ve sent (ack package) when he receive the message correctly.
      Now, your raspberry know that your blind is being opened and can hold and manage this information. The same happen when you are closing the blinds. What you might to achieve is to have a “callback” when the blinds are effectively closed. Without creating two programs, you could use the same, given the fact the opening/closing the blinds will be eventually a locking command during all the time of the operations. Which means that when you are opening the blinds you can’t turn the lights on, for instance. This solution simply tell the raspberry to ping the arduinoBlinds every 5 seconds after you’ve pressed the action and send a message, like “What are you doing?” and he answers: 00) Closed .10)I was open and I’m closing .01) I was closed and I’m opening. 11) I’m open. When the raspberry receive the last command it will stop to ping.

      Let’ make an example.
      Raspberry knows that arduBlinds is 00 (Because of a ping or a previous known state saved, for instance, on a db). So Raspberry tells him “11″. Then Raspberry start to pings arduBlinds with “What are you doing?”. At first the arduBlinds will say “01″ for the time it is opening the blinds and then, when finished, it will say “11″. At this point Raspberry stop to ping.

      I don’t have libraries with me, but I suppose you have to switch mode from listening to sending.

      Let me know.

      • Oscar #
        April 15, 2014

        Thanks for your time, unfortunately I don’t explain myselfarruinó. nk I can write all the process between arduino and the raspberry. My problem is when I use the wall switch, not via the raspberry. Every blind has it’s own switch, connected to the arduino to avoid conflict between switch and online orders. So, if I act the switch, the arduino can send a message to the raspberry with the new blind position. But then I need to Have the raspberry always listening for a message from the arduino ? . and another program to operate the blinds ‘online’??. Thanks a lot again

  22. Mohit #
    April 10, 2014

    I’m connecting the transceiver to an Arduino Mega and it stops working … I connect it to the Uno and it works … any ideas ?

    • Mohit #
      April 10, 2014

      Ooops … turns out SPI connections on MEGA are different …

  23. Evan #
    March 31, 2014

    Hi,

    I’ve gotten to the point where I need to compile where I need to compile the application, but I get errors:

    pi@raspberrypi ~/RF24/librf24-rpi/librf24/examples $ sudo g++ -Wall -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -L../librf24/ -lrf24 switch.cpp -o switch
    switch.cpp:2:1: error: stray ‘\302’ in program
    switch.cpp:2:1: error: stray ‘\240’ in program
    switch.cpp:15:45: warning: extra tokens at end of #include directive [enabled by default]
    switch.cpp:15:46: fatal error: ~/RF24/librf24-rpi/librf24/RF24.h: No such file or directory
    compilation terminated.

    Any ideas? the “RF24.h” file is in the directory it says it is not.

    Thanks!

    • Mohit Athwani #
      March 31, 2014

      Hey Evan,

      Stray \302, \240 could be some issue with copy pasting code (not sure though)

      About the extra toke, get rid of the semi-colon “;” at the end of line 15 of your code …

      I put my code in the examples folder in the RF24 directory and it worked fine …

  24. March 30, 2014

    Hi! I know this is somewhat off topic but I was wondering if you knew where I could find
    a captcha plugin for my comment form? I’m using the
    same blog platform as yours and I’m having trouble finding
    one? Thanks a lot!

  25. March 16, 2014

    Awesome tutorial ! But sadly I cannot get it to work :(

    I’ve checked, double checked and triple checked the connections.

    Out put on my Arduino Uno is :


    Light Switch Arduino

    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
    RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
    TX_ADDR = 0xf0f0f0f0e1
    RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
    EN_AA = 0x3f
    EN_RXADDR = 0x03
    RF_CH = 0x4c
    RF_SETUP = 0x07
    CONFIG = 0x0f
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 1MBPS
    Model = nRF24L01+
    CRC Length = 16 bits
    PA Power = PA_HIGH

    And out put on my Pi is :

    Preparing interface
    SPI device = /dev/spidev0.0
    SPI speed = 8000000
    CE GPIO = 25
    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
    RX_ADDR_P2-5 = 0xe2 0xe3 0xe4 0xe5
    TX_ADDR = 0xf0f0f0f0e1
    RX_PW_P0-6 = 0x20 0x20 0x20 0x20 0x20 0x20
    EN_AA = 0x00
    EN_RXADDR = 0x3f
    RF_CH = 0x4c
    RF_SETUP = 0x07
    CONFIG = 0x0f
    DYNPD/FEATURE = 0x00 0x04
    Data Rate = 1MBPS
    Model = nRF24L01+
    CRC Length = 16 bits
    PA Power = PA_MAX

    Turn it ooooon!
    Now sending 1...ok...Failed, response timed out.
    Now sending 1...ok...Failed, response timed out.
    Now sending 1...ok...Failed, response timed out.
    Now sending 1...ok...Failed, response timed out.
    Now sending 1...ok...Failed, response timed out.

    Can’t figure out what’s going on …

    • March 17, 2014

      [UPDATE]
      Woke up today morning and tried it again, and guess what the 2 devices communicated.

      So I kept on playing with the on/off commands and noticed that communication is never 100% … can anybody comment on the success rate ?

      • March 22, 2014

        Hi Mohit!
        We are happy that you finally managed to make them communicate! We did have the same problems, which turned out it was just a matter of clean implementation and wiring.
        About the succes rate, we’ve found that turning on the light in the same room as the Raspy was almost instantaneous. Maybe you have some device which is generating some intereferences with your modules. Remember that the frequency is 2.4 Ghz, which is the same as wifi and microwave oven (and some other devices). Try to change channel frequency and, if you are brave enough, have a look at some antenna mods you find around for 2.4ghz (remember I’ve seen this module with an antenna mod too).
        Let us now how it goes!

    • Jemson #
      May 10, 2014

      I have the same issue here. Maybe 1 in 50 attempts will actually succeed.
      Have tested at millimeters apart as well as a few meters.
      Also disconnected all 2.4GHz devices (WAP, Cordless phone etc) as well as checked, checked and rechecked the pinouts and it still won’t work consistently. Have also tried a second Nano, and also replaced the NRF24I01+ at both ends.
      Only thing I haven’t replaced is the Pi itself, but have tested the SPI by looping it back and that works fine.

      At a bit of a loss as to why it won’t work. Only thing I can think of is to start again, reimport libraries and reimage the SD on the Pi in case there is any sort of conflict.

      If anyone else has any other suggestions I will be happy to hear them.

      • Jemson #
        May 10, 2014

        So I went ahead and recreated the config and had the same issue, but stumbled across the cause of the issue by dumb luck on the pingpong test.
        Seems if I am connected to the serial interface of the Arduino tests fail, however, if I am not connected it all works fine.
        I will try and dig into why, but at least it is working for now. If I can’t fix it, it will make debugging other issues a little harder but I can live with that.

        • May 10, 2014

          Hi!
          I would suggest a possible cause.
          Recenlty we were working on a project with 433MHZ module. We needed to listen carefully the waves received from another Arduino with the TX module. I noticed that when connected to the computer the received message was a lot disturbed by the dirty DC passed with the USB cable (even if the computer was on battery), but when the tx arduino was attached to a 12v battery, then the received signal was really clean.

          That said, since I didn’t find this problem with my computer nor the raspberry or the chinese usb adapter the arduino is powered by, you could try attach the arduino to a normal usb adapter and the raspberry too.

          Let us know how it goes.

  26. Ishu #
    March 14, 2014

    So, I have competed a complete working automation solution using same hardware … any advice as to how i should publish it. should i licence it or something .. I’m new to the field.

    • March 16, 2014

      Hey Ishu ,

      since you got it working, maybe you can help me out with my problem above ?

      Thanks,

      Mohit

  27. Mar #
    March 12, 2014

    Hi,
    thanks for this great project. I succeed with it. But I have one strange behaviour. I succeed to send the on (1) and off (2) to arduino from Raspberry Pi. But when the Raspberry Pi get back the response it never receive the same information. I would expect that when Raspberry Pi send “1″ to arduino then arduino send back again “1″. But I never get this back on Raspberry Pi. I always get some different strange number (0, 1678878, 245584 etc…) but never 1. I also tryed to send same static number from the Arduino to Pi but I never receive the correct number on Pi. Do you have any idea where could be the problem?

    Thanks.

    • May 10, 2014

      Usually wiring bugs give this error. Double check the RF24 library installation (link in the article)

  28. Hduque #
    March 2, 2014

    Hi

    I am no able to get it work yet. May be could be for this (like luke previous comment):

    pi@raspberrypi ~ $ sudo ldconfig -v | grep librf
    ldconfig: Path /lib/arm-linux-gnueabihf' given more than once
    ldconfig: Path
    /usr/lib/arm-linux-gnueabihf’ given more than once
    librf24.so.1 -> librf24.so.1.0

    Can you help me please? am i missing something?

    thanks in advance

    • March 2, 2014

      ldconfig is telling you he has already found other /lib/arm-linux-gnueabihf and /usr/lib/arm-linux-gnueabihf libraries link.
      Have you tried to move on the next step?

      • Hduque #
        March 2, 2014

        Hi

        Thanks for your quick response.

        Yes, i have moved to the next steps. I have test “sudo ./switch -f on” and i get “Failed, response timed out”.

        I have double check the connections, but it is ok. Maybe my problem is in the Arduino side (i have use Arduino uno). Right now, the Arduino sketch is showing a message when is compiled, it says “printf_begin was not declared in this scope”.

        I have run the scanner to, and it shows something like this:

        “000000000000000011111111111111112222222222222222333333333333333344444444444444445555555555555555666666666666666677777777
        0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567
        000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000″

        I am really sure that i am doing something wrong, but i can`t figure what.

        If you can give me some tips i’ll really appreciate and i wil try to get it work.

        Thanks again.

        • March 3, 2014

          Have a double check at the wires first. We’ve exchanged pins so many times! We have a UNO around, so if you want we can have look. I don’t see the point why it should not work anyway. Keep in mind that we are planning a huge step up on this project in the next months. Plus, we have to work too :D So we’ll not have so much time to support all the requests of help we receive. Said that, since we would have really appreciated an help from someone who finally made it, we’ll reply as soon as we can, trying to keep everything updated.
          Have a nice day!

          • Hduque #
            March 3, 2014

            Ok.

            I will check again the wires and the pins, and i let you know how it goes.

            Thanks again for your replies.

          • Hduque #
            March 4, 2014

            Hi Guys

            Finally it’s working. Apparently the problem presented by the RF24 library was corrupt. I downloaded again and upload the sketch to the Arduino again, and it worked.

            About the printf_begin problem, what i did, was open the printf.h file in the arduino IDE, and the sketch at the same time. Upload the sketch and the message disappear.

            Thanks a lot for yur help.

  29. Ishu #
    March 2, 2014

    great project guys,
    i have tried it myself and am wondering if it possible to run “./switch -f on” through php execute function.
    Thank you in advance.
    keep up the good work.

    • March 2, 2014

      I think you can use it with exec(). Not sure though if you can run it with sudo.
      Have a nice day!

    • Mar #
      March 12, 2014

      Hi Ishu, I succeed to run the switch through PHP script using the exec() function and also .sh file in between the switch and PHP script. Part on which I spend the most of the time was correct rights of all the files and also the fact that I succeed only in case that www-data account has been set to work without password. PHP script then run the .sh file with one parameter which can be then passed to switch -f . When switch example is slightly modified then it can sand many kinds of commands to arduino. If more info neede let me know and I can add some more tips.

      Then I would also like to thanks for this great project.

  30. JuanMi #
    February 28, 2014

    Hi there!

    Thank you guys for this fine article! It helped me a lot! I am involved in a project concerning Arduino and RPi communication and I suceeded connecting both.

    The starting point was your example code which I modified to my needs. It worked at (just) the second try! :).

    Again, thank you for sharing,

    JuanMi

    • February 28, 2014

      You’re welcome!

      • GG #
        May 5, 2014

        Me too. Awesome – opens up lots of possibilities. Thanks!

  31. Tom #
    February 27, 2014

    Hi. Great project, thx! I have done everything and now i can switch one relay from Pi :) I’m trying to add some line to turn on second relay on board but need some help. Could You guys give me some tips? How should Arduino Sketch and switch.cpp looks like? Thank You :)

    • February 28, 2014

      Holaaaa Tom!
      You need to pass a different message to arduino for each relay you want to switch.
      Let’s say “1″ is “turn on the R1 (relay 1)” and “3″ is “turn on the R2 (relay 2)”.
      Remember you need a message to turn them off too. So, you’ll define “0″ as a message to turn off R1, and “2″ to turn off R2.
      With this pattern you’ll have all couples, with a pair and an odd number. The pair switch off, the odd switch on.
      Like this:
      R1 | R2 | R3
      —————————
      0 – 1 | 2 – 3 | 3 – 4
      off-on | off-on | off-on

      We are working on something similar, but more “modular” on our side. More in the next week!

  32. luke #
    February 18, 2014

    hi *,

    maybe someone can help me. i dont get it. i suppose, that may this is the reason:

    pi@raspbmc ~$ sudo ldconfig -v | grep librf
    ldconfig: Path /lib/arm-linux-gnueabihf' given more than once
    ldconfig: Path
    /usr/lib/arm-linux-gnueabihf’ given more than once
    librf24.so.1 -> librf24.so.1.0

    i also checked “sudo modinfo i2c-dev”, witch results in “module i2c-dev not found”.

    any ideas?
    thnx & regards

  33. Camillo #
    February 10, 2014

    Hi, great tutorial and project!
    I am wondering if it is possible (and how!!!) to power the arduino part on a battery or coin cell and make it live for about an year or so.
    Thank you!
    Camillo

  34. kevingmgb #
    February 1, 2014

    Hey,

    I think this is a great project. I am working on a project that would send text from tweets from the pi to an arduino with an lcd screen using the nrf24l01. Every example I find out there for the pi is sending numeric information. I saw the serialchat example in the arduino and I am having a tough time replicating something similar to send a string across the radio. Anyway you could point me in the right direction?

    Thanks!

    • February 11, 2014

      I think you should try send strings directly. Unfortunately don’t have the time to try it.

  35. kg77 #
    January 26, 2014

    Hi,
    I’m begginer in this technology…
    Is the revision 2 of Raspberry Pi really importent? RPiV1 and V2 functions of used GPIO pins are the same.
    I’ve RPiV1. Everything (preparation, and compilation are OK) but unfortunaltelly I’ve problem after run:
    ./switch -f on
    Preparing interface
    Segmentation fault

    Do you think that it is because of Raspberry revision?

    Regards
    Chris

    • January 26, 2014

      Hi! I’m on my phone, but at first shot I think you are missing a sudo before the command. Using gpio requires sudoers privileges. Have a nice day.

      • kg77 #
        January 26, 2014

        Exactly. Now it’s OK. Thx :)

  36. January 9, 2014

    Its a wonderful project and has a huge potential, I am from India, I am working on the same kind of project. Your project is a great help to us, My question is can we use nRF24LE so that data sent can be encrypted and to avoid arduino nano. Thank you once again for the resources.

    • Lorenzo Farnararo #
      January 9, 2014

      I digged around and I found some material to work on. First of all I wuold use AES simmetric key to do the job. Here some reference to a library written for NRF24LE1.
      I don’t understand why the WiFi module alone… if you want to explain us you project or link something we would be grateful!

      • January 9, 2014

        I don’t understand why the WiFi module alone… if you want to explain us you project or link something we would be grateful!

        Indeed, I don’t understand neither :D . That module (the NRF24LE1) doesn’t seems to have a micro-processor you could use as an arduino’s one. Plus,I think that if you would use it for encryption it would be better to keep it separated from other calculus, which right now belongs to arduino.

        If we’ve misunderstood please correct us, since we are looking for an “encrypted” solution too.
        Have a nice day.

  37. November 10, 2013

    Hi, really cool project you have there!..

    ref:
    http://arduino-for-beginners.blogspot.com/2013/02/setup-nordic-nrf24l01-rf-modules-to.html?goback=%2Egde_1268377_member_217339050#%21

    I’ve been working with the same project for the past 2 months and got the rpi and the arduino uno talking to each other via the RF24 unit(s). I also managed to get some PHP + MySql codes working to turn the relay OFF @ ON respectively.

    But the only thing that halted my project is the RF24 security, which if i’m not mistaken, transfers the data forth and back in plain form. I thought that it would be ‘dangerous’ if someone could just send a forged packet and my arduino would blindly accept it. So I’ve been googling around for a library that could be used both in RPI & Arduino Uno to encrypt the packets with no luck.

    So does the RF24 unit has any security implementation inside that i can use?.

    Thanks again for sharing this.

    • Lorenzo Farnararo #
      November 10, 2013

      Hi Mr.F. I don’t think the little RF24 has the dedicated hardware which can provide encryption. You’ll have to do develop it software-side both on the Raspberry Pi (not a problem) and the arduino (can be a problem).
      Like you, I mind very much about security, but for this little test I didn’t bother too much actually. Do you have so much “nerd” neighbours???

      If you would like to build something interesting, I strongly suggest you a symmetrical key (like AES). I’ve looked around the internet and I’ve found some arduino’s libraries [on the Raspberry Pi you have Debian ;) ]:
      - http://forum.arduino.cc/index.php/topic,88890.0.html
      - https://github.com/DavyLandman/AESLib
      - http://www.expertcore.org/viewtopic.php?f=18&t=3772
      Give it a try, but keep in mind that encryption is such an heavy task for an arduino.
      Cheers

  38. October 26, 2013

    Hi. Is it possible to control several nodes with only one “hub” (Raspi)?

    • October 26, 2013

      Sure, you’ll need to set different wifi addresses. You can pass these addresses to the RF24 library.

      On the arduino you identify them on the sketch with this code:
      // Radio pipe addresses for the 2 nodes to communicate.
      const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

      on the raspberry application (.cpp) with:

      const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

      • Jose #
        October 28, 2013

        Great, thank you! And, is it possible to create a bi-directional link? I want to send commands from Raspi to Arduino and receive sensor data back.

        • October 28, 2013

          Actually it is a bidirectional communication. Indeed, we’ve made arduino reply with the same message he received, to check if communication worked, but you can make him respond whatever you need.
          On line 92 of Arduino sketch you can change
          radio.write( &message, sizeof(unsigned long) );

          to deliver anything you want.
          Have nice coding!

          • November 4, 2013

            Ciao!

            Ho acquistato questi moduli due mesi fa, poi li ho abbandonati per carenza di tempo e poca documentazione per ciò che mi serviva.

            Il mio progetto di impianto domotico è completo e volevo estenderlo in altre camere evitando di infilare cavi inutili in tutta casa, se ti interessa puoi cercare DomoHome su YouTube tanto per farti un’idea..
            Detto questo.. non ho ancora dato un’occhiata al source in js, ma probabilmente non farà altro che chiamare l’applicazione compilata in C a runtime, mi sbaglio?

            Il mio problema più grande è che il mio progetto è scritto interamente in python su Raspberry, e ci ho impiegato moltissimo tempo per scriverlo da zero, quindi doverlo riscrivere in C non saprei da dove partire.

            Ho tutto l’occorrente a disposizione, mi servirebbe giusto un consiglio sulla giusta pista da adottare..

          • November 4, 2013

            ENG
            Hi Angelo,
            we’ve seen your awesome project on youtube. The road we’ve taken is definitely more “wireless” :D
            Js instructions are interpreted by a binary file pre compiled written in C++. This binary interface itself with RF24 libraries written in C (If I remember well) which probably (almost surely) have a python sub layer.
            To be able to use those libraries you should unmount them or look for the pre porting version. From there, I think the rest is pretty easy.
            Next time could be better to write in english, so all the world can take advantage from your doubts and projects.
            Thank you again for you participation!

            ITA
            Ciao Angelo,
            abbiamo visto il tuo fantastico progetto su youtube. La strada che stiamo percorrendo noi e’ decisamente piu’ “wireless” :D
            Le istruzioni js vengono interpretate da un binario pre compilato scritto in C++. Questo binario si interfaccia con delle librerie per RF24 in C (se non sbaglio) che probabilmente (quasi sicuramente) hanno un sub layer in python.
            Per sfruttare queste librerie dovresti smontarle o cercare il pre porting. Da li’ penso che la strada sia abbastanza in discesa.
            La prossima volta sarebbe meglio tu scrivessi in inglese, in modo che tutto il mondo possa trarre vantaggio dai tuoi dubbi e dai tuoi progetti.
            Grazie ancora per la partecipazione!

          • November 4, 2013

            I found a wrapper written in python a month ago but it didn’t work due to different configurations. I’ve learnt that you need to set different params in order to let them communicate.

            Is there a way to talk to you directly and share some information to let this project work for a lot of people like me who codes in python?

          • November 9, 2013

            Sure, althought I have to tell you that I do not have so much free time (like you see). My email is edo “at” lenotta.com

          • November 16, 2013

            In these days I found the time to write down a wrapper to send data from Raspberry through nRF24L01. It’s simply to use, it accepts three parameters.. the sender address, the receiver address and the message coded in long long unsigned int.

            Thanks to this wrapper the only thing you have to do is to configure the receiver, in my case an Arduino Uno, in order to understand your messages.

  39. October 6, 2013

    Cool project! I’ve been working on something like this for my desktop computer. By any chance, do you know what the current draw of the Raspberry Pi is when it’s idle waiting for a command?

Leave a Reply

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS