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. Announcements
  3. 💬 Building a Raspberry Pi Gateway

💬 Building a Raspberry Pi Gateway

Scheduled Pinned Locked Moved Announcements
1.1k Posts 173 Posters 422.6k Views 131 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.
  • TriXwooDT Offline
    TriXwooDT Offline
    TriXwooD
    wrote on last edited by
    #636

    Double radio or alternative pin for spi1:

    https://forum.mysensors.org/topic/7702/double-spi-radio-raspberry-pi/2

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arraWX
      wrote on last edited by
      #637

      I followed the instructions carefully. However I get an error. Can someone help?

      git clone https://github.com/mysensors/MySensors.git --branch master
      cd MySensors
      ./configure --my-transport=nrf24 --my-gateway=ethernet
      

      This results in a warning:

      [SECTION] Detecting SPI driver.
        [WARNING] No supported SPI driver detected.
      

      When I run make I get the follwing error:

      In file included from examples_linux/mysgw.cpp:74:0:
      ./MySensors.h:254:2: error: #error No support for nRF24 radio on this platform
       #error No support for nRF24 radio on this platform
        ^
      In file included from ./drivers/RF24/RF24.cpp:23:0,
                       from ./MySensors.h:290,
                       from examples_linux/mysgw.cpp:74:
      ./drivers/RF24/RF24.h:52:17: fatal error: SPI.h: No such file or directory
       #include <SPI.h>
                       ^
      compilation terminated.
      Makefile:114: recipe for target 'build/examples_linux/mysgw.o' failed
      make: *** [build/examples_linux/mysgw.o] Error 1
      

      Hope someone can help. Thanks.

      1 Reply Last reply
      0
      • skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #638

        Maybe you didn't enable SPI on the pi.

        From command prompt type 'sudo raspi-config', then select option 5 from the menu. This takes you to where you can enable the SPI bus on the pi. Then try again.

        S>

        1 Reply Last reply
        2
        • A Offline
          A Offline
          arraWX
          wrote on last edited by
          #639

          @skywatch Thank you! That solved my problem.

          1 Reply Last reply
          1
          • Sefi NinioS Offline
            Sefi NinioS Offline
            Sefi Ninio
            wrote on last edited by Sefi Ninio
            #640

            Hello friends,

            Reading the instructions for building a RaspberryPi Gateway using RFM69, it states that one should use the development branch and not master, since the Pi is using a different version of the driver.

            Anyone knows when this will be merged to master branch?

            Also, since this forces all nodes to use development branch as well to be able to communicate with the gateway, assuming I use the development branch now and it is later on merged into master, is there an easy way to upgrade nodes remotely to the new code?

            I am planning to use Wall Switch Insertable Node, and Mini Relay Mode - Both support OTA updates, am I correct to assume this will allow upgrading without taking the nodes out of where they are located?

            Thanks!
            Sefi

            1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #641

              Like all nodes, you need to change the bootloader in order to enable ota.

              1 Reply Last reply
              0
              • llegoffL Offline
                llegoffL Offline
                llegoff
                wrote on last edited by
                #642

                hello, is there a inclusion mode planned for the raspberry pi gateway ?

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  ricorico94
                  wrote on last edited by ricorico94
                  #643

                  Hi,
                  This seems a great job, but despite I had a look at many posts (yes, many out of the dozens of pages.. ;-) ), I still can't figure out some questions..

                  • Beyond the obvious advantage of saving an arduino (and power supply, space..), is there an advantage for having the gateway hosted by the raspberry PI hosting my Domoticz ? (like more CPU available for handling communications or for signing ? or on the opposite more risks to overload the PI CPU -despite only a couple persons have complained about high CPU load))
                  • the default setup is Ethernet. What are the pros and cons of ethernet vs serial setup ? (speed? reliability ? possibility to move to other gateway?..)
                  • Is signing now implemented in this setup ? I didn't see it explicitely described, but some posts seem related to signing.
                  • if I want to use an external antenna and the high power NRF24, should I use an aother power source than raspberry PI ? (or maybe sharing the same USB charger, but diverting the power in parallel of the PI ?)
                  • is there a tutorial somewhere detailing how to uninstall and migrate to an external gateway ? During such migration, would I need to "touch" again my sensors and would I lose history logs of these sensors in Domoticz ?

                  Sorry for all these questions..

                  br,
                  Ricorico94

                  mfalkviddM 1 Reply Last reply
                  1
                  • R ricorico94

                    Hi,
                    This seems a great job, but despite I had a look at many posts (yes, many out of the dozens of pages.. ;-) ), I still can't figure out some questions..

                    • Beyond the obvious advantage of saving an arduino (and power supply, space..), is there an advantage for having the gateway hosted by the raspberry PI hosting my Domoticz ? (like more CPU available for handling communications or for signing ? or on the opposite more risks to overload the PI CPU -despite only a couple persons have complained about high CPU load))
                    • the default setup is Ethernet. What are the pros and cons of ethernet vs serial setup ? (speed? reliability ? possibility to move to other gateway?..)
                    • Is signing now implemented in this setup ? I didn't see it explicitely described, but some posts seem related to signing.
                    • if I want to use an external antenna and the high power NRF24, should I use an aother power source than raspberry PI ? (or maybe sharing the same USB charger, but diverting the power in parallel of the PI ?)
                    • is there a tutorial somewhere detailing how to uninstall and migrate to an external gateway ? During such migration, would I need to "touch" again my sensors and would I lose history logs of these sensors in Domoticz ?

                    Sorry for all these questions..

                    br,
                    Ricorico94

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

                    @ricorico94 said in 💬 Building a Raspberry Pi Gateway:

                    Hi,
                    This seems a great job, but despite I had a look at many posts (yes, many out of the dozens of pages.. ;-) ), I still can't figure out some questions..

                    • Beyond the obvious advantage of saving an arduino (and power supply, space..), is there an advantage for having the gateway hosted by the raspberry PI hosting my Domoticz ? (like more CPU available for handling communications or for signing ? or on the opposite more risks to overload the PI CPU -despite only a couple persons have complained about high CPU load))

                    Not really. Cpu usage is normally 0-2% so it doesn't affect either way.

                    Switching between different gateway types (serial, ethernet, mqtt) can be easier since there is no need to re-wire anything, just reconfigure and recompile. But that could be done with a all-in-one Arduino setup as well.

                    Remote debug might be a benefit, since logging in to the raspberry pi to view log files can be done remotely. Remote debug for Arduino is possible, but usually requires additional hardware.

                    The raspberry pi has room for more logging, which can help troubleshooting.

                    The biggest downside is that a raspberry pi environment is infinitely more complex than an Arduino, which could affect reliability and make troubleshooting harder. On the other hand, there are more debugging tools available which might make troubleshooting easier.

                    • the default setup is Ethernet. What are the pros and cons of ethernet vs serial setup ? (speed? reliability ? possibility to move to other gateway?..)

                    No difference in speed. No difference in reliability.

                    Ethernet can easily be made accessible over the network. Doing that with serial can be done but is a bit tricky.

                    Some controllers don't have support for all gateway types. See https://www.mysensors.org/controller for details.

                    • Is signing now implemented in this setup ? I didn't see it explicitely described, but some posts seem related to signing.

                    Yes. See the help text produced by running ./configure --help

                    • if I want to use an external antenna and the high power NRF24, should I use an aother power source than raspberry PI ? (or maybe sharing the same USB charger, but diverting the power in parallel of the PI ?)

                    Yes. See the note on https://www.mysensors.org/build/raspberry#wiring

                    • is there a tutorial somewhere detailing how to uninstall and migrate to an external gateway ? During such migration, would I need to "touch" again my sensors and would I lose history logs of these sensors in Domoticz ?

                    See my answer in the question you posted yesterday.

                    Sorry for all these questions..

                    No worries. Except for posting one of the questions again (which wastes people's time and confuses people when they read only one of the places), you are very welcome to post as many questions as you like. Asking questions is usually the next best way to learn.

                    1 Reply Last reply
                    4
                    • R Offline
                      R Offline
                      ricorico94
                      wrote on last edited by
                      #645

                      Thanks a lot for your clear explanations ! Very useful !
                      and.. bravo ! for all your work

                      1 Reply Last reply
                      2
                      • R Offline
                        R Offline
                        ricorico94
                        wrote on last edited by ricorico94
                        #646

                        Hi,
                        I'm trying to install the gateway on a Raspberry Pi 2 hosting Domoticz already (I had used the standard Domoticz image).
                        I receive an error message on the make step, but maybe I've not properly understood instructions (not very friendly with raspberry and linux environment).
                        First, I wired the NRF24 with PA (meaning I used an adapter and the 5V physical PIN#4) and the IRQ (wired on physical pin #15)
                        Then I logged into my raspberry and staid in initial directory (pi@raspberrypi )
                        I then typed:

                        pi@raspberrypi ~ $ git clone https://github.com/mysensors/MySensors.git --branch master
                        Cloning into 'MySensors'...
                        remote: Counting objects: 14895, done.
                        remote: Compressing objects: 100% (8/8), done.
                        remote: Total 14895 (delta 0), reused 5 (delta 0), pack-reused 14887
                        Receiving objects: 100% (14895/14895), 12.17 MiB | 1.68 MiB/s, done.
                        Resolving deltas: 100% (9022/9022), done.
                        pi@raspberrypi ~ $ cd MySensors
                        pi@raspberrypi ~/MySensors $ ./configure --help
                        

                        Hopefully I did it in adequate folder ? (now I see a Mysensors folder in my /home/pi folder).
                        Then I typed:

                        pi@raspberrypi ~/MySensors $ --my-transport=nrf24
                        -bash: --my-transport=nrf24 : commande introuvable
                        pi@raspberrypi ~/MySensors $ ./configure --my-transport=nrf24
                        [SECTION] Detecting target machine.
                          [OK] machine detected: SoC=BCM2836, Type=Rpi2, CPU=armv7l.
                        [SECTION] Detecting SPI driver.
                          [OK] SPI driver detected:BCM.
                        [SECTION] Detecting init system.
                          [OK] init system detected: sysvinit.
                        [SECTION] Saving configuration.
                        [SECTION] Cleaning previous builds.
                        [OK] Finished.
                        
                        

                        So far, no error.. but should I have typed "./configure --my-transport=nrf24 --my-rf24-irq-pin=15" to implement the IRQ ? If yes, can I retype that command with new settings without issue ?

                        Then I understaood I had to run make command:

                        pi@raspberrypi ~/MySensors $ make
                        gcc -MT build/drivers/Linux/log.o -MMD -MP -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI  -Ofast -g -Wall -Wextra  -I. -I./core -I./drivers/Linux -I./drivers/RPi -I./drivers/BCM -c drivers/Linux/log.c -o build/drivers/Linux/log.o
                        cc1: error: bad value (cortex-a7) for -mtune switch
                        Makefile:118: recipe for target 'build/drivers/Linux/log.o' failed
                        make: *** [build/drivers/Linux/log.o] Error 1
                        
                        

                        But errors... :anguished:
                        I tried to search on forum, and saw someone else meniotning a smilar error, but people were answering about OrangePI, whereas I use a Rasp PI 2.
                        I probably misunderstood some steps.. Could someone help me ?

                        Note: in instructions, there's a statement I don't understand for ethernet gateway: "To set the gateway as a client that connects to a controller, use:--my-gateway=ethernet --my-controller-url-address=YOUR-CONTROLLER-ADDRES" . IN which case do we need that ? (as said, I plan to simply use this gateway on My dodmoticz rasp PI).

                        br,
                        Ricorico94

                        1 Reply Last reply
                        0
                        • gohanG Offline
                          gohanG Offline
                          gohan
                          Mod
                          wrote on last edited by
                          #647

                          @ricorico94 said in 💬 Building a Raspberry Pi Gateway:

                          ./configure --my-transport=nrf24 --my-rf24-irq-pin=15

                          That is fine, no need to add extra parameters as by defaults it will configure as ethernet gateway. Also try using the development branch as it has lots of bugs fixed.

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            arraWX
                            wrote on last edited by
                            #648

                            @ricorico94 Yesterday I managed to make a working rpi gateway. I am on rpi3, use a socket adapter board for the radio and use domoticz. I posted all the details here: https://forum.mysensors.org/topic/7793/nrf24l01-problems-in-2-1-1-and-2-2-0-beta/24

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              ricorico94
                              wrote on last edited by ricorico94
                              #649

                              Hi,
                              @arraWX : I looked at your post. Unfortunately, the error I face is before the start, as it's during the make, so it appears I follow the first steps you describe (config & make), but I still don't know how to solve the make errors.

                              In case it can help understanding what's going on or what to do, I ran the command:

                              gcc -v 
                              

                              which displayed: gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
                              Could it be an issue this "+rpi1" whreas I've a PI 2 ?

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                arraWX
                                wrote on last edited by
                                #650

                                Do not know if it is of any help, but mine says: gcc version 4.9.2 (Raspbian 4.9.2-10)

                                1 Reply Last reply
                                0
                                • R Offline
                                  R Offline
                                  ricorico94
                                  wrote on last edited by
                                  #651

                                  Hi,
                                  I tried to update gcc, just in case.. though I'm not sure of what I do.:confused:
                                  I ran:

                                  pi@raspberrypi ~/MySensors $ sudo apt-get upgrade gcc
                                  

                                  and after a little while, it ended without obvious mistake.
                                  but if I do gcc -v again, I still get
                                  gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
                                  (even after reboot)
                                  Is there another step to be done, or am I using wrong command ?

                                  1 Reply Last reply
                                  0
                                  • gohanG Offline
                                    gohanG Offline
                                    gohan
                                    Mod
                                    wrote on last edited by
                                    #652

                                    try running first sudo apt-get update and then sudo apt-get upgrade , it should update all packages

                                    1 Reply Last reply
                                    0
                                    • R Offline
                                      R Offline
                                      ricorico94
                                      wrote on last edited by
                                      #653

                                      @gohan : JUst tried it, but same result.. no change on version number.
                                      is there something like apt-get install to be done also ?

                                      M 1 Reply Last reply
                                      0
                                      • gohanG Offline
                                        gohanG Offline
                                        gohan
                                        Mod
                                        wrote on last edited by
                                        #654

                                        I don't know really... I am using dietpi on a RPI3 and there is a convenient tool that you can check what to install and installs for you and among the others I have chosen the "Build-Essentials" that contains all the common packages for compile, so I don't know what packages are included.

                                        1 Reply Last reply
                                        0
                                        • R ricorico94

                                          @gohan : JUst tried it, but same result.. no change on version number.
                                          is there something like apt-get install to be done also ?

                                          M Offline
                                          M Offline
                                          marceloaqno
                                          Code Contributor
                                          wrote on last edited by
                                          #655

                                          @ricorico94 Do you see gcc-4.9 in the list returned by the command below?

                                          sudo apt-cache search gcc
                                          

                                          If it's listed, try installing it by specifying the version:

                                          sudo apt-get install gcc-4.9
                                          
                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          22

                                          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