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
    #208

    @TOSA I just popped back into the forum to report on my experiences with instabilities using the current version of the RFM69 code only to find that you have already had the same experience. This makes me quite happy since it means that at least someone else have had a chance to think a bit about it. On a side note, I really wish this forum had some functionality to subscribe to topics, it is not a forum I visit regularly enough to catch everything that's happening.

    I do not have any good information regarding why the microcontrollers stop responding, but I see it quite regularly in both the Gateway and in the sensors. For instance, I have a power measuring sensor that counts the blinks on my power meter and toggles a LED each time the power meter blinks. I have to reset this about every two days (sometimes more often) when I see that the LED no longer blinks. All my current sensors are running the first version of the code based on your rewritten radio obstructions.

    Please let me know if there's anything I can do to help out with debugging this. The instability is starting to get quite frustrating, and I was actually considering to go back to my earlier prototype implementation based on the radiohead library. I did not experience any such instabilities using this library, so at least we know it is not a hardware problem. As such it shouldn't be too difficult to figure out. Maybe it is possible to discuss this with the lowpowerlabs guy who developed the library?

    Unfortunately my experience with debugging microcontrollers is limited, but I will help out where I can.

    1 Reply Last reply
    0
    • FrancoisF Offline
      FrancoisF Offline
      Francois
      wrote on last edited by
      #209

      @ToSa I am running this version and I don't have any problems with it so far. I only have one node up and running with a humility sensor. I order 5 more Anarduino units and hope to get them in Jan so will do more testing then. The humility node is up and running now for more than 3 weeks with out any resets.

      1 Reply Last reply
      0
      • T ToSa

        RFM69 is stable now for >48h.
        The OTA bootloader version for RFM69 is in progress. I'm stuck right now where the node debug messages show that it's sending a packet but the gateway doesn't receive anything... I moved the full initialization code back in that I thought would be ok to skip but still the same behavior. Only difference to the full blown driver at this point is that I don't attach the interrupt but that should not be relevant for tx as I'm polling the interrupt register for status (ready to send / send complete etc.).

        K Offline
        K Offline
        kolaf
        Hero Member
        wrote on last edited by
        #210

        @ToSa How did you make the RF69 stable?

        1 Reply Last reply
        0
        • CARSTENC CARSTEN

          I used the Mysensors 1.4.1 library and managed to get a UNO with Ethernet shield and NRF24L01+PA+LNA working as an MQTT gateway.
          I then changed the library to the latest development library (downloaded on 01.12.2014) and uploaded the MQTT gateway setch to the same hardware -> Also worked fine.
          I then changed MyConfig.h to use the RF69 radio instead of NRF24 and just tried to compile. I got a lot of errors:
          MQTT_Gateway_Compile_errors.txt

          I am using Arduino IDE 1.5.8

          I am happy to help with testing, but I am afraid my programming skills are not good enough to assist with that.

          nagelcN Offline
          nagelcN Offline
          nagelc
          wrote on last edited by
          #211

          @CARSTEN I got the same compile errors. It turns out Arduino IDE 1.5.7 and above have a new compiler which requires PROGMEM data to be const.
          See this discussion: http://forum.arduino.cc/index.php?topic=277173.0

          I was able to resolve the compile errors by adding const where flagged by the compiler:
          In MyMQTT.h:
          . . . .
          const char V_0[] PROGMEM = "TEMP"; //V_TEMP
          etc . ..

          Then:
          const char * const vType[] PROGMEM = {
          V_0, V_1, . . . .

          You also need to change the getType function in MQTTGateway.ino to account for the change in type of vType[]
          char *getType(char *b, const char * const *index) { . . . .

          Compiled with no errors for RFM69 on Arduino 1.5.8 after these changes.
          I have not had a chance to upload and test on my Motineo's.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            guillaume brucker
            wrote on last edited by guillaume brucker
            #212

            Hi all,

            Happy new year
            I've just have the same idea, I'm new to arduino since chrismas :)
            and I want to test mysensor with nrf905, It seem to be compatible with RH librairies.

            Could you just say me what i have to do ?
            I'll have to include the kolaf librairies ?

            Just, If you have a link to the repository in order to work on it with you

            Thanks for all

            1 Reply Last reply
            0
            • G Offline
              G Offline
              guillaume brucker
              wrote on last edited by
              #213

              So, I'm working on it with the developpement branch of mysensor.

              I've find some nrf905 librairies arround the web, but the RadioHead seem to be more powerfull and complete.
              I'll give you news soon,

              First of all, i probably need help to diagnose because i've had only one raspberry, one arduino and two atmega328p chipset more

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andrewm844
                wrote on last edited by
                #214

                Did anyone ever solve the this compile error?

                In file included from /home/andrew/sketchbook/libraries/MySensors/MyConfig.h:27,
                from /home/andrew/sketchbook/libraries/MySensors/MySensor.h:17,
                from SerialGateway.ino:27:
                /home/andrew/sketchbook/libraries/MySensors/MyDriverRF69.h:40: error: ISO C++ forbids initialization of member ‘radio’
                /home/andrew/sketchbook/libraries/MySensors/MyDriverRF69.h:40: error: making ‘radio’ static
                /home/andrew/sketchbook/libraries/MySensors/MyDriverRF69.h:40: error: invalid in-class initialization of static data member of non-integral type ‘RFM69*’

                I have tried with IDEs 1.04, 1.05 and 1.06

                G 1 Reply Last reply
                0
                • A andrewm844

                  Did anyone ever solve the this compile error?

                  In file included from /home/andrew/sketchbook/libraries/MySensors/MyConfig.h:27,
                  from /home/andrew/sketchbook/libraries/MySensors/MySensor.h:17,
                  from SerialGateway.ino:27:
                  /home/andrew/sketchbook/libraries/MySensors/MyDriverRF69.h:40: error: ISO C++ forbids initialization of member ‘radio’
                  /home/andrew/sketchbook/libraries/MySensors/MyDriverRF69.h:40: error: making ‘radio’ static
                  /home/andrew/sketchbook/libraries/MySensors/MyDriverRF69.h:40: error: invalid in-class initialization of static data member of non-integral type ‘RFM69*’

                  I have tried with IDEs 1.04, 1.05 and 1.06

                  G Offline
                  G Offline
                  guillaume brucker
                  wrote on last edited by
                  #215

                  @andrewm844
                  Hi,
                  I'm working on 905, so I don't have to check the 69, but I've the same compile error
                  I just replace
                  // RFM69 *radio = NULL;
                  RFM69 *radio;
                  in the MyDriverRF69.h file

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    BenjaminK87
                    wrote on last edited by
                    #216

                    Hi everyone,
                    i am new to MySensors. I already made sime Arduino pro mini running with a NRF24L01.
                    But i also bought some Anarduino with the RF69 installed. Can anybody tell me how i can tell the library to use the RF69 instead of the NRF24L01?
                    I used the Developement version of the MySensor library. I tried to find the point in MyConfig.h but i could only find the NRF24L01 Driver Defaults part.

                    Maybe someone could help me.

                    Thanks in advance.
                    Benjamin

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

                      I'm interested in the progress of getting RadioHead working with MySensor....

                      what the current status??

                      where is the current code for this effort?

                      Thanks

                      hekH 1 Reply Last reply
                      0
                      • L lafleur

                        I'm interested in the progress of getting RadioHead working with MySensor....

                        what the current status??

                        where is the current code for this effort?

                        Thanks

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

                        @lafleur

                        In the development branch on github we have support for RF69. We have not incorporated the full RadioHead library.

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

                          Is there support for the MoteinoMega? with the rfm69? can you point me to a code base to start with??

                          I have used the MoteinoMega in other project, so I know a bit on how they work

                          Thanks

                          1 Reply Last reply
                          0
                          • T ToSa

                            @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 Offline
                            L Offline
                            lafleur
                            wrote on last edited by
                            #220

                            @ToSa do you have a sample project (serial Gateway or ?) that I could start from that uses the RF69W radio?? Want to develop with Moteino-Mega

                            thanks

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

                              You only need to initiate the MySensor class with the rfm69 class like this in the gateway (and sensors):

                              https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/examples/SerialGateway/SerialGateway.ino#L44

                              MyTransportRF69 radio;  
                              
                              1 Reply Last reply
                              0
                              • L Offline
                                L Offline
                                lafleur
                                wrote on last edited by
                                #222

                                I had done that, getting error...

                                Some questions:

                                I notice that the MyTransportNRF24 had definition for the pins in the function, RM69, has none...
                                I take it, its defaulted to the Moteino standards pinout?

                                The file MyHwATMega328.cpp is for the 328, i assume that I would need to make one for the ATmega1284P chip? if there are any changes needed.

                                Thanks I will work on these error, if you have any insight on cause, please let me know...

                                (sure wish the IDE was better.....)


                                Arduino: 1.6.1 (Mac OS X), Board: "MoteinoMEGA"

                                SerialGateway.ino:56:26: error: no matching function for call to 'MySensor::MySensor(MyTransportRF69 (&)(), MySigningNone&)'
                                SerialGateway.ino:56:26: note: candidates are:
                                In file included from SerialGateway.ino:34:0:
                                /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:78:2: note: MySensor::MySensor(MyTransport&, MyHw&, MySigning&)
                                MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()
                                ^
                                /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:78:2: note: no known conversion for argument 1 from 'MyTransportRF69()' to 'MyTransport&'
                                /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:69:7: note: MySensor::MySensor(const MySensor&)
                                class MySensor
                                ^
                                /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:69:7: note: candidate expects 1 argument, 2 provided
                                Error compiling.

                                hekH 1 Reply Last reply
                                0
                                • L lafleur

                                  I had done that, getting error...

                                  Some questions:

                                  I notice that the MyTransportNRF24 had definition for the pins in the function, RM69, has none...
                                  I take it, its defaulted to the Moteino standards pinout?

                                  The file MyHwATMega328.cpp is for the 328, i assume that I would need to make one for the ATmega1284P chip? if there are any changes needed.

                                  Thanks I will work on these error, if you have any insight on cause, please let me know...

                                  (sure wish the IDE was better.....)


                                  Arduino: 1.6.1 (Mac OS X), Board: "MoteinoMEGA"

                                  SerialGateway.ino:56:26: error: no matching function for call to 'MySensor::MySensor(MyTransportRF69 (&)(), MySigningNone&)'
                                  SerialGateway.ino:56:26: note: candidates are:
                                  In file included from SerialGateway.ino:34:0:
                                  /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:78:2: note: MySensor::MySensor(MyTransport&, MyHw&, MySigning&)
                                  MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()
                                  ^
                                  /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:78:2: note: no known conversion for argument 1 from 'MyTransportRF69()' to 'MyTransport&'
                                  /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:69:7: note: MySensor::MySensor(const MySensor&)
                                  class MySensor
                                  ^
                                  /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:69:7: note: candidate expects 1 argument, 2 provided
                                  Error compiling.

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

                                  @lafleur

                                  Yeah, the work on the TransportRF69 need some polishing. It defaults to monteino pins right now. If you have the time add configuration to the driver, please help out.

                                  I don't have any MonteinoMega so I really don't know how it differs regarding hw. Hopefully not too much.

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

                                    I get the same error's if I select the standard Moteino and the RF24 radio???

                                    so, I must have a version skew or IDE issue...

                                    I'm using the source code form the development branch....

                                    Arduino: 1.6.1 (Mac OS X), Board: "Moteino"

                                    SerialGateway.ino:57:26: error: no matching function for call to 'MySensor::MySensor(MyTransportNRF24&, MySigningNone&)'
                                    SerialGateway.ino:57:26: note: candidates are:
                                    In file included from SerialGateway.ino:34:0:
                                    /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:78:2: note: MySensor::MySensor(MyTransport&, MyHw&, MySigning&)
                                    MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()
                                    ^
                                    /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:78:2: note: no known conversion for argument 2 from 'MySigningNone' to 'MyHw&'
                                    /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:69:7: note: MySensor::MySensor(const MySensor&)
                                    class MySensor
                                    ^
                                    /Users/lafleur/Desktop/MySensor-Arduino-development/libraries/MySensors/MySensor.h:69:7: note: candidate expects 1 argument, 2 provided
                                    Error compiling.

                                    This report would have more information with
                                    "Show verbose output during compilation"
                                    enabled in File > Preferences.

                                    1 Reply Last reply
                                    0
                                    • ? Offline
                                      ? Offline
                                      A Former User
                                      wrote on last edited by
                                      #225

                                      @lafleur:
                                      I got the same error, also 1.6.1 (Mac OSX) board Uno, and Nano. My solution was to remove the signing object in the initialization:

                                      // Construct MySensors library
                                      MySensor gw(radio);
                                      

                                      Then it compiles without issues. I have other issues though, but they might be related to the radios.

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

                                        removing the Construct object, will cause other error, as the gw is not defined at this point...

                                        SerialGateway.ino: In function 'void setup()':
                                        SerialGateway.ino:67:3: error: 'gw' was not declared in this scope
                                        SerialGateway.ino: In function 'void loop()':
                                        SerialGateway.ino:85:3: error: 'gw' was not declared in this scope

                                        I'm new to Arduino and this IDE, so it painful trying to work my way into this code...

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

                                          Hi guys,

                                          I lost some of my inspiration when I couldn't get the RF69 implementation to be stable for more than a few days and TOSA said he could before he disappeared without telling me how :-(. However, Easter is upon us and I thought I would give it another try.

                                          I updated to the latest version of the development branch, and things seem to have changed a bit since I was here last time. Is there anything that needs to be updated on the RF69 side? At the very least it seems to be missing a definition for IS_RF69HW, as well as probably some useful defaults.

                                          1 Reply Last reply
                                          0
                                          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