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 kolaf

    @tekka said:

    @kolaf are you using the OTA bootloader?

    No, I haven't figured out that part yet. I'm not even sure if I have available flash memory for this, nor if this is expected to work with the rf69 radios.

    tekkaT Offline
    tekkaT Offline
    tekka
    Admin
    wrote on last edited by
    #264

    @kolaf ok, i was asking because there is an issue wIth the ID assignment and the OTA bl in the dev branch resulting in the scenario you described.

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

      Thanks everybody for the nice work! My initial tests also work out of the box with a serial gateway and humidity node. I will let it run over the weekend to see if there are any issues coming up.

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

        I have serial gateway running on a MoteinoMega and a node running on a Moteino with RFM69HW radios... Using the 2April2015 build of the development arm... with the addition of the :

        //MyTransportRFM69 transport;
        MyTransportRFM69 transport(RFM69_FREQUENCY, RFM69_NETWORKID, RF69_SPI_CS, RF69_IRQ_PIN, true, RF69_IRQ_NUM);

        and the correct pin-out for the radios and LED for these boards...

        I needed to mod the MsTimer2.cpp file to add 'AVR_ATmega1284P ' to each of the #ifdef line to support the Mega

        As I do not yet have a controller running, I see the gateway output as below when the node TX's:

        0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:255;255;3;0;3;

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

          I need a simple controller that can plot data that can be viewed on a web server... Mac/Pi or ??
          want hr/day/week/mo/yr plots..

          what do you recommend??

          1 Reply Last reply
          0
          • K kolaf

            @reddy11 I had to do the same, although I did the change in the default parameters for the function definition since all my radios are HW :-).

            I'm not using the MQTT gateway, I'm using the serial gateway together with a Perl script someone here made which functions as a MQTT gateway, and which I modified to handle node ID assignments.

            R Offline
            R Offline
            reddy11
            wrote on last edited by
            #268

            @kolaf I gave up on getting the MQTT gateway working. I just dont think there is enough memory in my moteino to use the rf69 and the uipethernet library. I was able to get it to work, but it would crash after a few min. When I updated to the latest UIPEthernet library for the 1.5 series, It was too large to upload. So....anyway...can you elaborate on, or point me to the serial-mqtt script you were referring to?
            Thanks!

            K 1 Reply Last reply
            0
            • R reddy11

              @kolaf I gave up on getting the MQTT gateway working. I just dont think there is enough memory in my moteino to use the rf69 and the uipethernet library. I was able to get it to work, but it would crash after a few min. When I updated to the latest UIPEthernet library for the 1.5 series, It was too large to upload. So....anyway...can you elaborate on, or point me to the serial-mqtt script you were referring to?
              Thanks!

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

              @reddy11 Sure, you can find it here: https://github.com/Yveaux/MySensors_MQTTGateway

              You will want to use version 2 of the script.

              It does simple note ID assignments by keeping a list of all ids it has seen and choosing the first ID not in this list when receiving an ID request.

              There are some dependencies, but you will notice that as you start the script :-)

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nikorun
                wrote on last edited by
                #270

                Hi,

                i've tried to scroll back many of the pages of this thread, to find out how to use the Radiohead version of mysensors but with no success, considering that i don"t understand many of those things said here ... :-(

                Is there someone that can help me a little and give me a minimalist modop ? i've used Radiohead on its own with 3 moteinos but mooving to MySensors seem to be the best way to integrate them in a standard domotix architecture ... i currently use Jeedom for a year now.

                Of course, you'll have my feedbacks ...

                Nicolas

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

                  Use the development branch (https://github.com/mysensors/Arduino/tree/development/libraries/MySensors)
                  and enable MyTransportRFM69 transport layer in gateway and sensor.

                  Uncomment this line for gateway (and use the same setup for sensor):
                  https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/examples/SerialGateway/SerialGateway.ino#L63

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    nikorun
                    wrote on last edited by
                    #272

                    Hello Hek,

                    Thanks for your answer, I will try this as soon as I'll be back home.

                    When you say* "uncomment this line ..."* , do I have to comment the previous one (MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);) ?
                    Furthermore, as described in your exemple, the line to be uncommented has no argument but in a previous post reddy11 has to add several ones:
                    MyTransportRFM69 transport(RFM69_FREQUENCY, RFM69_NETWORKID, RF69_SPI_CS, RF69_IRQ_PIN, true, RF69_IRQ_NUM);

                    Is it only due to the "H" version of the module ?

                    Again, thanks for your time. I really think Radiohead is a impressive library as well as MySensor si very smart , the both should be terrible !!!

                    Nicolas

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

                      Yes, disable or remove the MyTransportNRF24 transport line.

                      If you write

                      MyTransportRFM69 transport;
                      

                      It will use default constructor arguments defined here:
                      https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/MyTransportRFM69.h#L33
                      and here:
                      https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/MyConfig.h#L129-L133

                      1 Reply Last reply
                      0
                      • N Offline
                        N Offline
                        nikorun
                        wrote on last edited by
                        #274

                        Hello,

                        Well ... things are not going the way I expected. i have done a fresh install of Arduino 1.6.4 on my Windows PC, then Downloaded the zip from devellopment branch and extracted it in the Sketch directory.
                        Then I have opened the .\libraries\MySensors\examples\SerialGateway\SerialGateway.cpp (wich also opens GatewayUtil.h).
                        Then I compiled it :

                        • The first error was : "... \MyHwATMega328.cpp:22:22: fatal error: LowPower.h: No such file or directory" , I solved it by copying the requested files in the MySensor directory
                        • The second error then was : " .... LowPower.h:4:6: error: multiple definition of 'enum period_t'", I solved it by deleting the corresponding def in LowPower.h

                        Other errors happened so I thought that there was probably another problem, in my install or something else.

                        I also tried with 1.0.5 but it failed too.

                        I don't want to spend much off all your time but as you hepled me, I'm must at least inform you of what happens with my experience .... of course if some of you have a luminous idea about what is going on with my install, I'm (very) interested.

                        Nicolas

                        Rq : I have tried to search some help in this thread and on google but I guess if a lot of little problems are coming up, it must be a global problem with my PC .

                        Bye

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

                          LowPower library shouldn't be needed any more if you're using the latest code in development branch.

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

                            @kolaf Do you run any of your node off batteries if you do what is you current consumption?

                            1 Reply Last reply
                            0
                            • N Offline
                              N Offline
                              nikorun
                              wrote on last edited by
                              #277

                              Hi,

                              Just wanna say that I've finaly compiled the sketch, on another computer....
                              I've tested it succesfully with SerialGateway and LightSensor.
                              As I have a high power module, I had to change the transport declaration as mentionned before:
                              MyTransportRFM69 transport(RFM69_FREQUENCY, RFM69_NETWORKID, RF69_SPI_CS, RF69_IRQ_PIN, true, RF69_IRQ_NUM)
                              it works well for me but I had to change the RFM69 frequency in Myconfig.h, by uncommenting
                              #define RFM69_FREQUENCY RF69_433MHZ
                              and of course commenting
                              //#define RFM69_FREQUENCY RF69_868MHZ

                              To use LightSensor , I changed some declarations in LighSensor.ino. Instead of simply have :
                              MySensor gw;

                              I had to declarations before to use the RFM69 module :
                              MyTransportRFM69 radio;
                              MyHwATMega328 hw;
                              MySensor gw(radio, hw);

                              I tested it with the excellent Windos GUI Controller made by tekka and found here

                              Again thanks for your help, I'm now trying to use it with Jeedom, It doesn't work yet but ... it's another story ...:-)

                              Bye

                              1 Reply Last reply
                              0
                              • nagelcN Offline
                                nagelcN Offline
                                nagelc
                                wrote on last edited by
                                #278

                                Does anyone have a MQTT gateway working with the RFM69?
                                I've been using a MQTT gateway with the W5100 / NRF24 (soft SPI) from the MySensors 1.4 branch -- works well.
                                I have a RFM69 serial gateway working from the development branch.
                                My first attempt at an MQTT gateway with the RFM69 (soft SPI) and W5100 hangs up in the gw.begin() function. I wasn't sure what to do about the RFM69 interrupt line. Before digging any deeper, I was hoping someone might have worked this out already.

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

                                  I'm still having some problems with the sensors being a bit unreliable. For instance, I have a Power sensor that detects LED blinks off my power meter and switches its own LED at every blink so that I can actually see if anything is happening. This works fine for several days, and power usage reports are sent to the gateway at regular intervals (two minutes), but then suddenly the power reports stop. The LED keeps blinking, indicating that the sketch is actually doing what it is supposed to, but for some reason the radio stops doing anything.

                                  I have also had this happen on the gateway, the radio stopped responding after some time even though the sketch seems to be running. This is both on the moteino and anarduino with the RF 69 radios.

                                  I have no idea what is causing this, but my best guess is that some kind of buffer is overrun, or maybe a counter?

                                  Not really sure how to debug a problem like this, but I think the first attempt will be to try to reinitialise the radio after a specific amount of time to see if this clears the problem. The time before the issues occur can vary from 10 hours to 5 days, though, so it is a bit difficult to test...

                                  1 Reply Last reply
                                  0
                                  • rvendrameR Offline
                                    rvendrameR Offline
                                    rvendrame
                                    Hero Member
                                    wrote on last edited by
                                    #280

                                    @kolaf, how are you powering the radio? Cheap phone chargers usually introduce noise into the power line, which drives the radio crazy. A capacitor between radio VCC / GND help in some circumstances: :

                                    http://www.mysensors.org/build/connect_radio

                                    Home Assistant / Vera Plus UI7
                                    ESP8266 GW + mySensors 2.3.2
                                    Alexa / Google Home

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

                                      The radio is integrated into the Arduino board, so it is difficult for me to do anything with the radio VCC line. Anyway, the gateway is powered directly by the computer, home of the power sensor is powered by a Samsung charger which should be relatively good quality?

                                      1 Reply Last reply
                                      0
                                      • rvendrameR Offline
                                        rvendrameR Offline
                                        rvendrame
                                        Hero Member
                                        wrote on last edited by
                                        #282

                                        @kolaf, maybe you could replace the charger by another one, just to see if something changes. The radio is really sensitive to power fluctuations (while arduino itself isn't).

                                        Home Assistant / Vera Plus UI7
                                        ESP8266 GW + mySensors 2.3.2
                                        Alexa / Google Home

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

                                          @kolaf I run the same setup now for more than a 2 month and don't have this issue. For now I am running the power sensor of battery as my meter is outside my house as there is no 220 plug to run it off power supply. I still have a very small RF69 sensor network. I have 10 NRF24 sensor that I am now converting to RF69. Can this issue that you experience be to the size of your sensor network?

                                          Here is some data from my power sensor for this week:

                                          upload-5bf9e128-6d52-4128-87a9-9802f06a7aee

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


                                          14

                                          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