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 WiFi gateway port for MySensors

ESP8266 WiFi gateway port for MySensors

Scheduled Pinned Locked Moved Development
328 Posts 56 Posters 309.9k Views 39 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.
  • YveauxY Offline
    YveauxY Offline
    Yveaux
    Mod
    wrote on last edited by
    #44

    NodeMcu boards are in!
    Fast shipment & very well packed:

    2015-09-05 13.26.54.jpg
    2015-09-05 13.27.51.jpg

    I can upload at 921600 baud (!) without manual reset/bootload from Arduino IDE and LED blink sketch is working.
    Next is connecting nRF24 and see if ESP gateway is running without problems.

    I'll keep you informed!

    http://yveaux.blogspot.nl

    1 Reply Last reply
    0
    • YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by Yveaux
      #45

      Works like a charm!

      This is the NodeMcu board used (Called NodeMcu Devkit v1.0 by the NodeMcu Team. Schematics and layout can be found here)

      Radio connection (using MySensors default coloring scheme. IRQ is unused and can be left unconnected):
      nrfTop.png
      NODEMCU_DEVKIT_V1.0_PINMAP.png
      2015-09-05 14.49.01.jpg

      The standard ESP8266 Gateway sketch can be used without modification (except for SSID & password).

      • Install CP2102 drivers from here.
      • Connect NodeMCU board.
      • Load the Esp8266Gateway.ino sketch (See Compiling the gateway in the top post)
      • Download the sketch. This NodeMcu board can be flashed automaticlly and doesn't need botload/reset buttons to be pressed.
      • Open the serial console and watch the board connecting to yout WiFi network.
      • Note the IP address assigned to it.
      • Now any application capable of communicating with the regular MySensors Ethernet gateway should be able to communicate with the ESP Gateway.
      • Enjoy!

      Optional step: If you want to use the onboard red LED (GPIO16) to blink when radio activity/error takes place, then change the following:

      MyConfig.h

      #define WITH_LEDS_BLINKING
      

      Esp8266Gateway.ino

      #ifdef WITH_LEDS_BLINKING
      #define RADIO_ERROR_LED_PIN 16  // Error led pin
      #define RADIO_RX_LED_PIN    16  // Receive led pin
      #define RADIO_TX_LED_PIN    16  // the PCB, on board LED
      #endif
      

      http://yveaux.blogspot.nl

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

        Thanks @Yveaux,

        I'll probably copy (most) of the previous post to the main site.

        YveauxY 1 Reply Last reply
        0
        • hekH hek

          Thanks @Yveaux,

          I'll probably copy (most) of the previous post to the main site.

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

          @hek said:

          I'll probably copy (most) of the previous post to the main site.

          Yeah, no probs. I already thought you would.
          Maybe you should 'MySensor' the devkit pinout a little to have it fit in.

          http://yveaux.blogspot.nl

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mike Cayouette
            wrote on last edited by
            #48

            Hi

            Excellent build and exactly what I have been looking for. I just got my ESP-12 this week and I am about to build this. I just have one question, what is the "Inclusion mode" for? I tried to figure it out by look at the sketch and it's not quite clear.

            Thank you for everything you have done to get this to where it's at.

            Mike

            YveauxY 1 Reply Last reply
            0
            • M Mike Cayouette

              Hi

              Excellent build and exactly what I have been looking for. I just got my ESP-12 this week and I am about to build this. I just have one question, what is the "Inclusion mode" for? I tried to figure it out by look at the sketch and it's not quite clear.

              Thank you for everything you have done to get this to where it's at.

              Mike

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

              @Mike-Cayouette I copied the implementation from the Ethernet gateway.
              I thought it was meant as a function to allow clients to join the network within a certain timeframe after pressing the button.
              When looking at the code I'm not sure it does anything at all...
              Maybe @hek can shed some light on the issue?

              http://yveaux.blogspot.nl

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

                It doesn't do much on the gateway side. As @Yveaux says it allows you to have a physical button in the gateway to enable inclusion mode. After some (configurable) time it disables inclusion mode. The enabled/disabled status is sent to controller side. But no filtering of presentation messages occurs on the gateway.

                So it is really up to the controller to respect the inclusion mode status (whether or not to create new devices).

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

                  @Yveaux
                  Please PM me any updates needed on this:
                  http://www.mysensors.org/build/esp8266_gateway

                  1 Reply Last reply
                  0
                  • YveauxY Yveaux

                    @Mike-Cayouette I copied the implementation from the Ethernet gateway.
                    I thought it was meant as a function to allow clients to join the network within a certain timeframe after pressing the button.
                    When looking at the code I'm not sure it does anything at all...
                    Maybe @hek can shed some light on the issue?

                    Daniel OliveiraD Offline
                    Daniel OliveiraD Offline
                    Daniel Oliveira
                    wrote on last edited by
                    #52

                    Hi @Yveaux ,

                    I finally received my NodeMCU (but from http://doit.am/) did you had to flash any firmware (like the NodeMCU one) in order to be able to use it from Arduino IDE or it is just flash the .ino and it's ready to go?

                    Regards

                    MySensors rules my home :)

                    YveauxY 1 Reply Last reply
                    0
                    • Daniel OliveiraD Daniel Oliveira

                      Hi @Yveaux ,

                      I finally received my NodeMCU (but from http://doit.am/) did you had to flash any firmware (like the NodeMCU one) in order to be able to use it from Arduino IDE or it is just flash the .ino and it's ready to go?

                      Regards

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

                      @Daniel-Oliveira by downloading from the Arduino ide you will overwrite any firmware already in the flash. No manual steps are required. Just connect and download from Arduino ide.

                      http://yveaux.blogspot.nl

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        Mike Cayouette
                        wrote on last edited by
                        #54

                        Thank you for the quick response @Yveaux & @hek

                        I started working on the gateway today but I seem to be having a problem. I already had IDE version 1.6.5 installed with the board manager enabled. I've been creating some sensors on some ESP-01 for a few weeks without a problem. I replaced the MySensors folder I had in my library folder with the most recent one. My old sketches still compile but when I try to compile the ESP8266Gateway sketch I get the following error.

                        Esp8266Gateway.cpp.o: In function `incomingMessage(MyMessage const&)':
                        Esp8266Gateway.cpp:(.text+0x74): undefined reference to `vsnprintf_P'
                        Esp8266Gateway.cpp.o: In function `output(char const*, ...)':
                        Esp8266Gateway.cpp:(.text+0xb6): undefined reference to `vsnprintf_P'
                        MySensors/MyHwESP8266.cpp.o: In function `hw_writeConfig(int, unsigned char)':
                        MyHwESP8266.cpp:(.text+0x138): undefined reference to `snprintf_P'
                        MySensors/MyHwESP8266.cpp.o: In function `MyHwESP8266::MyHwESP8266()':
                        MyHwESP8266.cpp:(.text+0x16f): undefined reference to `snprintf_P'
                        MySensors/MyHwESP8266.cpp.o: In function `MyHwESP8266::debugPrint(bool, char const*, ...)':
                        MyHwESP8266.cpp:(.text+0x19a): undefined reference to `vsnprintf_P'
                        MyHwESP8266.cpp:(.text+0x1b3): undefined reference to `vsnprintf_P'
                        collect2: error: ld returned 1 exit status
                        Error compiling.
                        

                        All I changed in the ESP8266Gateway example sketch was the SSID and Password.

                        Regards,

                        Mike

                        YveauxY 1 Reply Last reply
                        0
                        • M Mike Cayouette

                          Thank you for the quick response @Yveaux & @hek

                          I started working on the gateway today but I seem to be having a problem. I already had IDE version 1.6.5 installed with the board manager enabled. I've been creating some sensors on some ESP-01 for a few weeks without a problem. I replaced the MySensors folder I had in my library folder with the most recent one. My old sketches still compile but when I try to compile the ESP8266Gateway sketch I get the following error.

                          Esp8266Gateway.cpp.o: In function `incomingMessage(MyMessage const&)':
                          Esp8266Gateway.cpp:(.text+0x74): undefined reference to `vsnprintf_P'
                          Esp8266Gateway.cpp.o: In function `output(char const*, ...)':
                          Esp8266Gateway.cpp:(.text+0xb6): undefined reference to `vsnprintf_P'
                          MySensors/MyHwESP8266.cpp.o: In function `hw_writeConfig(int, unsigned char)':
                          MyHwESP8266.cpp:(.text+0x138): undefined reference to `snprintf_P'
                          MySensors/MyHwESP8266.cpp.o: In function `MyHwESP8266::MyHwESP8266()':
                          MyHwESP8266.cpp:(.text+0x16f): undefined reference to `snprintf_P'
                          MySensors/MyHwESP8266.cpp.o: In function `MyHwESP8266::debugPrint(bool, char const*, ...)':
                          MyHwESP8266.cpp:(.text+0x19a): undefined reference to `vsnprintf_P'
                          MyHwESP8266.cpp:(.text+0x1b3): undefined reference to `vsnprintf_P'
                          collect2: error: ld returned 1 exit status
                          Error compiling.
                          

                          All I changed in the ESP8266Gateway example sketch was the SSID and Password.

                          Regards,

                          Mike

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

                          @Mike-Cayouette said:

                          undefined reference to `vsnprintf_P'

                          Can you check the boardmanager which version of ESP Arduino you have installed?
                          Mine's like this:

                          upload-fbb1d613-848e-4c2d-8076-8eb684d07141

                          I use the 'stable' version, located at http://arduino.esp8266.com/stable/package_esp8266com_index.json

                          Maybe your installation is inclomplete; you could try removing & reinstalling Arduino for ESP.

                          http://yveaux.blogspot.nl

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            Mike Cayouette
                            wrote on last edited by
                            #56

                            @Yveaux said:

                            Can you check the boardmanager which version of ESP Arduino you have installed?

                            That was the problem, I was running an older version, I upgraded it and now it show's the same as your version.

                            Thanks again,

                            Mike

                            1 Reply Last reply
                            0
                            • J Offline
                              J Offline
                              jvandenbroek
                              wrote on last edited by
                              #57

                              Just wanted to say thank you! It works great after hooking it up on my breadboard, now I can finally include MySensors in my sensor network 8-)

                              YveauxY 1 Reply Last reply
                              0
                              • J jvandenbroek

                                Just wanted to say thank you! It works great after hooking it up on my breadboard, now I can finally include MySensors in my sensor network 8-)

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

                                @jvandenbroek Great to hear it's working fine! Have fun!

                                http://yveaux.blogspot.nl

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  gmccarthy
                                  wrote on last edited by
                                  #59

                                  Great work. Just starting out with mysensors and looking forward to implementing this. Waiting for my hardware to arrive :)

                                  YveauxY 1 Reply Last reply
                                  0
                                  • G gmccarthy

                                    Great work. Just starting out with mysensors and looking forward to implementing this. Waiting for my hardware to arrive :)

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

                                    @gmccarthy said:

                                    Great work.

                                    Your icon suggests differently :laughing:

                                    http://yveaux.blogspot.nl

                                    1 Reply Last reply
                                    1
                                    • G Offline
                                      G Offline
                                      gmccarthy
                                      wrote on last edited by gmccarthy
                                      #61

                                      I'm having problems compiling this - I must be missing something but can't figured out what.

                                      Error:

                                      Esp8266Gateway.ino:77:25: fatal error: ESP8266WiFi.h: No such file or directory

                                      I've downloaded the mysensor library and unzipped it.

                                      My sketchbook location is: C:\Users\xxxxx\Documents\Arduino

                                      Under C:\Users\xxxxx\Documents\Arduino\libraries\MySensors\examples\Esp8266Gateway
                                      Ads

                                      The esp8266gateway.ino file is present.

                                      Update: Pffft....try selecting the generic ESP8266 module :)

                                      1 Reply Last reply
                                      0
                                      • DrJeffD Offline
                                        DrJeffD Offline
                                        DrJeff
                                        wrote on last edited by
                                        #62

                                        Built Mine :smiley: works great the only problem I had was uploading the code from a Mac OSX Mavericks so I opened a Win7 VM I keep for these type of problems and all is good. Thanks! @Yveaux :clap:

                                        My Gateway has shrunk...SteUtUS.jpg

                                        YveauxY 1 Reply Last reply
                                        0
                                        • DrJeffD DrJeff

                                          Built Mine :smiley: works great the only problem I had was uploading the code from a Mac OSX Mavericks so I opened a Win7 VM I keep for these type of problems and all is good. Thanks! @Yveaux :clap:

                                          My Gateway has shrunk...SteUtUS.jpg

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

                                          @DrJeff said:

                                          Built Mine

                                          Great to hear you got things running!
                                          @hek is also on Mac and he managed to download directly. Maybe you can discuss your issues with him so we can update the install instructions if something special is required for Mac.

                                          My Gateway has shrunk...!

                                          Sure did, and it's wireless now :laughing:

                                          http://yveaux.blogspot.nl

                                          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.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