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. ESP8266 RFM69 gateway

ESP8266 RFM69 gateway

Scheduled Pinned Locked Moved Development
21 Posts 5 Posters 7.6k Views 4 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.
  • chrilleC chrille

    @korttoma I'm looking forward to hear your results, as I couldn't get it to work with RFM69. However, there doesn't seem to be transport specific code for indication(), so I really don't understand why it works with NRF and not RFM

    korttomaK Offline
    korttomaK Offline
    korttoma
    Hero Member
    wrote on last edited by
    #1

    @chrille how did you connect the IRQ pin (DI00 on the RFM69) ?
    I connected IRQ (DI00 of RFM69) to GPIO4 (ESP8266) and added the following line to the sketch:

    #define MY_RF69_IRQ_PIN 4
    

    sorry to hijack the thread with RFM69 issues

    • Tomas
    chrilleC 2 Replies Last reply
    0
    • korttomaK korttoma

      @chrille how did you connect the IRQ pin (DI00 on the RFM69) ?
      I connected IRQ (DI00 of RFM69) to GPIO4 (ESP8266) and added the following line to the sketch:

      #define MY_RF69_IRQ_PIN 4
      

      sorry to hijack the thread with RFM69 issues

      chrilleC Offline
      chrilleC Offline
      chrille
      wrote on last edited by
      #2

      @korttoma I am at work now, but I'll share relevant part of the sketch and the schematic tonight

      korttomaK 1 Reply Last reply
      0
      • chrilleC chrille

        @korttoma I am at work now, but I'll share relevant part of the sketch and the schematic tonight

        korttomaK Offline
        korttomaK Offline
        korttoma
        Hero Member
        wrote on last edited by
        #3

        @chrille ok, please start a new thread for this so we don't clutter this one with RFM69 issues.

        • Tomas
        mfalkviddM 1 Reply Last reply
        0
        • korttomaK korttoma

          @chrille ok, please start a new thread for this so we don't clutter this one with RFM69 issues.

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

          @korttoma I forked the thread (from this). Let me know if you want additional adjustments.

          1 Reply Last reply
          0
          • korttomaK korttoma

            @chrille how did you connect the IRQ pin (DI00 on the RFM69) ?
            I connected IRQ (DI00 of RFM69) to GPIO4 (ESP8266) and added the following line to the sketch:

            #define MY_RF69_IRQ_PIN 4
            

            sorry to hijack the thread with RFM69 issues

            chrilleC Offline
            chrilleC Offline
            chrille
            wrote on last edited by chrille
            #5

            As promised a short description of my ESP8266/RFM69 gateway.

            I made several attempts on building a gateway on breadboards/veroboards, but they didn't work well (NRF24 worked fine). The RF part was very sensible. I either had to touch the antenna with a finger to get things working, or move the antenna away from the board. Eventually I decided to try to make a real PCB. It was also a good excuse to get back into making my own PCB's as the last one I made was made with OrCAD under MSDOS, more than 20 years ago!

            This is the schematic:

            0_1474307652006_mysensors-esp8266-rfm69.png

            And the finished PCB - top layer:

            0_1474307730463_IMG_2991.JPG

            ...and the bottom layer with the RFM69

            0_1474307749939_IMG_2992.JPG

            A few comments:
            All passives are 0805 which are pretty easy to solder.
            The library I used for ESP8266 have GPIO4 and 5 swapped, which means SDA and SCL are swapped on J1. Not a big issue for a gateway, but I decided to include I2C support for display or local sensors
            I added the ATSHA204, because there was room on the board - I think I screwed up on this, since this is the 8-pin version and everyone else uses the 3-pin version with the proprietary Atmel interface.
            PCB's was ordered from Dirty PCB's and showed up in approx 3 weeks - it's a 1.6 mm PCB - next time I should order 1.2 mm PCB's to avoid having to bend the legs on the SMA connector

            On the positive side - it works. No issues with touching the antenna and the ESP8266 doesn't crash. I2C is also tested with a different (non-MySensors) sketch. ATSHA support is untested and probably doesn't work.

            The reason for using GPIO16 as chip-select, is because chip select doesn't need a hardware interrupt and it frees up GPIO4+5 for I2C

            The radio related part of the sketch:

            #define MY_RADIO_RFM69
            #define MY_RFM69_FREQUENCY   RF69_868MHZ
            #define MY_RF69_IRQ_PIN 15
            #define MY_RF69_SPI_CS 16
            #define MY_IS_RFM69HW true
            // #define MY_RFM69_ENABLE_ENCRYPTION true
            
            1 Reply Last reply
            3
            • korttomaK Offline
              korttomaK Offline
              korttoma
              Hero Member
              wrote on last edited by korttoma
              #6

              Nice @chrille very professional.
              I think I miss understood you a bit. I thought your ESP/RFM69 gateway did not work att all but you meant that the local WebServer did not work right?

              I have not tried the WebServer thing yet.

              • Tomas
              chrilleC 1 Reply Last reply
              0
              • korttomaK korttoma

                Nice @chrille very professional.
                I think I miss understood you a bit. I thought your ESP/RFM69 gateway did not work att all but you meant that the local WebServer did not work right?

                I have not tried the WebServer thing yet.

                chrilleC Offline
                chrilleC Offline
                chrille
                wrote on last edited by
                #7

                @korttoma said:

                I think I miss understood you a bit. I thought your ESP/RFM69 gateway did not work att all but you meant that the local WebServer did not work right?

                The RFM69/ESP8266 have been working very well, since I started using the "real" PCB instead of the breadboard. As for the webserver feature - it does not work for me, when using RFM69 radios. I'm currently trying to find out what's happening

                • Jan
                mfalkviddM 1 Reply Last reply
                0
                • chrilleC chrille

                  @korttoma said:

                  I think I miss understood you a bit. I thought your ESP/RFM69 gateway did not work att all but you meant that the local WebServer did not work right?

                  The RFM69/ESP8266 have been working very well, since I started using the "real" PCB instead of the breadboard. As for the webserver feature - it does not work for me, when using RFM69 radios. I'm currently trying to find out what's happening

                  • Jan
                  mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by
                  #8

                  Very nice work @chrille !

                  1 Reply Last reply
                  0
                  • korttomaK Offline
                    korttomaK Offline
                    korttoma
                    Hero Member
                    wrote on last edited by korttoma
                    #9

                    @chrille so I tried the WebServer according to the instructions given by @Japio.
                    My Gateway is still working and the WebPage shows up but only the Gateway messages sent counter is increasing.
                    The Gateway messages received value remains zero.
                    "Running for" value seems to be working.

                    I also added the lines you suggested about the Free memory and WiFi signal and I see:

                    Free memory: 40456 bytes
                    WIFI signal: -77dBm

                    Anything else I can try?

                    • Tomas
                    1 Reply Last reply
                    0
                    • scalzS Offline
                      scalzS Offline
                      scalz
                      Hardware Contributor
                      wrote on last edited by scalz
                      #10

                      @chrille nice ;) a little advice if you're ok, that would have been better if you had nothing under your esp8266 antenna (no routes or gnd plane near the ant).

                      YveauxY chrilleC 2 Replies Last reply
                      0
                      • scalzS scalz

                        @chrille nice ;) a little advice if you're ok, that would have been better if you had nothing under your esp8266 antenna (no routes or gnd plane near the ant).

                        YveauxY Offline
                        YveauxY Offline
                        Yveaux
                        Mod
                        wrote on last edited by
                        #11

                        @korttoma said:

                        only the Gateway messages sent counter is increasing

                        I had a look at the code. The indications are only implemented for TX on MQTT- and serial Gateway, which is a bug.
                        Ref. https://github.com/mysensors/MySensors/issues/585

                        http://yveaux.blogspot.nl

                        1 Reply Last reply
                        1
                        • korttomaK Offline
                          korttomaK Offline
                          korttoma
                          Hero Member
                          wrote on last edited by
                          #12

                          Thanks @Yveaux for looking in to the code. From your post, l am not sure if I should get both tx an rx counts in my setup since I am not using MQTT or serial GW. I have just the ESP/RFM69 gateway an one sensebender sending data. Later when I checked I noticed that the other counter had actual increased also. I need to get another node implemented to my test system to test further but I don't have any more RGM69 modules at the moment.

                          • Tomas
                          chrilleC 1 Reply Last reply
                          0
                          • scalzS scalz

                            @chrille nice ;) a little advice if you're ok, that would have been better if you had nothing under your esp8266 antenna (no routes or gnd plane near the ant).

                            chrilleC Offline
                            chrilleC Offline
                            chrille
                            wrote on last edited by
                            #13

                            @scalz said:

                            @chrille nice ;) a little advice if you're ok, that would have been better if you had nothing under your esp8266 antenna (no routes or gnd plane near the ant).

                            If I make a new board to add support for the 3-pin version of the ATSHA204 and fix the swapped SCL/SDA pins I will take this into account. Thanks for the comment.
                            (I guess the best solution if I want to extend wifi coverage would be to use at ESP-07 with an external antenna - however I don't have issues with wifi coverage for the gateways with my current setup)

                            • Jan
                            1 Reply Last reply
                            0
                            • korttomaK korttoma

                              Thanks @Yveaux for looking in to the code. From your post, l am not sure if I should get both tx an rx counts in my setup since I am not using MQTT or serial GW. I have just the ESP/RFM69 gateway an one sensebender sending data. Later when I checked I noticed that the other counter had actual increased also. I need to get another node implemented to my test system to test further but I don't have any more RGM69 modules at the moment.

                              chrilleC Offline
                              chrilleC Offline
                              chrille
                              wrote on last edited by
                              #14

                              @korttoma said:

                              From your post, l am not sure if I should get both tx an rx counts in my setup since I am not using MQTT or serial GW. I have just the ESP/RFM69 gateway an one sensebender sending data. Later when I checked I noticed that the other counter had actual increased also. I need to get another node implemented to my test system to test further but I don't have any more RGM69 modules at the moment.

                              Could try changing

                              if (indication) {
                                  indication(ind);
                              

                              to

                              sleep(10);
                              if (indication) {
                                  indication(ind);
                              

                              in MyIndication.cpp (almost in the bottom of file) - it works for me! - although I have no idea why

                              YveauxY 1 Reply Last reply
                              0
                              • chrilleC chrille

                                @korttoma said:

                                From your post, l am not sure if I should get both tx an rx counts in my setup since I am not using MQTT or serial GW. I have just the ESP/RFM69 gateway an one sensebender sending data. Later when I checked I noticed that the other counter had actual increased also. I need to get another node implemented to my test system to test further but I don't have any more RGM69 modules at the moment.

                                Could try changing

                                if (indication) {
                                    indication(ind);
                                

                                to

                                sleep(10);
                                if (indication) {
                                    indication(ind);
                                

                                in MyIndication.cpp (almost in the bottom of file) - it works for me! - although I have no idea why

                                YveauxY Offline
                                YveauxY Offline
                                Yveaux
                                Mod
                                wrote on last edited by
                                #15

                                @chrille that doesn't seem to make sense.
                                Sleep will power down the mpu, sending even more indications (sleep & wake up).
                                The library is not reentrant, so expect erroneous behavior using your change!

                                http://yveaux.blogspot.nl

                                chrilleC 1 Reply Last reply
                                0
                                • YveauxY Yveaux

                                  @chrille that doesn't seem to make sense.
                                  Sleep will power down the mpu, sending even more indications (sleep & wake up).
                                  The library is not reentrant, so expect erroneous behavior using your change!

                                  chrilleC Offline
                                  chrilleC Offline
                                  chrille
                                  wrote on last edited by
                                  #16

                                  @Yveaux said:

                                  Sleep will power down the mpu, sending even more indications (sleep & wake up).
                                  The library is not reentrant, so expect erroneous behavior using your change!

                                  I fully agree that it does not make sense! It just seems that a slight delay is required - see my comments in issue #584 - just adding a couple of lines of serial debug is also sufficient. Also, I do not propose this is as a permanent fix, but hopefully my observations can help someone with a better knowledge of the codebase to narrow down the real issue

                                  For now the code behaves as expected and looking at my serial console I do not get any additional indication calls because of this

                                  • Jan
                                  YveauxY 1 Reply Last reply
                                  0
                                  • chrilleC chrille

                                    @Yveaux said:

                                    Sleep will power down the mpu, sending even more indications (sleep & wake up).
                                    The library is not reentrant, so expect erroneous behavior using your change!

                                    I fully agree that it does not make sense! It just seems that a slight delay is required - see my comments in issue #584 - just adding a couple of lines of serial debug is also sufficient. Also, I do not propose this is as a permanent fix, but hopefully my observations can help someone with a better knowledge of the codebase to narrow down the real issue

                                    For now the code behaves as expected and looking at my serial console I do not get any additional indication calls because of this

                                    • Jan
                                    YveauxY Offline
                                    YveauxY Offline
                                    Yveaux
                                    Mod
                                    wrote on last edited by
                                    #17

                                    @chrille Maybe I'm lost because of the split of the topic, but can you summarize what problem you actually solve by adding an extra delay?

                                    http://yveaux.blogspot.nl

                                    chrilleC 1 Reply Last reply
                                    0
                                    • YveauxY Yveaux

                                      @chrille Maybe I'm lost because of the split of the topic, but can you summarize what problem you actually solve by adding an extra delay?

                                      chrilleC Offline
                                      chrilleC Offline
                                      chrille
                                      wrote on last edited by
                                      #18

                                      @Yveaux said:

                                      Maybe I'm lost because of the split of the topic, but can you summarize what problem you actually solve by adding an extra delay?

                                      Yes, the issue is missing callbacks to the indication() function

                                      To verify I add a simple indication() function in my gateway sketch, that prints the indication type to the serial console. When running on an ESP8266/NRF24 gateway it works as expected. When running on an ESP8266/RFM69 gateway only some events generates the callback

                                      For instance type 11 (client connect) generates a callback but type 2 and 3 (RX and TX) does not. However type 2 and 3 events does trigger the function to flash the corresponding LED's on my gateway, and the calls to the LED flashing and the indication() function, both happens within MyIndication.cpp. By introducing a small delay right before the indication call, suddenly all events generates the indication() call. The delay can be created by writing debug info to the serial console or sleep()'ing for 10 ms.

                                      (Arduino 1.6.11 and latest MySensors beta)

                                      Maybe we should continue in the comments section of the issue I created for this?

                                      https://github.com/mysensors/MySensors/issues/584

                                      YveauxY 1 Reply Last reply
                                      0
                                      • chrilleC chrille

                                        @Yveaux said:

                                        Maybe I'm lost because of the split of the topic, but can you summarize what problem you actually solve by adding an extra delay?

                                        Yes, the issue is missing callbacks to the indication() function

                                        To verify I add a simple indication() function in my gateway sketch, that prints the indication type to the serial console. When running on an ESP8266/NRF24 gateway it works as expected. When running on an ESP8266/RFM69 gateway only some events generates the callback

                                        For instance type 11 (client connect) generates a callback but type 2 and 3 (RX and TX) does not. However type 2 and 3 events does trigger the function to flash the corresponding LED's on my gateway, and the calls to the LED flashing and the indication() function, both happens within MyIndication.cpp. By introducing a small delay right before the indication call, suddenly all events generates the indication() call. The delay can be created by writing debug info to the serial console or sleep()'ing for 10 ms.

                                        (Arduino 1.6.11 and latest MySensors beta)

                                        Maybe we should continue in the comments section of the issue I created for this?

                                        https://github.com/mysensors/MySensors/issues/584

                                        YveauxY Offline
                                        YveauxY Offline
                                        Yveaux
                                        Mod
                                        wrote on last edited by
                                        #19

                                        @chrille at least issue https://github.com/mysensors/MySensors/issues/585 (missing rx indications) has been solved in development.

                                        http://yveaux.blogspot.nl

                                        chrilleC 1 Reply Last reply
                                        0
                                        • YveauxY Yveaux

                                          @chrille at least issue https://github.com/mysensors/MySensors/issues/585 (missing rx indications) has been solved in development.

                                          chrilleC Offline
                                          chrilleC Offline
                                          chrille
                                          wrote on last edited by
                                          #20

                                          @Yveaux My gateway is a plain ethernet gateway, so this is not the issue for me

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


                                          11

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 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