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.
  • OliO Oli

    OK I found the solution (thanks to @luizrrocha). I change

    ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyMySensorsGateway
    to
    ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSBMySensorsGateway and now its working.

    Question is, It's only workaround (in my case) or there is bug in the installation guide?

    luizrrochaL Offline
    luizrrochaL Offline
    luizrrocha
    wrote on last edited by
    #245

    @Oli : if both the gateway and Domoticz run on the same Raspi, there is no physical network involved, hence the 127.0.0.1 dummy local address is used by Domoticz to talk to the gateway on the same machine, just using port 5003... and since you use localhost (127.0.0.1, a virtual network) there is no need to create a virtual USB port which is what you did...

    OliO 1 Reply Last reply
    0
    • luizrrochaL luizrrocha

      @Oli : if both the gateway and Domoticz run on the same Raspi, there is no physical network involved, hence the 127.0.0.1 dummy local address is used by Domoticz to talk to the gateway on the same machine, just using port 5003... and since you use localhost (127.0.0.1, a virtual network) there is no need to create a virtual USB port which is what you did...

      OliO Offline
      OliO Offline
      Oli
      wrote on last edited by
      #246

      @luizrrocha interesting... step by step instruction?

      luizrrochaL 1 Reply Last reply
      0
      • OliO Oli

        @luizrrocha interesting... step by step instruction?

        luizrrochaL Offline
        luizrrochaL Offline
        luizrrocha
        wrote on last edited by
        #247

        @Oli: delete the Makefile.inc file on mysensors folder
        ./configure --my-gateway=ethernet
        make
        sudo ./bin/mysgw -b
        go to domoticz and create a new MySensors Gateway with LAN, inform 127.0.0.1 as the address and 5003 as the port...

        that should do the trick.

        1 Reply Last reply
        1
        • ysinhY ysinh

          A tiny hint for the users of domoticz :
          ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSB20
          make
          sudo ./examples_linux/mysGateway -d

          :) i hope this helps
          then in the hardware setup
          MySensors Gateway USB
          serial port: /dev/ttyUSB20

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

          @Oli luizrocha's configuration seems interesting, but just in case your still wanting the serial, from above, has worked for me in the past, but I have since switched to OH2:

          @ysinh said:

          A tiny hint for the users of domoticz :
          ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSB20
          make
          sudo ./examples_linux/mysGateway -d

          :) i hope this helps
          then in the hardware setup
          MySensors Gateway USB
          serial port: /dev/ttyUSB20

          1 Reply Last reply
          0
          • W Offline
            W Offline
            Wackid
            wrote on last edited by
            #249

            I am also not get it to work in Domoticz tried the USB serial and ethernet way.

            It's a testing pi. Where i didn't connected the radio. Because it's still in the Nano. Could that be the issue? I guess not.

            1 Reply Last reply
            0
            • M marceloaqno

              @aand @Tag @jirm MySensors uses its own nrf24 drivers, and OrangePi is not currently supported. It will be in the future.

              T Offline
              T Offline
              Tag
              wrote on last edited by Tag
              #250

              @marceloaqno, @jirm, @aand

              Hi!,

              I started a new topic for Mysensors Gateway on OrangePI (OPI), Here

              Hope this is okay,

              Kind regards,

              Tag

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mihai
                wrote on last edited by Mihai
                #251

                The Pi MQTT Gateway with IRQ connected may handle better the messages into a loaded network than Ethernet MQTT Gateway where IRQ is not used? (with NRF24)
                Also I would like to know if I can use the other pins of RPi to connect some digital sensors directly there.

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  Wackid
                  wrote on last edited by
                  #252

                  @Oli
                  Stupid question... Did you mount the radio? Because I thought I would like to test if it works. (without radio) but that doesn't work.

                  Mounted a radio and ethernet gateway is working.

                  1 Reply Last reply
                  0
                  • eyesoftE Offline
                    eyesoftE Offline
                    eyesoft
                    wrote on last edited by
                    #253

                    @Mihai

                    Maybe i'm wrong but IRQ is used on all gateways if you read above :
                    """
                    Improving throughput for nrf24
                    There is another method were the interrupt pin from the nrf24 modules is used to inform when a new message arrives and it's immediately added to a queue for further processing
                    """
                    for the second part yes you can use other pins on RPi ... i have RF module NRF24L01 for gateway and DHT11 on RPi.

                    M 1 Reply Last reply
                    0
                    • luizrrochaL luizrrocha

                      Ditto, @Robinek70 !

                      Thank you, Marcelo Aquino, for your fantastic work .

                      I have Domoticz, Cacti, Heyu and MySensors Gateway running in a 30 dollars RASPBERRY PI 2, all without a glitch, all talking to each other and hopefully soon will also have Alexa for RASPBERRY PI running there also.

                      If in doubt, by a RASPBERRY PI and thank people who develop and support it for free instead of complaining all the time.

                      'nuff said.

                      Luiz Roberto

                      M Offline
                      M Offline
                      musthafa
                      wrote on last edited by
                      #254

                      @luizrrocha said:

                      Ditto, @Robinek70 !

                      Thank you, Marcelo Aquino, for your fantastic work .

                      I have Domoticz, Cacti, Heyu and MySensors Gateway running in a 30 dollars RASPBERRY PI 2, all without a glitch, all talking to each other and hopefully soon will also have Alexa for RASPBERRY PI running there also.

                      If in doubt, by a RASPBERRY PI and thank people who develop and support it for free instead of complaining all the time.

                      'nuff said.

                      Luiz Roberto

                      Can you please give me the instructions for Domoticz setup?

                      I have a node with DHT11 sensor and I can see mygsw service is getting messages. How do I connect Domoticz with mysensors ?

                      I have been following openhab until today and I'm switching to Domoticz now.

                      luizrrochaL 1 Reply Last reply
                      0
                      • M musthafa

                        @luizrrocha said:

                        Ditto, @Robinek70 !

                        Thank you, Marcelo Aquino, for your fantastic work .

                        I have Domoticz, Cacti, Heyu and MySensors Gateway running in a 30 dollars RASPBERRY PI 2, all without a glitch, all talking to each other and hopefully soon will also have Alexa for RASPBERRY PI running there also.

                        If in doubt, by a RASPBERRY PI and thank people who develop and support it for free instead of complaining all the time.

                        'nuff said.

                        Luiz Roberto

                        Can you please give me the instructions for Domoticz setup?

                        I have a node with DHT11 sensor and I can see mygsw service is getting messages. How do I connect Domoticz with mysensors ?

                        I have been following openhab until today and I'm switching to Domoticz now.

                        luizrrochaL Offline
                        luizrrochaL Offline
                        luizrrocha
                        wrote on last edited by
                        #255

                        Hello, @musthafa .

                        For installation I used the tutorial at http://www.domoticz.com/wiki/Installing_and_running_Domoticz_on_a_Raspberry_PI. It looks like they changed the tutorial that I used to just a single curl command to install it, although there are complaints about it not working alright. You'll have to try it as I cannot reinstall mine.

                        Setting up MySensors Gateway is also covered in the wiki : http://www.domoticz.com/wiki/MySensors, very easy. I recommend you go thru the wiki pages as I did, they are a treasure of information, as the manual on www.domoticz.com is outdated though useful.

                        Good luck.

                        Luiz

                        M 1 Reply Last reply
                        0
                        • luizrrochaL luizrrocha

                          Hello, @musthafa .

                          For installation I used the tutorial at http://www.domoticz.com/wiki/Installing_and_running_Domoticz_on_a_Raspberry_PI. It looks like they changed the tutorial that I used to just a single curl command to install it, although there are complaints about it not working alright. You'll have to try it as I cannot reinstall mine.

                          Setting up MySensors Gateway is also covered in the wiki : http://www.domoticz.com/wiki/MySensors, very easy. I recommend you go thru the wiki pages as I did, they are a treasure of information, as the manual on www.domoticz.com is outdated though useful.

                          Good luck.

                          Luiz

                          M Offline
                          M Offline
                          musthafa
                          wrote on last edited by
                          #256

                          @luizrrocha said:
                          Thank you!

                          Hello, @musthafa .

                          For installation I used the tutorial at http://www.domoticz.com/wiki/Installing_and_running_Domoticz_on_a_Raspberry_PI. It looks like they changed the tutorial that I used to just a single curl command to install it, although there are complaints about it not working alright. You'll have to try it as I cannot reinstall mine.

                          Domoticz Installation was straight forward as per their wiki.

                          Setting up MySensors Gateway is also covered in the wiki : http://www.domoticz.com/wiki/MySensors, very easy. I recommend you go thru the wiki pages as I did, they are a treasure of information, as the manual on www.domoticz.com is outdated though useful.

                          Good luck.

                          Luiz

                          MySensors I tried Ethernet didn't work. Virtual Serial Port worked for me. However I have 1 light (LED Test at PIN 4 of Node) & a DHT sensor. Domoticz only lists the DHT sensor. It doesn't show me the light child.

                          luizrrochaL 1 Reply Last reply
                          0
                          • M musthafa

                            @luizrrocha said:
                            Thank you!

                            Hello, @musthafa .

                            For installation I used the tutorial at http://www.domoticz.com/wiki/Installing_and_running_Domoticz_on_a_Raspberry_PI. It looks like they changed the tutorial that I used to just a single curl command to install it, although there are complaints about it not working alright. You'll have to try it as I cannot reinstall mine.

                            Domoticz Installation was straight forward as per their wiki.

                            Setting up MySensors Gateway is also covered in the wiki : http://www.domoticz.com/wiki/MySensors, very easy. I recommend you go thru the wiki pages as I did, they are a treasure of information, as the manual on www.domoticz.com is outdated though useful.

                            Good luck.

                            Luiz

                            MySensors I tried Ethernet didn't work. Virtual Serial Port worked for me. However I have 1 light (LED Test at PIN 4 of Node) & a DHT sensor. Domoticz only lists the DHT sensor. It doesn't show me the light child.

                            luizrrochaL Offline
                            luizrrochaL Offline
                            luizrrocha
                            wrote on last edited by
                            #257

                            @musthafa : look on the MySensors forum for the MYSController, install it and you can monitor the messages going to the gateway.

                            Most likely your declaration of the LED output pin on the MySensors arduino is not correct. I still did not use arduinos as actuators with MySensors so I will probably not be of much help here.

                            Cheers,

                            Luiz

                            M 1 Reply Last reply
                            0
                            • luizrrochaL luizrrocha

                              @musthafa : look on the MySensors forum for the MYSController, install it and you can monitor the messages going to the gateway.

                              Most likely your declaration of the LED output pin on the MySensors arduino is not correct. I still did not use arduinos as actuators with MySensors so I will probably not be of much help here.

                              Cheers,

                              Luiz

                              M Offline
                              M Offline
                              musthafa
                              wrote on last edited by
                              #258

                              @luizrrocha said:

                              @musthafa : look on the MySensors forum for the MYSController, install it and you can monitor the messages going to the gateway.

                              Most likely your declaration of the LED output pin on the MySensors arduino is not correct. I still did not use arduinos as actuators with MySensors so I will probably not be of much help here.

                              Cheers,

                              Luiz

                              In OpenHAB it worked as a dimmer. Later on OpenHAB was stuck and my mobile app was frozen. Then I start discovering Domoticz. If it can be discovered in OH2 why not in Domoticz ?

                              1 Reply Last reply
                              1
                              • eyesoftE eyesoft

                                @Mihai

                                Maybe i'm wrong but IRQ is used on all gateways if you read above :
                                """
                                Improving throughput for nrf24
                                There is another method were the interrupt pin from the nrf24 modules is used to inform when a new message arrives and it's immediately added to a queue for further processing
                                """
                                for the second part yes you can use other pins on RPi ... i have RF module NRF24L01 for gateway and DHT11 on RPi.

                                M Offline
                                M Offline
                                Mihai
                                wrote on last edited by
                                #259

                                @eyesoft
                                Thank you for the answer, I am happy to get a confirmation about sensors works on a Pi Gateway. Since at least one of my sensor is analogue, I still have to add an Arduino board to the gateway, I plan to connect it via USB.
                                I have tested and get very good results with Home Assistant controller running on a Pi where I add sensors directly on Pi and to an Arduino (USB to Pi).
                                The Ethernet Gateway do not use IRQ: https://www.mysensors.org/build/ethernet_gateway
                                Nor the nodes: https://www.mysensors.org/build/connect_radio Even if the wire is connected at Arduino pin 2, is mentioned: Note: The IRQ is currently not used by the MySensors library so it can be left un-connected
                                If you know how to connect and manage this IRQ on Arduino sketch, please let me know.
                                I have built this some time ago and works without the IRQ connected. Now I have updated the MySensors to 2.1.0 , IRQ is still unconnected and works the same. As far as I see, it is used for the Pi Gateway. I plan to migrate to this configuration of Pi Gateway, but I would like to get more info before change my working system:

                                • this IRQ improve the reliability? (sometimes I have encountered problems due the load of NRF24 network with many messages)
                                • I would like to set retain=true for the MQTT Gateway, this will improve the reliability.
                                  I already addressed the last question somwhere else, still waiting for more info if somebody know.
                                  Thank you
                                M 1 Reply Last reply
                                0
                                • MadhiasM Offline
                                  MadhiasM Offline
                                  Madhias
                                  wrote on last edited by
                                  #260

                                  After installing a Raspberry Gateway, is this output OK, or have I forgotten something?

                                  mysgw: Starting gateway...
                                  mysgw: Protocol version - 2.2.0-beta
                                  mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.2.0-beta
                                  mysgw: TSF:LRT:OK
                                  mysgw: TSM:INIT
                                  mysgw: TSF:WUR:MS=0
                                  mysgw: TSM:INIT:TSP OK
                                  mysgw: TSM:INIT:GW MODE
                                  mysgw: TSM:READY:ID=0,PAR=0,DIS=0
                                  mysgw: MCO:REG:NOT NEEDED
                                  mysgw: MCO:BGN:STP
                                  mysgw: MCO:BGN:INIT OK,TSP=1
                                  

                                  I configured with (should be a serial gateway with a controller on the same machine):

                                  ./configure --soc=BCM2835 --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyMySensorGateway --my-serial-groupname=dialout --my-debug=enable
                                  
                                  1 Reply Last reply
                                  0
                                  • pjeranP Offline
                                    pjeranP Offline
                                    pjeran
                                    wrote on last edited by pjeran
                                    #261

                                    Has there been any progress on the RFM69 version? Looking at the repository, it looks like some of the code is there. I did find this RFM69 driver for the Pi that has a LowPowerLabs interface. Would this help in moving forward?

                                    https://github.com/dconstructing/rfm69

                                    thanks for all the work on this - a great community moving things forward.

                                    1 Reply Last reply
                                    0
                                    • eyesoftE Offline
                                      eyesoftE Offline
                                      eyesoft
                                      wrote on last edited by
                                      #262

                                      @Mihai
                                      you can attach analogue sensor to ESP2866 with espeasy firmware ... more info here : http://www.letscontrolit.com/wiki/index.php/ESPEasy ... i'm using one ESP8266-12E and i have good results and Uptime: 74209 minutes (usb powered).
                                      i'm using IRQ on NRF24L01 connected to my Rpi, but i don't have many sensor with nrf+arduino (only 2) and i had no problems ... i don't if IRQ improve the reliability and i never play with irq fron nrf on arduino.
                                      regarding retain=true have a look here : http://www.hivemq.com/blog/mqtt-essentials-part-8-retained-messages
                                      for more reliability on mqtt i think you can use qos=1 ( The broker/client will deliver the message at least once, with confirmation required.), but all depends on your set-up .. not all messages need special attention.

                                      M 1 Reply Last reply
                                      0
                                      • M Mihai

                                        @eyesoft
                                        Thank you for the answer, I am happy to get a confirmation about sensors works on a Pi Gateway. Since at least one of my sensor is analogue, I still have to add an Arduino board to the gateway, I plan to connect it via USB.
                                        I have tested and get very good results with Home Assistant controller running on a Pi where I add sensors directly on Pi and to an Arduino (USB to Pi).
                                        The Ethernet Gateway do not use IRQ: https://www.mysensors.org/build/ethernet_gateway
                                        Nor the nodes: https://www.mysensors.org/build/connect_radio Even if the wire is connected at Arduino pin 2, is mentioned: Note: The IRQ is currently not used by the MySensors library so it can be left un-connected
                                        If you know how to connect and manage this IRQ on Arduino sketch, please let me know.
                                        I have built this some time ago and works without the IRQ connected. Now I have updated the MySensors to 2.1.0 , IRQ is still unconnected and works the same. As far as I see, it is used for the Pi Gateway. I plan to migrate to this configuration of Pi Gateway, but I would like to get more info before change my working system:

                                        • this IRQ improve the reliability? (sometimes I have encountered problems due the load of NRF24 network with many messages)
                                        • I would like to set retain=true for the MQTT Gateway, this will improve the reliability.
                                          I already addressed the last question somwhere else, still waiting for more info if somebody know.
                                          Thank you
                                        M Offline
                                        M Offline
                                        marceloaqno
                                        Code Contributor
                                        wrote on last edited by
                                        #263

                                        @Mihai I have not done any extensive testing with IRQ functionality in RPi, I plan to do it in the future, so for now you will have to test it for yourself.

                                        @Madhias Yes, this is the expected output, the gateway is now waiting for messages to arrive.

                                        @pjeran Yes, there is a work in progress with many improvements: https://github.com/mysensors/MySensors/pull/722

                                        1 Reply Last reply
                                        0
                                        • tianaT Offline
                                          tianaT Offline
                                          tiana
                                          wrote on last edited by
                                          #264

                                          Is it possible to use the second ISP on my raspberypi 3 to connect NRF24L01+ and what will be the wiring diagram, also what have to change in mygsw library

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


                                          17

                                          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