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. Development
  3. MySensors Raspberry port suggestions

MySensors Raspberry port suggestions

Scheduled Pinned Locked Moved Development
96 Posts 14 Posters 42.4k Views 17 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.
  • M Offline
    M Offline
    marceloaqno
    Code Contributor
    wrote on last edited by
    #1

    In an attempt to keep mysensors/Raspberry repository in sync with mysensors/Arduino, I started a while ago working on a solution but only recently had time to finish.
    I ended up with two approaches:

    Place the raspberry gateway files in a directory called examples_RPi within the libraries\MySensors folder (more or less like TMRh20/RF24 does)
    https://github.com/marceloaqno/Arduino/tree/raspberry-gateway

    or keep the two repos and use git subtree to bind them:
    https://github.com/marceloaqno/Raspberry/tree/experimental

    What you guys thinks?

    I'm trying to catch up with new changes into the development branch and thinking of a way to port this into it.

    1 Reply Last reply
    3
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @marceloaqno said:

      Place the raspberry gateway files in a directory called examples_RPi within the libraries\MySensors folder (more or less like TMRh20/RF24 does)

      Keeping the RPI specific files within libraries/MySensors/core and libraries/MySensors/drivers would be my first choice... Pinging @Oitzu here also as he talked about helping as well.

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

        @marceloaqno said:

        I ended up with two approaches:

        Place the raspberry gateway files in a directory called examples_RPi within the libraries\MySensors folder (more or less like TMRh20/RF24 does)
        https://github.com/marceloaqno/Arduino/tree/raspberry-gateway

        or keep the two repos and use git subtree to bind them:
        https://github.com/marceloaqno/Raspberry/tree/experimental

        What you guys thinks?

        I was also thinking back and forth whats the best way to accomplish this.
        In the end i think the better way is to do it like TMRh20/RF24 do it, because it also fits better in the current mysensors git structure.

        @hek said:

        Keeping the RPI specific files within libraries/MySensors/core and libraries/MySensors/drivers would be my first choice...

        The RPi specific files would be withing these dirs, in examples_RPi would only be the example code for the serial-gateway, or other examples for the library. So this would be much like the arduino "examples" dir.

        1 Reply Last reply
        0
        • aaron832A Offline
          aaron832A Offline
          aaron832
          wrote on last edited by
          #4

          @marceloaqno I have been looking into your work to get the RaspberryPi up to date with the latest MySensors code. You have examples for Regular Gateway, Serial and Ethernet. Are you considering creating another for MQTT? I might start looking into this, just wanted to see if you had anything planned. I think it would be best to have a Raspberry PI acting as a gateway as well as an OpenHab/MQTT server.

          M 1 Reply Last reply
          0
          • aaron832A aaron832

            @marceloaqno I have been looking into your work to get the RaspberryPi up to date with the latest MySensors code. You have examples for Regular Gateway, Serial and Ethernet. Are you considering creating another for MQTT? I might start looking into this, just wanted to see if you had anything planned. I think it would be best to have a Raspberry PI acting as a gateway as well as an OpenHab/MQTT server.

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

            @aaron832 I'm planning to add support to MQTT directly into the ethernet gateway. Gonna try to use mongoose (https://github.com/cesanta/mongoose) for the MQTT so it wouldn't require any external library. I got stuck exploring the many cool things that can be done with Node-Red that I didn't start to implement anything yet :stuck_out_tongue_winking_eye:

            aaron832A 1 Reply Last reply
            0
            • M marceloaqno

              @aaron832 I'm planning to add support to MQTT directly into the ethernet gateway. Gonna try to use mongoose (https://github.com/cesanta/mongoose) for the MQTT so it wouldn't require any external library. I got stuck exploring the many cool things that can be done with Node-Red that I didn't start to implement anything yet :stuck_out_tongue_winking_eye:

              aaron832A Offline
              aaron832A Offline
              aaron832
              wrote on last edited by
              #6

              @marceloaqno Ha, Cool. Happy to hear you are looking at MQTT. I will keep a watch on your repository and will try experimenting with using mongoose as well.

              1 Reply Last reply
              0
              • aaron832A Offline
                aaron832A Offline
                aaron832
                wrote on last edited by
                #7

                Just as an update, I have the MQTT version with mongoose mostly working. Thanks for that recommendation @marceloaqno. Still very much a work in progress. If anyone is interested in following, here is the link: https://github.com/aaron832/Arduino/tree/raspberry-gateway-MQTT/libraries/MySensors/examples_RPi

                1 Reply Last reply
                1
                • aaron832A Offline
                  aaron832A Offline
                  aaron832
                  wrote on last edited by
                  #8

                  FYI I had to ditch mongoose. It just wan't working properly. libmosquitto from http://mosquitto.org/ seems to work a lot better. Any idea about getting @marceloaqno 's branch merged into develop or vise versa? Would be nice to be working on 2.0

                  M 1 Reply Last reply
                  0
                  • aaron832A aaron832

                    FYI I had to ditch mongoose. It just wan't working properly. libmosquitto from http://mosquitto.org/ seems to work a lot better. Any idea about getting @marceloaqno 's branch merged into develop or vise versa? Would be nice to be working on 2.0

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

                    @aaron832 I'm very close to reaching a working version for the 2.0, will release something in the coming days.

                    aaron832A 1 Reply Last reply
                    1
                    • M marceloaqno

                      @aaron832 I'm very close to reaching a working version for the 2.0, will release something in the coming days.

                      aaron832A Offline
                      aaron832A Offline
                      aaron832
                      wrote on last edited by
                      #10

                      @marceloaqno This is good news because I was about to give up trying to do the port. :sweat_smile: Hopefully some of my stuff was of some use.

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

                        This is the initial support for Linux/RaspberryPi for the 2.0:
                        https://github.com/marceloaqno/Arduino/tree/dev-raspberrypi

                        Supports:

                        • RF24 radio
                        • Ethernet gateway
                        • Store "eeprom" to a file (thanks to @aaron832 )
                        • MQTT (thanks to @aaron832 )
                        • Can be compiled in a linux machine other than Pi

                        To be implemented:

                        • Store "eeprom" to a file
                        • Serial
                        • MQTT
                        • RF24 interrupts
                        • UDP
                        • Act as a client to connect to a controller

                        I haven't extensively test it, so there are probably some bugs. Any suggestions or ideas for improvement are welcome.

                        b0rmannB 1 Reply Last reply
                        6
                        • aaron832A Offline
                          aaron832A Offline
                          aaron832
                          wrote on last edited by
                          #12

                          Thanks a bunch @marceloaqno for you update to 2.0. Some initial testing shows its working fine. I went ahead and just re-implemented my MQTT addition on top of this branch. Its significantly cleaner and just sits alongside your ethernet implementation. This way you can still connect with a controller via ethernet while getting the benefit of MQTT as well if desired.

                          For the initial changes I created a pull request:
                          https://github.com/marceloaqno/Arduino/pull/2
                          for my branch
                          https://github.com/aaron832/Arduino/tree/feature/MQTTSupport

                          1 Reply Last reply
                          1
                          • hekH Offline
                            hekH Offline
                            hek
                            Admin
                            wrote on last edited by
                            #13

                            Great progress guys!

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

                              Perhaps we should start another topic with a better name so that more people become aware of this port?

                              hekH 1 Reply Last reply
                              1
                              • M marceloaqno

                                Perhaps we should start another topic with a better name so that more people become aware of this port?

                                hekH Offline
                                hekH Offline
                                hek
                                Admin
                                wrote on last edited by
                                #15

                                @marceloaqno
                                Yes, might be a good idea.

                                1 Reply Last reply
                                0
                                • L Offline
                                  L Offline
                                  lafleur
                                  wrote on last edited by
                                  #16

                                  Any plans for RFM69h(w) support??

                                  Thanks

                                  M 1 Reply Last reply
                                  0
                                  • L lafleur

                                    Any plans for RFM69h(w) support??

                                    Thanks

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

                                    @lafleur Do you recommend any RFM69h library that works well in Pi? I could try to add support if there is any.

                                    1 Reply Last reply
                                    1
                                    • L Offline
                                      L Offline
                                      lafleur
                                      wrote on last edited by lafleur
                                      #18

                                      There are a number of ports to the RPI...

                                      http://rdepablos.merlitec.com/mixed/rfm69-library-for-raspberry-pi

                                      http://jeelabs.org/wp-content/uploads/2015/05/20/rfm69-on-raspberry-pi/index.html

                                      https://github.com/etrombly/RFM69

                                      https://123d.circuits.io/circuits/519561-raspberry-pi-and-rfm69hw-interface

                                      http://www.0x1.be/esa/domotic/arduino/node/domotic-howto-rfm69/

                                      and others...

                                      Thanks

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

                                        Just an update, I've been using this port on my raspberry pi during the last months and it has been quite stable, the code is also up to date with the mysensors development branch.

                                        1 Reply Last reply
                                        1
                                        • E Offline
                                          E Offline
                                          emc2
                                          Hardware Contributor
                                          wrote on last edited by
                                          #20

                                          That's great, thanks @marceloaqno

                                          I just started testing but I had to revert to 7d51087e589afb1296e71442fe2164807da399ef to have it working.
                                          Last commit SEGFAULT after

                                          Eth: Listening for connections on 0.0.0.0:5003
                                          

                                          Also, do you have an updated initscript to launch it automatically at boot? It seems the one from the old PiGateway is not working very well with this one. For now I just added a cronjob.

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


                                          9

                                          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