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 423.0k 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.
  • gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #928

    it is not a solution, but you could switch to ethernet GW and you will avoid all the permissions problems.

    1 Reply Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by
      #929

      My 5 cents:
      Run it as a MQTT gateway, if possible. It makes things so much easier, when you interact with the data in node-red. Even integrating other controllers is easier, as you have the MQTT as standard backbone bus between everything.

      You need to have a MQTT broker (mosquitto) running as well.. But it's worth it..

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mirodin
        wrote on last edited by mirodin
        #930

        Yes I came to the conclusion that this might be my only option even if it sucks as I have to subscribe to all events from MySensors, process them with Node-RED and republish again which screws my logging a bit. Right now I have another flow subscribed to "#" and write every event into my DB.

        Since I have everything talking to mosquitto setup to follow Homie Convention I was hoping for only having my MQTT broker bombarded with compliant messages and have Node-RED convert everything (assign device names, etc. using a SQLite DB) from serial so the rather cryptic MySensors topics do not show up there.

        gohanG 1 Reply Last reply
        0
        • M mirodin

          Yes I came to the conclusion that this might be my only option even if it sucks as I have to subscribe to all events from MySensors, process them with Node-RED and republish again which screws my logging a bit. Right now I have another flow subscribed to "#" and write every event into my DB.

          Since I have everything talking to mosquitto setup to follow Homie Convention I was hoping for only having my MQTT broker bombarded with compliant messages and have Node-RED convert everything (assign device names, etc. using a SQLite DB) from serial so the rather cryptic MySensors topics do not show up there.

          gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #931

          @mirodin you actually need only mysensors-in and mysensors-out topics and their subtopics

          M 1 Reply Last reply
          1
          • gohanG gohan

            @mirodin you actually need only mysensors-in and mysensors-out topics and their subtopics

            M Offline
            M Offline
            mirodin
            wrote on last edited by
            #932

            @gohan Yes I know but now I can no longer just wildcard-dump every event on my mosquitto instance into my DB as I need to filter out the mysensor-in and -out topics.

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

              Or meanwhile just use the ethernet gw

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mirodin
                wrote on last edited by
                #934

                Well... I think I fixed it, let's hear it for documentation. Just when I had MQTT setup half way I got struck by the idea that there was some group flag for configure. And indeed there is, setting --my-serial-groupname=nodered did the trick making /dev/pts/X owned by group nodered and let Node-RED connect to it, writing and reading works just fine now.

                Thanks @gohan for your input I think I would have gone the ethernet route in the end if this last test had failed.

                1 Reply Last reply
                1
                • I Offline
                  I Offline
                  Inso
                  wrote on last edited by
                  #935

                  I am currently trying to update to 2.3
                  Have stopped service and deleted the file (systemctl status mysgw -> Unit mysgw.service could not be found.)
                  Also renamed the config file /etc/mysensors.dat
                  Renamed the old folder, then copied new files.
                  Checked readme.md in MySensors-folder: MySensors Library v2.3.0
                  Then I configured the radio and -> make, no errors
                  However, changing to bin folder and executing mysgw shows: Protocol 2.2.0
                  What am I missing?

                  M gohanG 2 Replies Last reply
                  0
                  • I Inso

                    I am currently trying to update to 2.3
                    Have stopped service and deleted the file (systemctl status mysgw -> Unit mysgw.service could not be found.)
                    Also renamed the config file /etc/mysensors.dat
                    Renamed the old folder, then copied new files.
                    Checked readme.md in MySensors-folder: MySensors Library v2.3.0
                    Then I configured the radio and -> make, no errors
                    However, changing to bin folder and executing mysgw shows: Protocol 2.2.0
                    What am I missing?

                    M Offline
                    M Offline
                    mirodin
                    wrote on last edited by
                    #936

                    @inso Did you sudo make install after building it? This command copies the service file and mysgw to their respective locations.

                    I 1 Reply Last reply
                    1
                    • I Inso

                      I am currently trying to update to 2.3
                      Have stopped service and deleted the file (systemctl status mysgw -> Unit mysgw.service could not be found.)
                      Also renamed the config file /etc/mysensors.dat
                      Renamed the old folder, then copied new files.
                      Checked readme.md in MySensors-folder: MySensors Library v2.3.0
                      Then I configured the radio and -> make, no errors
                      However, changing to bin folder and executing mysgw shows: Protocol 2.2.0
                      What am I missing?

                      gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #937

                      @inso remember to unregister the service and then make a new make install of the new gw

                      mfalkviddM 1 Reply Last reply
                      0
                      • gohanG gohan

                        @inso remember to unregister the service and then make a new make install of the new gw

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

                        @gohan how is the unregistration done? I didn’t know that was needed. We should probably add upgrade instructions to the build page.

                        1 Reply Last reply
                        0
                        • M mirodin

                          @inso Did you sudo make install after building it? This command copies the service file and mysgw to their respective locations.

                          I Offline
                          I Offline
                          Inso
                          wrote on last edited by
                          #939

                          @mirodin
                          make install before testing did the trick, now it is 2.3.0 . :smiley:
                          Was just going step by step through tutorial, there it´s make -> test -> make install. Didn´t realized it would use old parts if it´s not first install :relaxed:

                          @gohan
                          thought stop, disable and remove the service would be enough to ensure the service is completely "uninstalled" - could you give me a hint what I´ve missed? :sweat_smile:

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

                            Hi,
                            I try to access log info from my gateway installed on my domoticz raspberry pi, but I get no success..
                            First, I can't find the mysensors.conf file : nothing in the /etc folder. I tried to use "find / -name 'mysensors.conf' 2>/dev/null" command, but it finds nothing.
                            I tried creating such a file (then it's found by the fond command above) and in which I have the lines

                            log_pipe=0
                            log_pipe_file=/tmp/mysgw.pipe
                            

                            as instructed above.
                            I restarted the wole Raspberry PI, then tried the command cat /tmp/mysgw.pipe but error message:

                            cat: /tmp/mysgw.pipe: Aucun fichier ou dossier de ce type
                            

                            (= no file or folder like that)
                            I then tried this: sudo mysgw -c /etc/mysensors.conf and I got also error message:

                            mysgw: invalid option -- 'c'
                            

                            I installed the Mysensor gateway on 17th October 2017 and my raspberry pi is working on Wheezy. In Domoticz, I see the Mysensor gateway has version 2.1.1.
                            MY gateway seems working fine, communicating properly with sensors (both ways). I'm trying to find log because I face an issue with a new sensor which works properly when powered with external FTDI 3.3V and only 1 way (sensor to gateway only) when powered on battery (I raised question in another post, where I was suggested to check log fil on gtw side..)

                            Any idea of what I should do (except "reinstall whole raspberry pi with latest OS..) ?
                            Thanks a lot,
                            Ricorico

                            mfalkviddM 1 Reply Last reply
                            0
                            • R ricorico94

                              Hi,
                              I try to access log info from my gateway installed on my domoticz raspberry pi, but I get no success..
                              First, I can't find the mysensors.conf file : nothing in the /etc folder. I tried to use "find / -name 'mysensors.conf' 2>/dev/null" command, but it finds nothing.
                              I tried creating such a file (then it's found by the fond command above) and in which I have the lines

                              log_pipe=0
                              log_pipe_file=/tmp/mysgw.pipe
                              

                              as instructed above.
                              I restarted the wole Raspberry PI, then tried the command cat /tmp/mysgw.pipe but error message:

                              cat: /tmp/mysgw.pipe: Aucun fichier ou dossier de ce type
                              

                              (= no file or folder like that)
                              I then tried this: sudo mysgw -c /etc/mysensors.conf and I got also error message:

                              mysgw: invalid option -- 'c'
                              

                              I installed the Mysensor gateway on 17th October 2017 and my raspberry pi is working on Wheezy. In Domoticz, I see the Mysensor gateway has version 2.1.1.
                              MY gateway seems working fine, communicating properly with sensors (both ways). I'm trying to find log because I face an issue with a new sensor which works properly when powered with external FTDI 3.3V and only 1 way (sensor to gateway only) when powered on battery (I raised question in another post, where I was suggested to check log fil on gtw side..)

                              Any idea of what I should do (except "reinstall whole raspberry pi with latest OS..) ?
                              Thanks a lot,
                              Ricorico

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

                              @ricorico94 there seems to have been some major changes in the raspberry pi gateway, without vorresponding updates to the documentation.

                              I have not been able to locate the exact changes though. @marceloaqno might know.

                              mfalkviddM 1 Reply Last reply
                              0
                              • mfalkviddM mfalkvidd

                                @ricorico94 there seems to have been some major changes in the raspberry pi gateway, without vorresponding updates to the documentation.

                                I have not been able to locate the exact changes though. @marceloaqno might know.

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

                                Found the reference: https://github.com/mysensors/MySensors/pull/1061

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

                                  @mfalkvidd : thanks a lot ! I had searched for such version history and couldn't find it.
                                  Indeed it seems introduction of the switches for log files was introduced in February, so I should probably update my install.

                                  Precisely, talking about upgrade process: I read in previous posts that we should uninstall/unregister the install/service. WHat would be commands to do so ? Should it be:

                                  sudo systemctl disable mysgw.service
                                  

                                  and executed before anything else ? So upgrade process would be:

                                  sudo systemctl disable mysgw.service
                                  make
                                  sudo make install
                                  sudo systemctl enable mysgw.service
                                  

                                  (and maybe test the gateway before the "systemctl enable..")
                                  Is there anyfile to remove manually ? or any other command to apply before or after ?

                                  M 1 Reply Last reply
                                  0
                                  • alowhumA Offline
                                    alowhumA Offline
                                    alowhum
                                    Plugin Developer
                                    wrote on last edited by
                                    #944

                                    Would someone be willing to create a post that lists each step required to set up the simple encryption+signing option? I understand I have to add a password line to the arduino sketch. But how exactly one sets up the server side is still a bit of a mystery to me. It would rock if there was a similar simple command to give during the make process.

                                    AnticimexA pepsonP 2 Replies Last reply
                                    0
                                    • alowhumA alowhum

                                      Would someone be willing to create a post that lists each step required to set up the simple encryption+signing option? I understand I have to add a password line to the arduino sketch. But how exactly one sets up the server side is still a bit of a mystery to me. It would rock if there was a similar simple command to give during the make process.

                                      AnticimexA Offline
                                      AnticimexA Offline
                                      Anticimex
                                      Contest Winner
                                      wrote on last edited by Anticimex
                                      #945

                                      @alowhum https://www.mysensors.org/apidocs/group__RaspberryPiGateway.html
                                      That is straight from the documentation. Which in the case of Linux ports is also what you get if you issue ./configure --help
                                      I believe.

                                      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                                      1 Reply Last reply
                                      0
                                      • alowhumA alowhum

                                        Would someone be willing to create a post that lists each step required to set up the simple encryption+signing option? I understand I have to add a password line to the arduino sketch. But how exactly one sets up the server side is still a bit of a mystery to me. It would rock if there was a similar simple command to give during the make process.

                                        pepsonP Offline
                                        pepsonP Offline
                                        pepson
                                        wrote on last edited by
                                        #946

                                        @alowhum
                                        I also need this info...

                                        1 Reply Last reply
                                        0
                                        • R ricorico94

                                          @mfalkvidd : thanks a lot ! I had searched for such version history and couldn't find it.
                                          Indeed it seems introduction of the switches for log files was introduced in February, so I should probably update my install.

                                          Precisely, talking about upgrade process: I read in previous posts that we should uninstall/unregister the install/service. WHat would be commands to do so ? Should it be:

                                          sudo systemctl disable mysgw.service
                                          

                                          and executed before anything else ? So upgrade process would be:

                                          sudo systemctl disable mysgw.service
                                          make
                                          sudo make install
                                          sudo systemctl enable mysgw.service
                                          

                                          (and maybe test the gateway before the "systemctl enable..")
                                          Is there anyfile to remove manually ? or any other command to apply before or after ?

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

                                          @ricorico94 to update your install run:

                                          sudo make install
                                          sudo systemctl restart mysgw.service
                                          
                                          1 Reply Last reply
                                          2
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          8

                                          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