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.8k 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.
  • K krajcl

    Hi,

    I'm having problems running ESP8266 gateway. When I reset my nodes or trying send command from controller to node (dimmer, realy etc.) my gateway reset itself. I try using different ESP-s (I'm using ESP-12), power supplys and radio modules.

    On serial monitor I get this error:

    error.jpg

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

    @krajcl What catches my eye is the client command echoed by the gateway: "Client 0: 44;255;3;0;6;"
    The 0 at the end seems to be missing -- This could be a gateway issue (are you using the standard ESP gateway sketch, or did you make any modifications?) which causes e.g. the command parser to crash.

    Could you give a more detailed description of your setup? Which controller are you using, what does the network look like (nr. of sensors, repeaters etc.).

    http://yveaux.blogspot.nl

    1 Reply Last reply
    0
    • K Offline
      K Offline
      krajcl
      wrote on last edited by
      #70

      @Yveaux I'm using standard ESP gateway sketch (I reinstalled Arduino IDE, download latest mysensors library). At the moment I'm using MYSController as controler (for testing), I only have one node active (standard humidity sketch - only changed node id).

      YveauxY 1 Reply Last reply
      0
      • K krajcl

        @Yveaux I'm using standard ESP gateway sketch (I reinstalled Arduino IDE, download latest mysensors library). At the moment I'm using MYSController as controler (for testing), I only have one node active (standard humidity sketch - only changed node id).

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

        @krajcl The last command from the controller seems to be a response to the sensor to indicate metric or imperial units are used (internal command 6). The payload should be either 'M' or 'I'.
        I'm not familiar with MYSController, but is there some setting influencing the unit system? Can you check if it has a valid value?
        I can't replay the situation right now, so anything you can do yourself to track the problem would really help.

        http://yveaux.blogspot.nl

        1 Reply Last reply
        0
        • K Offline
          K Offline
          krajcl
          wrote on last edited by
          #72

          @Yveaux This is result with Domoticz as controller and new node (relay), same result:

          error2.jpg

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

            I'm definitely not a expert at all on the topic, but could it be that a ftdi-usb adapter doesn't provide enough power to ESP, and it eventually hangs when wi-fi transmissions drawn too much power? (according to the specs, ~150mA when transmitting) .

            Just trying to help with some (probably dumb) brainstorming. ;-)

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

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

              Do you need to the NodeMCU to implement this?
              I have an arduino uno and ESP-01. How do I wire these up?

              After doing some more reading looks like the esp-01 does not have enough pins. Dont think I can use it :(

              1 Reply Last reply
              0
              • K krajcl

                @Yveaux This is result with Domoticz as controller and new node (relay), same result:

                error2.jpg

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

                @krajcl Does it only crash when sending this particular message?

                http://yveaux.blogspot.nl

                S 1 Reply Last reply
                0
                • K Offline
                  K Offline
                  krajcl
                  wrote on last edited by
                  #76

                  @Yveaux I tried function (clear routing table) in MYSConroller. This is result:

                  Client 0: 0;0;3;0;10;C
                  Client 0: 6;0;3;0;10;C

                  ctx: cont
                  sp: 3ffeabe0 end: 3ffeaf20 offset: 01b0

                  When I try this function for gateway, evrything works fine, but for other nodes - gateway resets

                  YveauxY 1 Reply Last reply
                  0
                  • K krajcl

                    @Yveaux I tried function (clear routing table) in MYSConroller. This is result:

                    Client 0: 0;0;3;0;10;C
                    Client 0: 6;0;3;0;10;C

                    ctx: cont
                    sp: 3ffeabe0 end: 3ffeaf20 offset: 01b0

                    When I try this function for gateway, evrything works fine, but for other nodes - gateway resets

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

                    @krajcl When this message is addressed to the gateway (0;0;3;0;10;C) it does not get sent over the air by the radio.
                    When you send it to node 6 (6;0;3;0;10;C), it will send the message to the node, using the radio.

                    Can you please answer this: Will it crash with just any message sent to the nodes using the radio, or only when sending internal messages to nodes (internal messages to nodes have the first value unequal to 0 and the third value set to 3, like 6;x;3;x;x;x) ?

                    http://yveaux.blogspot.nl

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      krajcl
                      wrote on last edited by
                      #78

                      @Yveaux it doesn't matter, what I send, resets every time

                      YveauxY 1 Reply Last reply
                      0
                      • K krajcl

                        @Yveaux it doesn't matter, what I send, resets every time

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

                        @krajcl Ah, ok! That helps!
                        For me, and a lot of other people on this forum, sending messages just works with the ESP.
                        Maybe @rvendrame is pointing in the right direction? How are you powering the ESP?

                        http://yveaux.blogspot.nl

                        1 Reply Last reply
                        0
                        • AndurilA Offline
                          AndurilA Offline
                          Anduril
                          wrote on last edited by
                          #80

                          Is it possible to set a fixed IP adress and bypass DHCP? My router sometimes messes up his DHCP-table and reassigns all adresses. Then I would have to correct the IP in my controller which I want to avoid.

                          YveauxY 1 Reply Last reply
                          0
                          • AndurilA Anduril

                            Is it possible to set a fixed IP adress and bypass DHCP? My router sometimes messes up his DHCP-table and reassigns all adresses. Then I would have to correct the IP in my controller which I want to avoid.

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

                            @Anduril The ESP8266 Arduino port uses the same API as the standard Arduino WiFi library.
                            This means you should be able to use WiFi.config() to set a fixed IP address.

                            Change the following line in Esp8266Gateway.ino

                              (void)WiFi.begin(ssid, pass);
                            

                            into something like (untested!):

                              IPAddress ip(192, 168, 0, 123);  /* Set to whatever IP address you'd like the gateway to have */
                              WiFi.config(ip);
                              (void)WiFi.begin(ssid, pass);
                            

                            Please report back your experience!

                            http://yveaux.blogspot.nl

                            1 Reply Last reply
                            0
                            • sowardS Offline
                              sowardS Offline
                              soward
                              wrote on last edited by
                              #82

                              I got this working on an 0.9 version of the nodeMCU ( the Yellow board ). It has some code upload issues, which are slightly worse on OS X than Linux, but usually a couple of tries with holding down the button as @hek mentioned usually does the trick. I do not have any TCP/IP clients pointed at it currently, but I also get lots of watch dog timer resets, which seem somewhat random, as it will run and log messages for somewhere between 15 mins and 10 hours.

                              It is just being powered by USB and I have not swapped NRF modules yet, so one of those may likely be the culprit, but just wanted to chime in with a (mostly) successful setup.

                              thanx

                              1 Reply Last reply
                              0
                              • K Offline
                                K Offline
                                kimnguu204
                                wrote on last edited by kimnguu204
                                #83

                                Hello all,
                                is there anybody setup MQTT gateway and it's working fine? how many node wifi gateway can handle?
                                Could you please share me Wifi MQTT Gateway code.
                                Thank you all and have a nice day

                                YveauxY 1 Reply Last reply
                                0
                                • K kimnguu204

                                  Hello all,
                                  is there anybody setup MQTT gateway and it's working fine? how many node wifi gateway can handle?
                                  Could you please share me Wifi MQTT Gateway code.
                                  Thank you all and have a nice day

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

                                  @kimnguu204 said:

                                  is there anybody setup MQTT gateway and it's working fine?

                                  Currently there is no MQTT WiFi gateway, but it shouldn't be very hard to create one by combining the WiFi Gateway with the MQTT gateway.

                                  how many node wifi gateway can handle?

                                  The same as any other MySensors gateway (around 250).

                                  http://yveaux.blogspot.nl

                                  1 Reply Last reply
                                  0
                                  • R Offline
                                    R Offline
                                    ridge
                                    wrote on last edited by
                                    #85

                                    I will report a successful first experience with MySensors using the esp8266 WiFi Gateway and a digital switch nRF24L01+ MySensors node.
                                    Thank you Yveaux and hek! nRF24L01+ nodes are the only way to go for battery power!
                                    I look forward to learning more about the MySensors architecture.
                                    I am currently using openHAB as my controller.

                                    For the MQTT library, I will vote for the https://github.com/Imroy/pubsubclient library if you decide to create a MQTT version of the WiFi Gateway. I have this library installed on 8 esp8266 nodes operating for over two months without any problems.

                                    The knolleary version has had some recent updates since I installed the lmroy version, so it may work fine with Mosquitto MQTT 3.1.1 instead of MQTT 3.1 only.

                                    1 Reply Last reply
                                    0
                                    • V Offline
                                      V Offline
                                      vickey
                                      wrote on last edited by vickey
                                      #86

                                      Hi Friends

                                      I am having an issue with my NRF24L01+. If I change gw.begin() to anything like below,

                                      gw.begin(incomingMessage, 0, true, 0);

                                      I get an error "radio init fail"

                                      And I am now trying ESP-8266 12E module along with nrf24L01+ (genuine) transceiver to built wifi gateway, which I'll later use as gateway for openhab. I am having a similar issue, Here is the log I get through serial monitor.

                                      **Connecting to Ahmed
                                      ...........Connected!
                                      IP: 192.168.0.31
                                      0;0;3;0;9;radio init fail

                                      ctx: cont
                                      sp: 3ffebdf0 end: 3ffec010 offset: 01b0

                                      stack>>>
                                      3ffebfa0: 0000007f 3ffec03c 40201cac 3ffeaff0
                                      3ffebfb0: 40202320 00000001 00000000 40201d4f
                                      3ffebfc0: 1f00a8c0 00ffffff 0100a8c0 3ffec03c
                                      3ffebfd0: 3ffe9328 3ffead34 3ffec070 402026ef
                                      3ffebfe0: 3ffe98a8 1f00a8c0 00000000 00000000
                                      3ffebff0: 3fffdc20 00000000 3ffec034 40201d1f
                                      3ffec000: 00000000 00000000 3ffeaff0 40100398
                                      <<<stack<<<

                                      ets Jan 8 2013,rst cause:1, boot mode:(3,3)

                                      load 0x4010f000, len 1264, room 16
                                      tail 0
                                      chksum 0x42
                                      csum 0x42
                                      ~ld**

                                      This information runs in a loop again and again. I am using latest library from https://github.com/mysensors/Arduino/tree/master without editing the sample Esp8266Gateway sktech except user name and password. I have followed the connection instruction specified in sample sketch and sketch was successfully uploaded. I am using 101nf capacitors and 10K resistances as specified by https://www.youtube.com/watch?v=JA-0hs5rpMY.
                                      Everything is working fine except that error. May anyone help me out?

                                      YveauxY 1 Reply Last reply
                                      0
                                      • V vickey

                                        Hi Friends

                                        I am having an issue with my NRF24L01+. If I change gw.begin() to anything like below,

                                        gw.begin(incomingMessage, 0, true, 0);

                                        I get an error "radio init fail"

                                        And I am now trying ESP-8266 12E module along with nrf24L01+ (genuine) transceiver to built wifi gateway, which I'll later use as gateway for openhab. I am having a similar issue, Here is the log I get through serial monitor.

                                        **Connecting to Ahmed
                                        ...........Connected!
                                        IP: 192.168.0.31
                                        0;0;3;0;9;radio init fail

                                        ctx: cont
                                        sp: 3ffebdf0 end: 3ffec010 offset: 01b0

                                        stack>>>
                                        3ffebfa0: 0000007f 3ffec03c 40201cac 3ffeaff0
                                        3ffebfb0: 40202320 00000001 00000000 40201d4f
                                        3ffebfc0: 1f00a8c0 00ffffff 0100a8c0 3ffec03c
                                        3ffebfd0: 3ffe9328 3ffead34 3ffec070 402026ef
                                        3ffebfe0: 3ffe98a8 1f00a8c0 00000000 00000000
                                        3ffebff0: 3fffdc20 00000000 3ffec034 40201d1f
                                        3ffec000: 00000000 00000000 3ffeaff0 40100398
                                        <<<stack<<<

                                        ets Jan 8 2013,rst cause:1, boot mode:(3,3)

                                        load 0x4010f000, len 1264, room 16
                                        tail 0
                                        chksum 0x42
                                        csum 0x42
                                        ~ld**

                                        This information runs in a loop again and again. I am using latest library from https://github.com/mysensors/Arduino/tree/master without editing the sample Esp8266Gateway sktech except user name and password. I have followed the connection instruction specified in sample sketch and sketch was successfully uploaded. I am using 101nf capacitors and 10K resistances as specified by https://www.youtube.com/watch?v=JA-0hs5rpMY.
                                        Everything is working fine except that error. May anyone help me out?

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

                                        @vickey the resets you're experiencing are caused by the failure to init the radio. This will cause the MySensors library to enter an endless loop. This will cause the watchdog to trigger and reset the ESP.
                                        Please try connecting the radio exactly as stated on the MySensors build page (when using NodeMcu hardware) or connect the same way as I did (see first post in this topic).
                                        Double check your radio connections.

                                        http://yveaux.blogspot.nl

                                        1 Reply Last reply
                                        0
                                        • V Offline
                                          V Offline
                                          vickey
                                          wrote on last edited by vickey
                                          #88

                                          I have checked all the wires and every thing is according to as par advised. I am using 2 separate 3.3 v voltage regulator to power up ESP-8266 12E and nrf24L01+ having common ground, using ESP-8266 breakout board without voltage regulator and nrf24l01+ breakout board with 3.3 v regulator powered by 5v supply.

                                          GPIO15 connected via 10K pulldown resistor to GND and also connected with CSN of nrf24l016, is this connection correct?

                                          Moreover, I am using USB to TTL adapter in place of FTDI and TX of ESP-8266 is connected with RX of TTL serial adapter and vice versa, GND of TTL serial adapter is also connected common GND. It's all the difference from your mentioned procedure.

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


                                          10

                                          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