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. Porting MySensors to work with the RadioHead library

Porting MySensors to work with the RadioHead library

Scheduled Pinned Locked Moved Development
portingradiohead
288 Posts 24 Posters 187.4k Views 12 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.
  • K Offline
    K Offline
    kolaf
    Hero Member
    wrote on last edited by kolaf
    #183

    I managed to resolve my git problem, but I'm now back to a problem we have discussed before.

    The problem is with how I should include the driver in order to use it without having to modify the header of every driver file. Can't seem to find what we landed on last time...

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

      You mean every sketch file?

      Guess you'll have to do like we did with rf24 and add it to the utility folder. Or maybe I misunderstand the question.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kolaf
        Hero Member
        wrote on last edited by
        #185

        I mean that I have to place the RadioHead library inside the main my sensors folder for everything to work. If I were to place it in the "utility" folder, I would have to change every include inside the library to use" instead of brackets.

        Anyway, I have gotten it to compile, and there is some radio communication going on. Trouble is that there seems to be some issues with the buffer sizes (I guess?).

        Here was what the sensor is sending:
        find parent
        send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,st=bc:

        And this is what the Gateway is receiving (with an additional debug message from me):
        0;0;3;0;9;read: 0-0-0 s=255,c=3,t=6,pt=1,l=1:0
        0;0;3;0;9;version: 0
        0;0;3;0;9;version mismatch

        Obviously something is getting mangled along the way...

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

          Good that something is transmitted.

          But should you really use RadioHead? That seems a bit redundant.

          Felix over at LowPowerLab directed me to: https://github.com/LowPowerLab/RFM69/

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kolaf
            Hero Member
            wrote on last edited by
            #187

            I got something working with a new library. Requesting node ID, and sending all initialisation stuff seems to work correctly. I was not able to place the libraries in the correct place this time either, but perhaps you can move them and re-factor the code?

            I created a pulled request so that you can look at it.

            This is happening in the gateway with the new code:
            0;0;3;0;14;Gateway startup complete.
            0;0;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
            0;0;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
            0;0;3;0;9;read: 0-1-1 s=255,c=3,t=8,pt=1,l=1:0
            0;0;3;0;9;send: 0-0-0-1 s=255,c=3,t=8,pt=1,l=1,st=fail:0
            0;0;3;0;9;read: 1-1-0 s=255,c=3,t=6,pt=1,l=1:0
            1;255;3;0;6;0
            0;0;3;0;9;read: 1-1-0 s=255,c=3,t=11,pt=0,l=13:Wave switch 3
            1;255;3;0;11;Wave switch 3
            0;0;3;0;9;read: 1-1-0 s=255,c=3,t=12,pt=0,l=3:1.1
            1;255;3;0;12;1.1
            0;0;3;0;9;read: 1-1-0 s=1,c=0,t=3,pt=0,l=3:1.4
            1;1;0;0;3;1.4
            0;0;3;0;9;read: 1-1-0 s=3,c=0,t=6,pt=0,l=3:1.4
            1;3;0;0;6;1.4
            0;0;3;0;9;read: 1-1-0 s=2,c=2,t=2,pt=0,l=3:1.4
            1;2;2;0;2;1.4
            0;0;3;0;9;read: 1-1-0 s=1,c=1,t=2,pt=2,l=2:0
            1;1;1;0;2;0
            0;0;3;0;9;read: 1-1-0 s=3,c=1,t=0,pt=7,l=5:23.2
            1;3;1;0;0;23.2
            0;0;3;0;9;read: 1-1-0 s=3,c=1,t=0,pt=7,l=5:23.3
            1;3;1;0;0;23.3

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

              Great @kolaf. I'll take a look.

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

                Ok merged! Seems to compile fine with the library in utility after some minimal changes. Thanks @kolaf.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kolaf
                  Hero Member
                  wrote on last edited by
                  #190

                  Excellent. I took a quick look at the changes you did to move the library, I'm a bit ashamed that I didn't manage to do that myself...

                  I'm very happy to have a solution in the development branch that allows the radios I bought to be brought along into the future of MySensors :-)

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bbbio24
                    wrote on last edited by
                    #191

                    Since I have four moteino , I wanted to test your code. Unfortunately, I have made ​​a mistake , because the compiler return this error :

                    In file included from My_Sensor.ino:2:
                    C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:32:1: warning: "debug" redefined
                    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:16,
                    from My_Sensor.ino:2:
                    C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriver.h:9:1: warning: this is the location of the previous definition
                    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors/MyConfig.h:27,
                    from C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:17,
                    from My_Sensor.ino:2:
                    C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriverRF69.h:40: error: ISO C++ forbids initialization of member 'radio'
                    C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriverRF69.h:40: error: making 'radio' static
                    C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriverRF69.h:40: error: invalid in-class initialization of static data member of non-integral type 'RFM69*'

                    hekH 1 Reply Last reply
                    0
                    • B bbbio24

                      Since I have four moteino , I wanted to test your code. Unfortunately, I have made ​​a mistake , because the compiler return this error :

                      In file included from My_Sensor.ino:2:
                      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:32:1: warning: "debug" redefined
                      In file included from C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:16,
                      from My_Sensor.ino:2:
                      C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriver.h:9:1: warning: this is the location of the previous definition
                      In file included from C:\Program Files (x86)\Arduino\libraries\MySensors/MyConfig.h:27,
                      from C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:17,
                      from My_Sensor.ino:2:
                      C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriverRF69.h:40: error: ISO C++ forbids initialization of member 'radio'
                      C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriverRF69.h:40: error: making 'radio' static
                      C:\Program Files (x86)\Arduino\libraries\MySensors/MyDriverRF69.h:40: error: invalid in-class initialization of static data member of non-integral type 'RFM69*'

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

                      @bbbio24

                      IDE version?

                      B 1 Reply Last reply
                      0
                      • FrancoisF Offline
                        FrancoisF Offline
                        Francois
                        wrote on last edited by
                        #193
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • FrancoisF Offline
                          FrancoisF Offline
                          Francois
                          wrote on last edited by
                          #194
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • FrancoisF Offline
                            FrancoisF Offline
                            Francois
                            wrote on last edited by
                            #195

                            Hi I now have my first MySensor RFM69 node up and running in PiDome :-) :+1: This is great as with the NFR24L01 I battle to get coverage in my House. I put the RFm69 node in the farthest point in my house any it just work. To get the NFR24L01+ to work at the same location I have to use an repeater node. The other thing I like about the RFM69 solution like Moteino (https://lowpowerlab.com) or Anarduino (http://www.anarduino.com/miniwireless) is the size you don't have to use any wires to connected the radio and it comes fitted to the arduino board. So if you look for a small sensor I think that this is the way to go for automation.

                            AnticimexA 1 Reply Last reply
                            0
                            • FrancoisF Francois

                              Hi I now have my first MySensor RFM69 node up and running in PiDome :-) :+1: This is great as with the NFR24L01 I battle to get coverage in my House. I put the RFm69 node in the farthest point in my house any it just work. To get the NFR24L01+ to work at the same location I have to use an repeater node. The other thing I like about the RFM69 solution like Moteino (https://lowpowerlab.com) or Anarduino (http://www.anarduino.com/miniwireless) is the size you don't have to use any wires to connected the radio and it comes fitted to the arduino board. So if you look for a small sensor I think that this is the way to go for automation.

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

                              @Francois Cool! Is this compatible with RF24, as in, you can have RF24 based GW and other sensors, and "plug in" a RFM69 unit? With its better RF properties it sounds like an excellent candidate for use as repeater node as well.
                              Or is it required to set up a separate GW?

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

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

                                You cannot mix radios in one network.

                                AnticimexA 1 Reply Last reply
                                0
                                • hekH hek

                                  You cannot mix radios in one network.

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

                                  @hek ok, så it is a different carrier frequency, or modulation, and not protocol-compatible on the "physical" layer? Pity.

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

                                  1 Reply Last reply
                                  0
                                  • hekH hek

                                    @bbbio24

                                    IDE version?

                                    B Offline
                                    B Offline
                                    bbbio24
                                    wrote on last edited by bbbio24
                                    #199

                                    @hek IDE Version : 1.0.5 r2
                                    I tried with version 1.0.6 without success.

                                    CARSTENC 1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      ToSa
                                      Code Contributor
                                      wrote on last edited by
                                      #200

                                      @kolaf
                                      I've been busy with other stuff for some time but looking at the driver separation now once again. With nRF24 working (even bootloader adjusted to pick the right header files etc.) and two Moteinos at hand (Moteino RFM69W 868/915), I compiled and flashed a serial gateway and a simple temperature sensor node. Both appear to work fine looking at the debug messages except the fact that they don't listen to eachother. Both are sending but none is receiving anything (2m distance).
                                      I did not touch or even closely look at the RFM69 driver code yet but will try to do so over the weekend. Do you have any hint where to check first?

                                      L 1 Reply Last reply
                                      0
                                      • T Offline
                                        T Offline
                                        ToSa
                                        Code Contributor
                                        wrote on last edited by
                                        #201

                                        I have the RFM69 setup working now with a couple of additional tweaks mainly for code optimization. Working fine for some time but stops after a few hours - I'll have a closer look the next couple of days.
                                        Felix added three bytes to the payload (source address / destination address / control byte) to manage the acknowledge etc. in the lowpowerlab library. For our specific needs this is redundant as the current message format in development already includes this data. The three additional bytes are not that bad though and I'd propose to leave it like that for now and reconsider when we get to the revised message format :).

                                        blaceyB 1 Reply Last reply
                                        0
                                        • T ToSa

                                          I have the RFM69 setup working now with a couple of additional tweaks mainly for code optimization. Working fine for some time but stops after a few hours - I'll have a closer look the next couple of days.
                                          Felix added three bytes to the payload (source address / destination address / control byte) to manage the acknowledge etc. in the lowpowerlab library. For our specific needs this is redundant as the current message format in development already includes this data. The three additional bytes are not that bad though and I'd propose to leave it like that for now and reconsider when we get to the revised message format :).

                                          blaceyB Offline
                                          blaceyB Offline
                                          blacey
                                          Admin
                                          wrote on last edited by
                                          #202

                                          @ToSa :+1::+1::+1:

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


                                          7

                                          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