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.7k 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.
  • Mark SwiftM Mark Swift

    @Yveaux I just tried to compile it and get the following error:

    In file included from /Users/markswift/Documents/Arduino/libraries/MySensors/core/MyTransportNRF24.cpp:23:0,
    from /Users/markswift/Documents/Arduino/libraries/MySensors/MySensor.h:260,
    from /Users/markswift/Documents/Personal/Hobbies/Arduino/GatewayESP8266MQTTClient/GatewayESP8266MQTTClient.ino:132:
    /Users/markswift/Documents/Arduino/libraries/MySensors/drivers/CircularBuffer/CircularBuffer.h:23:25: fatal error: util/atomic.h: No such file or directory
    #include <util/atomic.h>

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

    @Mark-Swift Sorry, my bad. This is AVR only code... Have to look for the ESP equivalent...

    http://yveaux.blogspot.nl

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

      This util/atomic.h is an easy fix, but then the next error occurs: current ESP8266 Arduino port (even tried upto 2.2.0) does not support SPI access from within interrupts (SPI.usingInterrupt is not supported.
      See https://github.com/esp8266/Arduino/issues/1943.
      This means I cannot reliably get the message data from the nRF from within an interrupt on ESP8266, using the regular Arduino SPI library.
      Have to think if there's another solution (or push this issue to be solved ;-) )
      To be continued...

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • Mark SwiftM Offline
        Mark SwiftM Offline
        Mark Swift
        wrote on last edited by
        #307

        nightmare!

        Let me know how you get on...

        1 Reply Last reply
        0
        • signal15S Offline
          signal15S Offline
          signal15
          wrote on last edited by
          #308

          Is anyone having luck running the ESP without problems at all? I'm on 1.5 and it's my first gateway, and I cannot get sensors to include. Should I try the development branch? Or, should I build a different gateway altogether? I just need something that works at this point.

          1 Reply Last reply
          0
          • alexsh1A Offline
            alexsh1A Offline
            alexsh1
            wrote on last edited by
            #309

            Let me reiterate what @signal15 asked - did anyone successfully have esp8266 running as the GW on 2.0b? I have just acquired Wemos mini and would like to try it

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

              @alexsh1 @signal15 I can confirm that the ESP gateway is working fine and stable. I even enabled the ESP OTA update function and that's working fine too.

              signal15S 1 Reply Last reply
              0
              • AndurilA Anduril

                @alexsh1 @signal15 I can confirm that the ESP gateway is working fine and stable. I even enabled the ESP OTA update function and that's working fine too.

                signal15S Offline
                signal15S Offline
                signal15
                wrote on last edited by
                #311

                @Anduril

                Can you point me to documentation on how the OTA update stuff works and what the capabilities are?

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

                  @signal15 well there is a doc about OTA here. I discussed this topic with tekka, who is the author of the GatewayESP8266OTA example in the mysensors lib here.
                  It took me some time to get this working, but now I can upload new firmware to my ESP using wifi. Only drawback is that is seems to be not compatible with the mqtt version of the gateway. At least I was not able to get this working and stopped on that.
                  If you have further questions, don't hesitate to ask.

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    marceloaqno
                    Code Contributor
                    wrote on last edited by marceloaqno
                    #313

                    I recently built a mysensors node with esp8266 where I needed many I/O pins which made me realize the possibility of using the pin RX (http://www.forward.com.au/pfod/ESP8266/GPIOpins/ESP8266_01_pin_magic.html).
                    Initializing the serial with:

                    Serial.begin(MY_BAUD_RATE, SERIAL_8N1, SERIAL_TX_ONLY, 1);
                    

                    allows to use RX pin for I/O.

                    So I was wondering if it would be useful to add a way in which the serial port can be initialized:

                    #define MY_SERIAL_MODE SERIAL_TX_ONLY
                    #define MY_SERIAL_MODE SERIAL_RX_ONLY
                    #define MY_SERIAL_MODE SERIAL_FULL   (default)
                    

                    github.com/marceloaqno/MySensors/commit/687fecc6b4abb782eae8e1abb3b07016bfeac291

                    Also, to use the esp8266 analog pin, I had to comment the line:

                    ADC_MODE(ADC_VCC);
                    

                    from MyHwESP8266.cpp.
                    Is there another way to use analog readings without messing the code?

                    Excellent port by the way, I have been using here and it works great!!

                    1 Reply Last reply
                    0
                    • Mark SwiftM Offline
                      Mark SwiftM Offline
                      Mark Swift
                      wrote on last edited by
                      #314

                      Was the blocking code issue ever resolved @Yveaux ?

                      YveauxY 1 Reply Last reply
                      0
                      • Mark SwiftM Mark Swift

                        Was the blocking code issue ever resolved @Yveaux ?

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

                        @Mark-Swift no, still open at Esp side, and I couldn't think of a clean way working around it...

                        http://yveaux.blogspot.nl

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          gloob
                          wrote on last edited by
                          #316

                          I have an ESP using as a gateway and want to send some sensor information each 5 minutes to the controller.

                          Is it possible to use the wait command in the "loop"?

                          void loop() 
                          {
                            wait(unsigned long ms);
                            statusCounter += 1;
                            send(msg.set(statusCounter));
                          }
                          
                          mfalkviddM 1 Reply Last reply
                          0
                          • G gloob

                            I have an ESP using as a gateway and want to send some sensor information each 5 minutes to the controller.

                            Is it possible to use the wait command in the "loop"?

                            void loop() 
                            {
                              wait(unsigned long ms);
                              statusCounter += 1;
                              send(msg.set(statusCounter));
                            }
                            
                            mfalkviddM Offline
                            mfalkviddM Offline
                            mfalkvidd
                            Mod
                            wrote on last edited by
                            #317

                            @gloob yes

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              gloob
                              wrote on last edited by gloob
                              #318

                              Thanks for the answer. So all incoming or outgoing messages of the gateway will be processed in the background, while the "wait" command is active?

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

                                @gloob Yes

                                1 Reply Last reply
                                0
                                • E Offline
                                  E Offline
                                  Eawo
                                  wrote on last edited by
                                  #320

                                  Hey

                                  Im not really getting it is this a gateway for mysensors nodes or for mtqq Nodes with esp stuff? I dont really getting it. Do you need a esp8266 wifi gateway to get a wireless gateway for mysensors stuff or is like. Mysensors gateway ---> Esp8266 gateway --- Esp8266 node.

                                  Sorry i dont really understand but im intressted in buying 8-10 sonoff for my window lamps, and i want them to work with domoticz :D

                                  alexsh1A 1 Reply Last reply
                                  0
                                  • E Eawo

                                    Hey

                                    Im not really getting it is this a gateway for mysensors nodes or for mtqq Nodes with esp stuff? I dont really getting it. Do you need a esp8266 wifi gateway to get a wireless gateway for mysensors stuff or is like. Mysensors gateway ---> Esp8266 gateway --- Esp8266 node.

                                    Sorry i dont really understand but im intressted in buying 8-10 sonoff for my window lamps, and i want them to work with domoticz :D

                                    alexsh1A Offline
                                    alexsh1A Offline
                                    alexsh1
                                    wrote on last edited by
                                    #321

                                    @Eawo the sonoff does not require any GW to work with Domoticz.

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

                                      Yes, @alexsh1 is right. You would normally setup ESP nodes (like the sonoff) to act as a gateway, communicating directly with the controller themselves.

                                      But if you're persistent (or have short wifi range), you can get two ESP nodes to communicate with each other using NRF24/RF69 like @mfalkvidd did recently.

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        Matthew Ohlson de Fine
                                        wrote on last edited by
                                        #323

                                        Hi. I have loaded the Sonoff as an Ethernet gateway using the modified sketch in Vera and it recognizes it perfectly. The problem I have is that I dont know how to control the relay with the Vera now. Please help.

                                        1 Reply Last reply
                                        0
                                        • Mark SwiftM Offline
                                          Mark SwiftM Offline
                                          Mark Swift
                                          wrote on last edited by
                                          #324

                                          @hek @Yveaux I see the blocking issue on the ESP side has been closed... Does this mean we can now use the ESP in high traffic environments? How can we test it, I assume we also need to activate IRQ for the NRF in the ESP gateway code?

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