Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Step-by-step procedure to connect the NRF24L01+ to the GPIO pins and use the Raspberry as a Serial Gateway (MySensors 1.x)

Step-by-step procedure to connect the NRF24L01+ to the GPIO pins and use the Raspberry as a Serial Gateway (MySensors 1.x)

Scheduled Pinned Locked Moved Hardware
nrf24raspberry piraspberryraspberry nrf24l01 gpiogateway
168 Posts 47 Posters 175.0k Views 36 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DidiD Offline
    DidiD Offline
    Didi
    wrote on last edited by
    #9

    @mfalkvidd
    :+1: :clap:

    if (knowledge == 0) { use BRAIN; use GOOGLE;use SEARCH; } else {make POST;}

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jkandasa
      Plugin Developer
      wrote on last edited by
      #10

      @mfalkvidd I used direct NRF24l01+ with RPI long ago and I felt slow data transfer compare to USB-to-Serial(ttl)<-->MySensors Gateway connection. especially on OTA firmware update.

      mfalkviddM 1 Reply Last reply
      0
      • J jkandasa

        @mfalkvidd I used direct NRF24l01+ with RPI long ago and I felt slow data transfer compare to USB-to-Serial(ttl)<-->MySensors Gateway connection. especially on OTA firmware update.

        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #11

        @jkandasa said:

        @mfalkvidd I used direct NRF24l01+ with RPI long ago and I felt slow data transfer compare to USB-to-Serial(ttl)<-->MySensors Gateway connection. especially on OTA firmware update.

        Thanks. Let's add that under the other notes section.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Myna
          wrote on last edited by
          #12

          This is a very good work !

          Is there anything in place for RFM69 ? Would it be difficult to port the code from arduino to rpi ? (I have never coded on RPI).

          Also, do you think any performance difference is involved in managing the radio directly from the RPI, compared to having a dedicated atmega/arduino ? Especially if a controller solution is already running on it?

          martinhjelmareM 1 Reply Last reply
          1
          • GertSandersG Offline
            GertSandersG Offline
            GertSanders
            Hardware Contributor
            wrote on last edited by GertSanders
            #13

            My experience: the Raspberry 2 indicates usually less then 1% processor, with very occasional maximum peaks to 15%. So I would say, Raspberry 2: no worries. My setup is Domoticz + NRF24based gateway on the same Raspi.

            1 Reply Last reply
            1
            • mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #14

              My experience is on the same level as @GertSanders's - very low cpu usage.

              I don't use RFM69 so unfortunately I have no knowledge about the feasibility to connect it directly to the Raspberry Pi.

              1 Reply Last reply
              0
              • martinhjelmareM martinhjelmare

                Doesn't the provided init script in the library already have logging? I didn't get around to testing this setup after my initial attempt failed, so I might be wrong.

                https://github.com/mysensors/Raspberry/blob/master/initscripts/PiGatewaySerial

                T Offline
                T Offline
                tbully
                wrote on last edited by
                #15

                @martinhjelmare said:

                Doesn't the provided init script in the library already have logging? I didn't get around to testing this setup after my initial attempt failed, so I might be wrong.

                https://github.com/mysensors/Raspberry/blob/master/initscripts/PiGatewaySerial

                Ugh! Correct. Also, @mfalkvidd did cover this with his "MAKE THE GATEWAY AUTOSTART" section.....If I only could read! I will test this soon to see how the logging works.

                Finally, by enabling ser2net and adding something like this to /etc/ser2net.conf:

                5003:raw:600/dev/ttyMySensorsGateway
                

                ....you have yourself an Ethernet Gateway! Great stuff! Thanks again!

                1 Reply Last reply
                0
                • M Myna

                  This is a very good work !

                  Is there anything in place for RFM69 ? Would it be difficult to port the code from arduino to rpi ? (I have never coded on RPI).

                  Also, do you think any performance difference is involved in managing the radio directly from the RPI, compared to having a dedicated atmega/arduino ? Especially if a controller solution is already running on it?

                  martinhjelmareM Offline
                  martinhjelmareM Offline
                  martinhjelmare
                  Plugin Developer
                  wrote on last edited by
                  #16

                  @Myna said:

                  This is a very good work !

                  Is there anything in place for RFM69 ? Would it be difficult to port the code from arduino to rpi ? (I have never coded on RPI).

                  Also, do you think any performance difference is involved in managing the radio directly from the RPI, compared to having a dedicated atmega/arduino ? Especially if a controller solution is already running on it?

                  I've got no experience myself with rfm69 yet, but I've been thinking about it and searching the web says it should work, connecting the rfm69 to the raspberry pi, for example here:
                  https://github.com/abouillot/HomeAutomation/tree/master/piGateway

                  There are also custom pcbs for simplicity, don't know if it's tested though:
                  https://oshpark.com/profiles/thinkpeace

                  1 Reply Last reply
                  1
                  • sowardS Offline
                    sowardS Offline
                    soward
                    wrote on last edited by
                    #17

                    Perhaps re-word the last note from:

                    A user experienced data transfer compare to USB-to-Serial(ttl)<-->MySensors Gateway connection. especially on OTA firmware update. If you think this will cause a problem for you, an ethernet gateway might be a better alternative.

                    to:

                    A user notes that data transfer speeds are comparable to that of a USB-to-Serial(ttl)<-->MySensors Gateway connections. If you think this may be an issue for your application (e.g. OTA firmware updates), an ethernet gateway might be a better alternative.

                    thanx,
                    JpS

                    1 Reply Last reply
                    0
                    • mfalkviddM Offline
                      mfalkviddM Offline
                      mfalkvidd
                      Mod
                      wrote on last edited by
                      #18

                      @soward that wasn't quite the feedback I got, but what I wrote didn't make much sense either so I have corrected it now. Thanks!

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        minscof
                        wrote on last edited by minscof
                        #19

                        I have a trouble with CPU utilization when I start the gateway : 100% all the time. I use Jessie and not Wheezy on a RPI 2. Does someone can help me to troubleshoot this problem ? I have not add a decoupling capacitor , can it be the reason ?

                        Solved : see this post

                        C 1 Reply Last reply
                        0
                        • M minscof

                          I have a trouble with CPU utilization when I start the gateway : 100% all the time. I use Jessie and not Wheezy on a RPI 2. Does someone can help me to troubleshoot this problem ? I have not add a decoupling capacitor , can it be the reason ?

                          Solved : see this post

                          C Offline
                          C Offline
                          christian
                          wrote on last edited by
                          #20

                          @minscof said:

                          I have a trouble with CPU utilization when I start the gateway : 100% all the time. I use Jessie and not Wheezy on a RPI 2. Does someone can help me to troubleshoot this problem ? I have not add a decoupling capacitor , can it be the reason ?

                          This happened to me as well, I mixed up the boards I had at home and discover later it was a B+ and not a RPI2 :-) Maybe you've made the same mistake?

                          1 Reply Last reply
                          0
                          • mfalkviddM Offline
                            mfalkviddM Offline
                            mfalkvidd
                            Mod
                            wrote on last edited by mfalkvidd
                            #21

                            @minscof got an answer in this thread: http://forum.mysensors.org/topic/2367/pigatewayserial-using-interrupts/3
                            The high cpu usage will go away as soon as you start your controller (or something else that reads from the tty the gateway creates).

                            1 Reply Last reply
                            0
                            • E Offline
                              E Offline
                              Eawo
                              wrote on last edited by
                              #22

                              Is it possible to use NRF24L01+PA+LNA Antenna version or is it to power hungry? Do i have to change something in the code?

                              1 Reply Last reply
                              0
                              • G Offline
                                G Offline
                                georgep56
                                wrote on last edited by
                                #23

                                @Eawo If you look at the excellent original post from @mfalkvidd above:

                                The 3.3V power on the Raspberry Pi is rated for a maximum of 50mA. A regular NRF24L01+ only needs 15mA, but if you are using a power amplified version you might exceed what the Raspberry Pi can output. In that case, an external power supply might be required.

                                I don't believe that you will need to make any changes to code.

                                1 Reply Last reply
                                1
                                • E Offline
                                  E Offline
                                  Eawo
                                  wrote on last edited by Eawo
                                  #24

                                  My friend also started with mysensors and i gave him my old raspberry with the 26 pin gpio. Can he also use this guide? Also if it possible how do u wire it? Im just a beginner so i ask stupid questions. maybe serial gateway is the way to go but we are waiting for arduino's

                                  1 Reply Last reply
                                  0
                                  • mfalkviddM Offline
                                    mfalkviddM Offline
                                    mfalkvidd
                                    Mod
                                    wrote on last edited by
                                    #25

                                    @Eawo Yes, it should work. I ran Domoticz and MySensors Gateway on my Raspberry Pi 1 when I first tried MySensors. If I remember correctly I had to connect CE to pin 15 instead of 22 but I am not sure why. Try using the same connections as on your Raspberry Pi 2 first, and switch CE pin if you get "check wires". Please report back here how it goes, so I can add the necessary information to the original post.

                                    1 Reply Last reply
                                    0
                                    • OitzuO Offline
                                      OitzuO Offline
                                      Oitzu
                                      wrote on last edited by
                                      #26

                                      I get stuff like

                                      read: 2-2-0 s=255,c=0,t=17,pt=0,l=3:1.5
                                      send: 2-194-1-0 s=255,c=0,t=17,pt=0,l=3,st=fail:1.5
                                      read: 2-2-0 s=255,c=3,t=6,pt=1,l=1:0
                                      send: 2-194-1-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
                                      read: 2-2-0 s=1,c=1,t=2,pt=2,l=2:1
                                      send: 2-194-1-0 s=1,c=1,t=2,pt=2,l=2,st=fail:1
                                      

                                      from 'PiGatewaySerial' but no results on the Serial Port. Any idea what i'm doing wrong?

                                      1 Reply Last reply
                                      0
                                      • OitzuO Offline
                                        OitzuO Offline
                                        Oitzu
                                        wrote on last edited by
                                        #27

                                        Somehow the node thought it is node id 194 and a repeater...
                                        I hacked in node id 0 and it worked. But it even works slower then the arduino serial gateway.

                                        1 Reply Last reply
                                        0
                                        • mfalkviddM Offline
                                          mfalkviddM Offline
                                          mfalkvidd
                                          Mod
                                          wrote on last edited by
                                          #28

                                          In http://forum.mysensors.org/topic/2305/nrf24l01-rpi2-direct-connection-problem/1 an user also got node id 194. Maybe the discussion there can help?

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          12

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular