Skip to content
  • 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
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

đź’¬ Building a Raspberry Pi Gateway

Scheduled Pinned Locked Moved Announcements
1.1k Posts 173 Posters 422.5k 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.
  • Christian SimonsenC Christian Simonsen

    @dopeeye

    Sadly not. I ended up creating an serial gateway (arduino with NRF24L01 and a USB connector) and connected this to the Raspberry Pi, rather than connecting the NRF24L01 directly to the GPIO pins. This worked perfectly straight away.

    dopeeyeD Offline
    dopeeyeD Offline
    dopeeye
    wrote on last edited by
    #97

    @Christian-Simonsen

    Too stubborn to give up, yet.
    If i find a resolution I will let you know

    carlylerC 1 Reply Last reply
    0
    • GrahamG Offline
      GrahamG Offline
      Graham
      wrote on last edited by
      #98

      I would like to try this, but my pins19-23 are already used by other hardware. Has anyone tried using the SPI1 Pins?

      1 Reply Last reply
      0
      • dopeeyeD dopeeye

        @Christian-Simonsen

        Too stubborn to give up, yet.
        If i find a resolution I will let you know

        carlylerC Offline
        carlylerC Offline
        carlyler
        wrote on last edited by
        #99

        @dopeeye I had this issue and unfortunately changed several things at once and got rid of it. However, one thing I noticed was I had different versions of mySensors in my library directory since I downloaded the examples package. Therefore the sensor was likely compiling on a different version than the Gateway. You might want to check that.

        If you could post more of your logs (sensor and gateway) it might help.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          ericvdb
          wrote on last edited by
          #100

          @marceloaqno

          When running as a service, is there a way to watch the debug log?

          1 Reply Last reply
          0
          • Patrik SöderströmP Offline
            Patrik SöderströmP Offline
            Patrik Söderström
            wrote on last edited by
            #101

            Any ETA on support for RFM69 ? Need to extend my coverage :)

            1 Reply Last reply
            0
            • alescA Offline
              alescA Offline
              alesc
              wrote on last edited by
              #102

              Done:

              1. git clone https://github.com/mysensors/MySensors.git
              2. ./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
              3. make.
                Got error:
                In file included from ./MySensors.h:287:0,
                from examples_linux/mysGateway.cpp:70:
                ./drivers/RF24/RF24.cpp: In function âuint8_t RF24_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)â:
                ./drivers/RF24/RF24.cpp:65:22: error: âNOPâ was not declared in this scope
                *ptx++ = NOP ;
                ^
                Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed
                make: *** [examples_linux/mysGateway.o] Error 1
                Any idea?
              mfalkviddM tekkaT 2 Replies Last reply
              0
              • alescA alesc

                Done:

                1. git clone https://github.com/mysensors/MySensors.git
                2. ./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
                3. make.
                  Got error:
                  In file included from ./MySensors.h:287:0,
                  from examples_linux/mysGateway.cpp:70:
                  ./drivers/RF24/RF24.cpp: In function âuint8_t RF24_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)â:
                  ./drivers/RF24/RF24.cpp:65:22: error: âNOPâ was not declared in this scope
                  *ptx++ = NOP ;
                  ^
                  Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed
                  make: *** [examples_linux/mysGateway.o] Error 1
                  Any idea?
                mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by mfalkvidd
                #103

                @alesc looks like this commit in the development branch broke the code.

                Do

                git checkout master
                

                before running configure should get the code to the latest stable release.

                EDIT: Sorry, that won't work because the Raspberry Pi stuff didn't exist when MySensors 2.0 was released. You'll have to do git pull instead, to get tekka's fix.

                1 Reply Last reply
                0
                • alescA alesc

                  Done:

                  1. git clone https://github.com/mysensors/MySensors.git
                  2. ./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
                  3. make.
                    Got error:
                    In file included from ./MySensors.h:287:0,
                    from examples_linux/mysGateway.cpp:70:
                    ./drivers/RF24/RF24.cpp: In function âuint8_t RF24_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)â:
                    ./drivers/RF24/RF24.cpp:65:22: error: âNOPâ was not declared in this scope
                    *ptx++ = NOP ;
                    ^
                    Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed
                    make: *** [examples_linux/mysGateway.o] Error 1
                    Any idea?
                  tekkaT Offline
                  tekkaT Offline
                  tekka
                  Admin
                  wrote on last edited by tekka
                  #104

                  @alesc @mfalkvidd Thanks for reporting, fixed: https://github.com/mysensors/MySensors/pull/635

                  1 Reply Last reply
                  1
                  • ben999B Offline
                    ben999B Offline
                    ben999
                    wrote on last edited by ben999
                    #105

                    Hi Everyone !
                    Big thumb up for the amount of work supplied !!!
                    After being more or less successful with openHAB1 I had a go with openHAB2 today, via a online install....
                    But no success with the "mysGateway" install : should i go back to serial gateway with an arduino ?
                    Thanks a lot for your help

                    1 Reply Last reply
                    0
                    • carlylerC Offline
                      carlylerC Offline
                      carlyler
                      wrote on last edited by
                      #106

                      @ben999 try again, because it works great. I assume by online install you mean apt-get; I too had trouble when trying this. However, I tried again following @TimO instructions here:
                      wiki, then everything came up nicely. I feel it is some permission issue that I have not tried to figure out yet.

                      ben999B 1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        marceloaqno
                        Code Contributor
                        wrote on last edited by marceloaqno
                        #107

                        @ericvdb when running as a service, debug messages are masked and aren't shown in the system logs, but it would be a good idea to have a way to connect to gateway perhaps using telnet and watch the logs. I'll work on something.

                        1 Reply Last reply
                        0
                        • carlylerC carlyler

                          @ben999 try again, because it works great. I assume by online install you mean apt-get; I too had trouble when trying this. However, I tried again following @TimO instructions here:
                          wiki, then everything came up nicely. I feel it is some permission issue that I have not tried to figure out yet.

                          ben999B Offline
                          ben999B Offline
                          ben999
                          wrote on last edited by
                          #108

                          @carlyler
                          Thanks a lot for your message, hope is back on my side :)
                          Actually I had a go with openHABian (i didn't make it clear in my previous message, sorry)
                          The install itself couldn't be easier : OS+openHAB installed in one go, just by formatting SD Card with a tiny img file. One hour later and voilĂ  !
                          So that could be the source of my trouble?
                          I will go with the link you supplied tonight and let you know (lookslike it is a manual install... scary!!)
                          Thank you again for your support

                          1 Reply Last reply
                          0
                          • carlylerC Offline
                            carlylerC Offline
                            carlyler
                            wrote on last edited by
                            #109

                            @ben999 if you have not already, read through the MySensors OH2 thread. I noticed a recent post by @TimO that talks about setting some permissions and that might be the issue. Otherwise, the manual install is not bad as he gives you step-by-step; I am a new to all this and managed to get it to work...

                            ben999B 1 Reply Last reply
                            0
                            • carlylerC carlyler

                              @ben999 if you have not already, read through the MySensors OH2 thread. I noticed a recent post by @TimO that talks about setting some permissions and that might be the issue. Otherwise, the manual install is not bad as he gives you step-by-step; I am a new to all this and managed to get it to work...

                              ben999B Offline
                              ben999B Offline
                              ben999
                              wrote on last edited by
                              #110

                              @carlyler
                              Smashing
                              Thanks a lot for that hint... I remember reading that...
                              Linux is so damn rigid :laughing:
                              Thank you again for your help

                              1 Reply Last reply
                              0
                              • JahFyahhJ Offline
                                JahFyahhJ Offline
                                JahFyahh
                                wrote on last edited by
                                #111

                                Either its not stated or I cannot see it, but i was wondering... Is this version 2 voor de rPi?
                                At the moment I am using MySensors version 1.5 with Pimatic as controller. And I would like to use v2.

                                1 Reply Last reply
                                0
                                • E Offline
                                  E Offline
                                  ericvdb
                                  wrote on last edited by
                                  #112

                                  @ben999 Yes, version 2

                                  1 Reply Last reply
                                  0
                                  • ben999B Offline
                                    ben999B Offline
                                    ben999
                                    wrote on last edited by ben999
                                    #113

                                    I feel a bit sorry to come back here for my own little troubles...

                                    1- So i installed openhab2 on RPi3 with a fresh SDCard
                                    2- I followed tobof 's excellent step-by-step howto
                                    3- I installed mysGateway
                                    4- With pi@raspberrypi:~/MySensors $ sudo ./examples_linux/mysGateway -d i can see that my motion sensor and my RPi gateway get on well... they do speak to each other, right ?

                                    mysGateway: Starting gateway...
                                    mysGateway: Protocol version - 2.0.1-beta
                                    mysGateway: MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta
                                    mysGateway: TSF:LRT:OK
                                    mysGateway: TSM:INIT
                                    mysGateway: TSM:INIT:TSP OK
                                    mysGateway: TSM:INIT:GW MODE
                                    mysGateway: TSM:READY
                                    mysGateway: MCO:REG:NOT NEEDED
                                    mysGateway: MCO:BGN:STP
                                    mysGateway: MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
                                    mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:1
                                    mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:0
                                    mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:1
                                    mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:0
                                    

                                    5-in things/demo.things" I put this.

                                    Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/pts/2", sendDelay=200 ] {  }
                                    

                                    Right away, it worked (king of the world!) and i could see that bridge in paperUI !!!
                                    But i got that after a reboot of RPi

                                    openhab> Failed to connect on port: /dev/pts/2 exception: 
                                    gnu.io.NoSuchPortException
                                            at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273)
                                            at gnu.io.NRSerialPort.connect(NRSerialPort.java:48)
                                            at org.openhab.binding.mysensors.protocol.serial.MySensorsSerialConnection.<init>(MySensorsSerialConnection.java:52)
                                            at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:63)
                                            at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:764)
                                            at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)
                                            at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:177)
                                            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                                            at java.lang.Thread.run(Thread.java:745)
                                    

                                    Wrong serial port ?

                                    Juste to make it clear : mysGateway bit of software is the magic that makes RPi believe that there's an arduino acting as a gateway on USB and collects the NRF24 info through GPio ?

                                    YveauxY 1 Reply Last reply
                                    0
                                    • ben999B ben999

                                      I feel a bit sorry to come back here for my own little troubles...

                                      1- So i installed openhab2 on RPi3 with a fresh SDCard
                                      2- I followed tobof 's excellent step-by-step howto
                                      3- I installed mysGateway
                                      4- With pi@raspberrypi:~/MySensors $ sudo ./examples_linux/mysGateway -d i can see that my motion sensor and my RPi gateway get on well... they do speak to each other, right ?

                                      mysGateway: Starting gateway...
                                      mysGateway: Protocol version - 2.0.1-beta
                                      mysGateway: MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta
                                      mysGateway: TSF:LRT:OK
                                      mysGateway: TSM:INIT
                                      mysGateway: TSM:INIT:TSP OK
                                      mysGateway: TSM:INIT:GW MODE
                                      mysGateway: TSM:READY
                                      mysGateway: MCO:REG:NOT NEEDED
                                      mysGateway: MCO:BGN:STP
                                      mysGateway: MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
                                      mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:1
                                      mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:0
                                      mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:1
                                      mysGateway: TSF:MSG:READ,1-1-0,s=1,c=1,t=16,pt=0,l=1,sg=0:0
                                      

                                      5-in things/demo.things" I put this.

                                      Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/pts/2", sendDelay=200 ] {  }
                                      

                                      Right away, it worked (king of the world!) and i could see that bridge in paperUI !!!
                                      But i got that after a reboot of RPi

                                      openhab> Failed to connect on port: /dev/pts/2 exception: 
                                      gnu.io.NoSuchPortException
                                              at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273)
                                              at gnu.io.NRSerialPort.connect(NRSerialPort.java:48)
                                              at org.openhab.binding.mysensors.protocol.serial.MySensorsSerialConnection.<init>(MySensorsSerialConnection.java:52)
                                              at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:63)
                                              at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:764)
                                              at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)
                                              at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:177)
                                              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                                              at java.lang.Thread.run(Thread.java:745)
                                      

                                      Wrong serial port ?

                                      Juste to make it clear : mysGateway bit of software is the magic that makes RPi believe that there's an arduino acting as a gateway on USB and collects the NRF24 info through GPio ?

                                      YveauxY Offline
                                      YveauxY Offline
                                      Yveaux
                                      Mod
                                      wrote on last edited by
                                      #114

                                      @ben999 said:

                                      Wrong serial port ?

                                      Likely ;-)
                                      /dev/pts/x are pseudo-terminals , not serial ports.

                                      On my (old) Pi running Raspbian the serial port is /dev/ttyAMA0
                                      You could run something like

                                      dmesg |grep -i tty
                                      

                                      to get an idea of serial ports on your Pi.

                                      http://yveaux.blogspot.nl

                                      ben999B 1 Reply Last reply
                                      1
                                      • YveauxY Yveaux

                                        @ben999 said:

                                        Wrong serial port ?

                                        Likely ;-)
                                        /dev/pts/x are pseudo-terminals , not serial ports.

                                        On my (old) Pi running Raspbian the serial port is /dev/ttyAMA0
                                        You could run something like

                                        dmesg |grep -i tty
                                        

                                        to get an idea of serial ports on your Pi.

                                        ben999B Offline
                                        ben999B Offline
                                        ben999
                                        wrote on last edited by
                                        #115

                                        @Yveaux thanks a lot for your answer. Understanding linux is a slow and painful process :laughing:

                                        Here is the output from your command : dmesg |grep -i tty

                                        pi@raspberrypi:~ $ dmesg |grep -i tty
                                        [    0.000000] Kernel command line: 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa02082 bcm2709.serial=0xcc3e67e3 smsc95xx.macaddr=B8:27:EB:3E:67:E3 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
                                        [    0.001337] console [tty1] enabled
                                        [    1.772114] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
                                        

                                        What a mess...
                                        ttyAMA0 is the one !!!
                                        Thanks @Yveaux you got me on the right path !!! Goto next step! :smile:

                                        1 Reply Last reply
                                        1
                                        • JahFyahhJ Offline
                                          JahFyahhJ Offline
                                          JahFyahh
                                          wrote on last edited by
                                          #116

                                          I just did a fresh install of pimatic and MsGateway on the pi. But pimatic does not seem to get de messages. i started the gateway via the daemon method, is there a way to see if the sensor is reaching the gateway?

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


                                          19

                                          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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular