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. Announcements
  3. 💬 Building a WiFi Gateway using ESP8266

💬 Building a WiFi Gateway using ESP8266

Scheduled Pinned Locked Moved Announcements
109 Posts 52 Posters 23.2k Views 51 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.
  • MasMatM Offline
    MasMatM Offline
    MasMat
    wrote on last edited by MasMat
    #84

    I built a ESP8266 (Lolin V3) gw with RFM69 868mhz according to instructions.
    I flashed NodeMCU with EspTool without problems. I then uploaded my sketch. It started first OK, but after I set a fixed IP with my router, it will not connect anymore (to router??).

    Debug:

    $l⸮⸮`,ld⸮p :Y⸮56 MCO:BGN:INIT GW,CP=RRNGE---,REL=255,VER=2.3.1
    108 TSF:LRT:OK
    124 TSM:INIT
    137 TSF:WUR:MS=0
    157 TSM:INIT:TSP OK
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 7
    cnt 
    
    connected with Neptune, channel 11
    dhcp client start...
    323 TSM:INIT:GW MODE
    346 TSM:READY:ID=0,PAR=0,DIS=0
    378 MCO:REG:NOT NEEDED
    406 TSM:READY:NWD REQ
    1840 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    scandone
    1923 GWT:TPC:CONNECTING...
    2452 GWT:TPC:CONNECTING...
    2980 GWT:TPC:CONNECTING...
    3508 GWT:TPC:CONNECTING...
    4036 GWT:TPC:CONNECTING...
    4564 GWT:TPC:CONNECTING...
    5092 GWT:TPC:CONNECTING...
    5620 GWT:TPC:CONNECTING...
    6148 GWT:TPC:CONNECTING...
    6676 GWT:TPC:CONNECTING...
    7204 GWT:TPC:CONNECTING...
    7732 GWT:TPC:CONNECTING...
    8260 GWT:TPC:CONNECTING...
    8788 GWT:TPC:CONNECTING...
    9316 GWT:TPC:CONNECTING...
    9844 GWT:TPC:CONNECTING...
    pm open,type:2 0
    10372 GWT:TPC:CONNECTING...
    10901 GWT:TPC:CONNECTING...
    11430 GWT:TPC:CONNECTING...
    11959 GWT:TPC:CONNECTING...
    12488 GWT:TPC:CONNECTING...
    13017 GWT:TPC:CONNECTING...
    

    Sketch:

    #define MY_DEBUG
    #define MY_BAUD_RATE 9600
    #define MY_RADIO_RFM69
    #define MY_RFM69_FREQUENCY RFM69_868MHZ // Set your frequency here
    #define MY_IS_RFM69HW // Omit if your RFM is not "H"
    #define MY_RFM69_IRQ_PIN D1
    #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
    
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_GATEWAY_ESP8266
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "domoticz/in/mysenRFM69"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "domoticz/out/mysenRFM69"
    #define MY_MQTT_CLIENT_ID "mysenRFM69"
    #define MY_MQTT_USER "ZZZZ"
    #define MY_MQTT_PASSWORD "YYYYYYYY"
    
    #define MY_WIFI_SSID "Neptune"
    #define MY_WIFI_PASSWORD "XXXXXXXXXXXX"
    #define MY_HOSTNAME "mqtt-ESP8266-gateway"
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 51
    #define MY_PORT 1883
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    // Flash leds on rx/tx/err
    #define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors here
    }
    
    void loop()
    {
    	// Send locally attached sensors data here
    }
    
    

    Sketch or router problem?
    Powered with computer usb + 800mA 5V charger at the moment.

    1 Reply Last reply
    0
    • pkriekP Offline
      pkriekP Offline
      pkriek
      wrote on last edited by pkriek
      #85

      4ff93cc5-84b9-4b2c-8e2e-4cc2b4a92cd8-image.png
      914fdde7-43e9-4e7e-9d61-1a2a4502e7ff-image.png

      Hi I just have build this GW. and it is working. But as you can see in the screenshots, I get really strange readings from my sensors. The serial connected GW is working good.

      the first screenshot, strange temperature. no idea from where this is coming. second screen shot also strange temperature, and a battery reading.....

      I know from which sensors this is coming since the serial GW is also logging them. and these values are simply wrong. any idea what I should change?

      thanks

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisJ
        wrote on last edited by
        #86

        @MasMat said in 💬 Building a WiFi Gateway using ESP8266:

        r usb + 800mA 5V charg

        Sorry if I ask a noob question... I'm new and just arrived at MySensors
        This screenshot, where is from please ? I mean What software you use ?

        Thanks a lot
        Denis

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DenisJ
          wrote on last edited by
          #87

          Hi there all,
          I'm new here and for first think I'll like to thanks a lot for this wonderful MySensors

          I just folow step-by-step the guide here: Building a WiFi Gateway using ESP8266

          • use all this on a NodeMcu
          • I opened the sketch from Arduino Ide from File>Examples>My Sensors> GatewayESP8266
          • I edited my WiFi credentials, compiled, and write it on the NodeMcu
          • I opened the serial console and watch...

          This is what I see on the NodeMcu log:

          2216 GWT:TIN:CONNECTING...
          scandone
          state: 0 -> 2 (b0)
          3982 GWT:TIN:CONNECTING...
          state: 2 -> 3 (0)
          state: 3 -> 0 (12)
          reconnect
          5068 GWT:TIN:CONNECTING...
          6096 GWT:TIN:CONNECTING...
          7124 GWT:TIN:CONNECTING...
          scandone
          state: 0 -> 2 (b0)
          state: 2 -> 3 (0)
          state: 3 -> 0 (12)
          

          This NodeMcu was always connecting on my WiFi LAN.
          Someone can help me please ?

          Thanks in advance
          Denis

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DenisJ
            wrote on last edited by
            #88

            I finally understand with was the problem...
            My WiFi Mesh LAN accepted only 802.11.g+n radio... now that I have set 802.11.b+g+n it's ok
            Strange this think cause an all other WiFi Arduino schetch the 802.11.g+n radio was always accepted.

            Anyway... now it's work :-)
            Denis

            1 Reply Last reply
            1
            • G Offline
              G Offline
              Gerard_Tlse
              wrote on last edited by
              #89

              Hi,
              I have a small problem: I am using the Gateway Mysensor EPS8266 WIFi.
              Everything is correctly working except the leds:

              in the code mysensor code , there is:
              // Flash leds on rx / tx / err
              // Led pins used if blinking feature is enabled above

              define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin
              define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin
              define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED

              I replaced by:

              // Flash leds on rx / tx / err
              // Uncomment to override default HW configurations
              #define MY_DEFAULT_ERR_LED_PIN 1 // Error led pin
              #define MY_DEFAULT_RX_LED_PIN 3 // Receive led pin
              #define MY_DEFAULT_TX_LED_PIN 4 // the PCB, on board LED

              and it does not work: the LEDs are always half-on.

              can You tell me if these pins are used for other things and only PIN16 is available for the user ?

              Thanks for your help

              Gerard

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                Zwer2k
                wrote on last edited by
                #90

                Hello,
                I have been using MySensors for a long time. First with serial gateway now with ESP8266 gateway. For months everything worked fine except for small dropouts. Due to dropouts I wanted to switch to current development branch, since then I can not get the gateway to work.
                The ESP delivers only the following output:

                 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                
                load 0x4010f000, len 3460, room 16 
                tail 4
                chksum 0xcc
                load 0x3fff20b8, len 40, room 4 
                tail 4
                chksum 0xc9
                csum 0xc9
                v00051da0
                ~ld
                
                

                I use ESP07 with RFM69 and Standard Sketch. Compiled the code with Arduino IDE as well as with VS code, always with the same result.
                I disconnected RFM69 and checked the supply voltage. Have even used other calculator.
                Have also tested ESP12e.
                Erase Flash I have also already done.
                However, when I run other code on the ESP, it runs without problems.
                Erase Flash I have also already done.
                I just don't understand it.

                #define MY_DEBUG
                #define MY_BAUD_RATE 115200
                #define MY_RADIO_RFM69
                #define MY_IS_RFM69HW
                
                #define MY_GATEWAY_ESP8266
                
                #define MY_WIFI_SSID "my ssid"
                #define MY_WIFI_PASSWORD "my pw"
                
                #define MY_HOSTNAME "MySensors-GW"
                #define MY_PORT 5003
                #define MY_GATEWAY_MAX_CLIENTS 3
                #define MY_INCLUSION_MODE_FEATURE
                
                // Enable Inclusion mode button on gateway
                #define MY_INCLUSION_BUTTON_FEATURE
                // Set inclusion mode duration (in seconds)
                #define MY_INCLUSION_MODE_DURATION 60
                // Digital pin used for inclusion mode button
                #define MY_INCLUSION_MODE_BUTTON_PIN  3
                
                #include <MySensors.h>
                
                void setup()
                {
                }
                
                void presentation()
                {
                }
                
                void loop()
                {
                }
                
                YveauxY 1 Reply Last reply
                0
                • Z Zwer2k

                  Hello,
                  I have been using MySensors for a long time. First with serial gateway now with ESP8266 gateway. For months everything worked fine except for small dropouts. Due to dropouts I wanted to switch to current development branch, since then I can not get the gateway to work.
                  The ESP delivers only the following output:

                   ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                  
                  load 0x4010f000, len 3460, room 16 
                  tail 4
                  chksum 0xcc
                  load 0x3fff20b8, len 40, room 4 
                  tail 4
                  chksum 0xc9
                  csum 0xc9
                  v00051da0
                  ~ld
                  
                  

                  I use ESP07 with RFM69 and Standard Sketch. Compiled the code with Arduino IDE as well as with VS code, always with the same result.
                  I disconnected RFM69 and checked the supply voltage. Have even used other calculator.
                  Have also tested ESP12e.
                  Erase Flash I have also already done.
                  However, when I run other code on the ESP, it runs without problems.
                  Erase Flash I have also already done.
                  I just don't understand it.

                  #define MY_DEBUG
                  #define MY_BAUD_RATE 115200
                  #define MY_RADIO_RFM69
                  #define MY_IS_RFM69HW
                  
                  #define MY_GATEWAY_ESP8266
                  
                  #define MY_WIFI_SSID "my ssid"
                  #define MY_WIFI_PASSWORD "my pw"
                  
                  #define MY_HOSTNAME "MySensors-GW"
                  #define MY_PORT 5003
                  #define MY_GATEWAY_MAX_CLIENTS 3
                  #define MY_INCLUSION_MODE_FEATURE
                  
                  // Enable Inclusion mode button on gateway
                  #define MY_INCLUSION_BUTTON_FEATURE
                  // Set inclusion mode duration (in seconds)
                  #define MY_INCLUSION_MODE_DURATION 60
                  // Digital pin used for inclusion mode button
                  #define MY_INCLUSION_MODE_BUTTON_PIN  3
                  
                  #include <MySensors.h>
                  
                  void setup()
                  {
                  }
                  
                  void presentation()
                  {
                  }
                  
                  void loop()
                  {
                  }
                  
                  YveauxY Offline
                  YveauxY Offline
                  Yveaux
                  Mod
                  wrote on last edited by
                  #91

                  @Zwer2k please don't crosspost!

                  http://yveaux.blogspot.nl

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    Zwer2k
                    wrote on last edited by
                    #92

                    Sorry for crosspost.
                    I found out that the error was due to too new version of espressif8266. I had version 3.1.0 installed, but MySensors seems to work only with versions < 3.0.0. Otherwise the error comes up. Unfortunately I did not find any hint about this anywhere.

                    1 Reply Last reply
                    0
                    • Serj SamS Offline
                      Serj SamS Offline
                      Serj Sam
                      wrote on last edited by
                      #93

                      Hello! I'm trying to run ESP8266 gateway with nrf24l01 radio module, but when I run it I don't see any logs, I've enebled debugging mode, but still no logs (and it doesn't run gateway either). I've checked connection between this board end esp32 - they communicate well. Don't know what to do else.

                      YveauxY mfalkviddM 2 Replies Last reply
                      0
                      • Serj SamS Serj Sam

                        Hello! I'm trying to run ESP8266 gateway with nrf24l01 radio module, but when I run it I don't see any logs, I've enebled debugging mode, but still no logs (and it doesn't run gateway either). I've checked connection between this board end esp32 - they communicate well. Don't know what to do else.

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

                        @Serj-Sam logs are available through serial port. You mention esp8266 and esp32; which one is it?

                        http://yveaux.blogspot.nl

                        1 Reply Last reply
                        0
                        • Serj SamS Serj Sam

                          Hello! I'm trying to run ESP8266 gateway with nrf24l01 radio module, but when I run it I don't see any logs, I've enebled debugging mode, but still no logs (and it doesn't run gateway either). I've checked connection between this board end esp32 - they communicate well. Don't know what to do else.

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

                          @Serj-Sam you mention "connection between this board and esp32". What board are you referring to, and what type of connection? Wifi?

                          Serj SamS 1 Reply Last reply
                          0
                          • mfalkviddM mfalkvidd

                            @Serj-Sam you mention "connection between this board and esp32". What board are you referring to, and what type of connection? Wifi?

                            Serj SamS Offline
                            Serj SamS Offline
                            Serj Sam
                            wrote on last edited by
                            #96

                            @mfalkvidd I have esp8266 NodeMCU v3. I've connected it to esp32 devkit via nrf24l01 using simple test code where I sending and reading constant string. It's just to exclude problems with nrf24l01 and esp8266.
                            @Yveaux I don't have any logs through serial port related to the MySensors. When I remove MySensors lib (and the code related to it) I'm able to print messages in setup() and loop() section, but with MySensors lib it stuckted somewhere without logs and do not execute code in setup() and loop() sections.

                            YveauxY 1 Reply Last reply
                            0
                            • Serj SamS Serj Sam

                              @mfalkvidd I have esp8266 NodeMCU v3. I've connected it to esp32 devkit via nrf24l01 using simple test code where I sending and reading constant string. It's just to exclude problems with nrf24l01 and esp8266.
                              @Yveaux I don't have any logs through serial port related to the MySensors. When I remove MySensors lib (and the code related to it) I'm able to print messages in setup() and loop() section, but with MySensors lib it stuckted somewhere without logs and do not execute code in setup() and loop() sections.

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

                              @Serj-Sam you could very well have run into the incompatibility of mysensors with the latest esp arduino core 3.x (see eg https://github.com/mysensors/MySensors/issues/1496)
                              Easiest solution is to downgrade the esp arduino core to 2.x

                              http://yveaux.blogspot.nl

                              Serj SamS 1 Reply Last reply
                              0
                              • YveauxY Yveaux

                                @Serj-Sam you could very well have run into the incompatibility of mysensors with the latest esp arduino core 3.x (see eg https://github.com/mysensors/MySensors/issues/1496)
                                Easiest solution is to downgrade the esp arduino core to 2.x

                                Serj SamS Offline
                                Serj SamS Offline
                                Serj Sam
                                wrote on last edited by
                                #98

                                @Yveaux said in 💬 Building a WiFi Gateway using ESP8266:

                                downgrade the esp arduino core

                                Thank you @Yveaux ! It works now! Have you heard anything about long-term solution? Looks like this will be overwritten once I update MySensors lib.

                                YveauxY 1 Reply Last reply
                                0
                                • Serj SamS Serj Sam

                                  @Yveaux said in 💬 Building a WiFi Gateway using ESP8266:

                                  downgrade the esp arduino core

                                  Thank you @Yveaux ! It works now! Have you heard anything about long-term solution? Looks like this will be overwritten once I update MySensors lib.

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

                                  @Serj-Sam there is a pull request included in that pr. Once this is merged it will be available in development, later in the next release.
                                  If you just downgraded the core, that is persistent until you upgrade the core to 3.x again.

                                  http://yveaux.blogspot.nl

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    maddhin
                                    wrote on last edited by
                                    #100

                                    Hi,
                                    I would like to add sendSketchInfo to my gateway.
                                    I added

                                    const char* sketch_name = "GatewayESP8266OTA_v3";
                                    const char* rev = "1.01";

                                    at the beginning of the sketch and

                                    sendSketchInfo(sketch_name, rev);

                                    in the presentation part.

                                    but this doesn't seem to work. Am I doing anything wrong? Any suggestion on how to do it right? Many thanks in advance!

                                    1 Reply Last reply
                                    0
                                    • rejoe2R Offline
                                      rejoe2R Offline
                                      rejoe2
                                      wrote on last edited by
                                      #101

                                      Use this syntax instead:

                                      #define SN "GatewayESP8266OTA_v3"
                                      #define SV "1.01"
                                      [...]
                                      sendSketchInfo(SN, SV);
                                      

                                      Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                      1 Reply Last reply
                                      0
                                      • Fat FlyF Fat Fly

                                        Small question. How to connect this gw to Domoticz ? Over lan and in Domoticz ?

                                        B Offline
                                        B Offline
                                        billcrps32
                                        wrote on last edited by
                                        #102

                                        @Fat-Fly i also want the answer of this question

                                        1 Reply Last reply
                                        0
                                        • Bogusz JagodaB Offline
                                          Bogusz JagodaB Offline
                                          Bogusz Jagoda
                                          wrote on last edited by
                                          #103

                                          Worth noting - use MY_RFM69_NEW_DRIVER define... (2.3.2+)

                                          #ifdef ESP8266
                                              // For RFM69
                                              #define MY_RADIO_RFM69
                                          	#define MY_RFM69_NEW_DRIVER
                                              #define MY_RFM69_FREQUENCY  RFM69_868MHZ // Set your frequency here
                                              #define MY_IS_RFM69HW                    // Omit if your RFM is not "H"
                                              #define MY_RFM69_IRQ_PIN    D1
                                              #define MY_RFM69_IRQ_NUM    digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
                                              #define MY_RFM69_CS_PIN     D8           // NSS. Use MY_RFM69_SPI_CS for older versions (before 2.2.0)
                                          #endif
                                          
                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          9

                                          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