💬 Building a WiFi Gateway using ESP8266


  • Admin

    This thread contains comments for the article "Building a WiFi Gateway using ESP8266" posted on MySensors.org.



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



  • Yes would this work with a Rasp Pi controller running Domoticz? Just connect over WIFI to the same network the Controller is connected to?



  • Yes. Network is same.



  • Can the esp8266Gateway be used as an MQTT gateway too? Is it a config issue or does more code need porting first?


  • Admin

    Yes,

    The configuration and example can be found here:
    https://www.mysensors.org/build/mqtt_gateway



  • Fantastic. Thanks.



  • Uploaded this sktech to a NodeMcu yesterday, i can add it in domoticz. When i try to add a light sensor, it shows up as a light sensor node in domoticz under the Mysensors lan gateway. but it does not show any device. Anyone who have an idea?


  • Admin

    Please use the development branch until 2.0.1 has been released.

    It allows presentation on gateway attached devices.



  • Cool, I downloaded it and replaced the old master brach.
    Still get the same effect.
    I paste my sketch here, all except the wifi part, that works. Tell me if I should include it here as well. But I feel its something in this below part that is failing on me

    #include <MySensors.h>
    
    //###################### LIGHT SENSOR #####################
    #define CHILD_ID_LIGHT 0
    #define LIGHT_SENSOR_ANALOG_PIN 0
    
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    int lastLightLevel;
      //#########################################################
    
    void setup() { 
    }
    
    void presentation() {
    
      //###################### LIGHT SENSOR #####################
      // Send the sketch version information to the gateway and Controller
    sendSketchInfo("Light Sensor", "1.0");
    
      // Register all sensors to gateway (they will be created as child devices)
    present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    
      //#########################################################
    }
    
    
    void loop() {
    
      //###################### LIGHT SENSOR #####################
      int16_t lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; 
      Serial.println(lightLevel);
      if (lightLevel != lastLightLevel) {
          send(msg.set(lightLevel));
          lastLightLevel = lightLevel;
      }
      sleep(SLEEP_TIME);
      //#########################################################
      
    }
    


  • A couple of ESP-12E modules arrived in the mail last Friday and I uploaded the ESP8266 MQTT GW sketch. It worked immediately. Fantastic!
    I am using a cloudserver MQTT broker on cloudmqtt.com and the OpenHab controller subscribes to that as well.

    Just a question... I tried to enable the LED BLINKING feature but it seems there are no free pins on the ESP-12 module. I've tried the not connected pins but whatever pin I select (0,1,3,4,9,10) this seems to stop the GW from starting. Ideas anyone?


  • Mod

    @bgunnarb great that you got it working so quickly!

    Not sure which numbering scheme you are using (there are unfortunately many ways to number the ESP pins) but many of the pins have special use and are therefore hard to utilize. Some of my notes on the subject:

    GPIO0, gpio2 an gpio15 are tricky but can be used if special care is taken: http://www.instructables.com/id/ESP8266-Using-GPIO0-GPIO2-as-inputs/?ALLSTEPS
    gpio16 also seems special, see http://bbs.espressif.com/viewtopic.php?t=632
    GPIO6-GPIO11 are typically used to interface with the flash memory ICs on most esp8266 modules, so these pins should not generally be used.
    http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations has lots of information on the pins.

    Kolban's book on ESP has a nice clear and color-coded table describing which pins are "safe" to use without any hassle.



  • This post is deleted!


  • This post is deleted!

  • Hardware Contributor

    Please add a wiring diagram for the RFM69.

    I found this:
    https://forum.mysensors.org/topic/3061/solved-esp8266-gateway-with-rfm69-wdt-issues/4

    But I miss the CE in that post.


  • Hero Member

    There is no CE pin on the RFM69

    https://www.mysensors.org/build/connect_radio



  • Please look right connection diagram. Not nrf24l01+. and you see how to connect. If you do not see you van watch with glasses.


  • Hardware Contributor

    @korttoma
    😮
    Shame on me... I am using a NRF2RFM69 adapter with a CE pin and didn't realize it has no function.


  • Hardware Contributor

    I'm currently adding some wifi gateways at work, I was wondering:

    • is ATSHA204 signing support something planned, or will it stay on soft-sign only mode?
    • is IRQ support something planned too?

    It's mostly to see if I need to plan to add these features on the PCB for later, or not.

    Thanks!



  • @FotoFieber Did you come right with the RFM69? I also struggling to get it working and need to confirm the wiring diagram.



  • This post is deleted!


  • @hek Hi, I am new to arduino but not to Vera, have been using Veralite for a few years, I wuould like to know how to add the Serial Gateway to Vera, I find it very confusing, it would be ideal if a video was created or step by step instructions for newbees like me, I will be more than happy to donate via paypal, Thanks so much

    reply


  • Admin

    @ramoncarranza

    What part is confusing? Did you follow the steps outlined here:
    https://www.mysensors.org/controller/vera



  • @hek I got it already, I was confused on the Vera Plugin vs the Arduino Plugin not realizing they were both the same, but now I get the following message on Vera
    "MySensors plugin : Choose the Serial Port"
    "MySensors Plugin[105] : Running Lua Startup"

    I have yet to assemble the Serial Gateway though, so I'm assuming the messages will go away once the Gateway is installed??????

    Thanks


  • Admin

    Yes, once you insert the usb gateway you just have to follow the instructions here:

    https://www.mysensors.org/controller/vera#configuring-the-vera-plugin-for-the-serialusb-gateway



  • Thanks so much!!

    This thing's Amazing!!!!!!



  • Hi all,
    I try to connect the Radio to Wemos D1 mini Pro and it's not working? I used both ESP8266Gateway and RelayActuator sketches and both Radio Fails...
    Are the pins here work fine with Wemos D1Mini?here is the pinout: http://escapequotes.net/wp-content/uploads/2016/02/d1-mini-esp8266-board-sh_fixled.jpg

    And here is the error I get:
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT

    thanks,


  • Hero Member

    If you are using the NRF24L01+ you should wire it according to the instructions here

    And use the sketch from the same page.

    So check your wiring of the radio module.



  • I used the same link (pins and sketches!). Checked it 10 times!
    I think my Radios are not functional....


  • Hero Member

    @sghazagh maybe you can take a picture of the setup. Maybe someone else can see something that you don't.



  • Good idea,
    Here is the side by side image from front and back of the PCB.
    The 'j1' marked on wrong pin ,that's why I think my radio is not working at all as it seems it's very bad replicate.
    However, I have rotated it by 180 degree and tried that as well. same result!

    0_1478323600970_radio.png



  • Guys, just an update for my issue regarding Radio and my circuit.
    The Radio was faulty, I received the new one, swapped it and all worked fine.

    I just posted that here if someone want to use my last post image as a reference for connecting the Radio.
    The wiring all are correct.

    Thanks



  • Hi Hek,

    Thanks for this guide... I have added an additional 433 RF receiver to my ESP8266 gateway. How can I send the data received from 433 RF to the my Home Assistant controller?



  • Hello, i have build a wifi gateway and use it in jeedom.
    My gateway wifi as connection problem.
    In jeedom, in the log of my sensors node I have almost every 2 days the message: diconnected from network gateway.
    If I restart the node the communication is re-established.
    Is this a problem with nrf24l01?



  • why esp8266 gateway shows only debug info?
    when i comment //#define MY_DEBUG
    where is no any serial output.


  • Mod

    @derrij because it is a wifi gateway?



  • If put in client mode
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 2, 9
    I get an error. How to win.

    **
    Arduino: 1.8.2 (Windows 7), Плата:"Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS), ck, Disabled, None"

    "C:\Users\DedHP\AppData\Local\Temp\arduino_build_364162\sketch\GatewayESP8266.ino.cpp.o"
    In file included from C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39:0,

                 from C:\Users\DedHP\AppData\Local\Temp\arduino_modified_sketch_313960\GatewayESP8266.ino:132:
    

    C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.h: In instantiation of 'size_t WiFiClient::write(T&, size_t) [with T = char*; size_t = unsigned int]':

    C:\Documents\Arduino\ams\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:207:58: required from here

    C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.h:123:36: error: request for member 'available' in 'source', which is of non-class type 'char*'

     size_t left = source.available();
    
                                    ^
    

    C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.h:127:5: error: request for member 'read' in 'source', which is of non-class type 'char*'

     source.read(buffer.get(), will_send);
    
     ^
    

    Используем библиотеку ESP8266WiFi версии 1.0 из папки: C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi
    Используем библиотеку MySensors версии 2.1.1 из папки: C:\Documents\Arduino\ams\Arduino\libraries\MySensors
    Используем библиотеку EEPROM версии 1.0 из папки: C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\EEPROM
    Используем библиотеку SPI версии 1.0 из папки: C:\Users\DedHP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\SPI
    exit status 1
    Ошибка компиляции для платы Generic ESP8266 Module.*



  • Hi,
    Is it possible to use this setup without the nrf24l01 atached, so that i can use the esp8266 just as a sensor (not as a gateway)?


  • Mod

    @Jonathan-Caes yes. Don't define MY_RADIO_NRF24 and you're good to go. It will still be a gateway, but a gateway with local sensors and no radio.



  • Hi how many Gateways Can i have on a network?


  • Mod

    @joseyapor On one MySensors network there can only be one MySensors gateway. But on one IP network, there can be many MySensors gateways. Exactly how many depends on geography and chosen transports but at the very least a few hundred. Thousands if you really need and plan accordingly.



  • Help! After connecting to the WIFI, I'm getting disconnected. Here's a log : https://goo.gl/fyr7ku

    Any help in figuring this out would be appreaciated!


  • Mod

    Welcome to the MySensors community @alexalex
    The log is missing the first lines, but it looks like the microcontroller is unable to communicate with the radio. Which radio are you using?

    See https://ci.mysensors.org/job/Verifiers/job/MySensors/branch/development/Doxygen_HTML/group__MyTransportgrp.html#details for more details about the log messages and https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help/ for the most common problems and how to fix them.



  • Is there a complete wiring table, diagram, or schematic? I have a working MyController/MySensors network on nRF24s, but I am adding WiFi with a ESP-201 module (white one with pins broken out for 2.54 pitch; see: http://smarpl.com/sites/default/files/images/ESP8266-ESP-201-pin-reference-v01.png)... TIA!


  • Mod

    @Bogus-Exception did you see the instructions linked in the first post in this thread? You probably want the part that says "connect the radio".



  • if i reboot my wifi router mysensors wifi gateway wouldn't try to connect again, is this only with me or its common issue with wifi gateway?


  • Mod

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

    if i reboot my wifi router mysensors wifi gateway wouldn't try to connect again, is this only with me or its common issue with wifi gateway?

    This question was transferred to a new thread by @pihome. Please don't answer here, to avoid double work and confusion.



  • Reporting batterypercent to Domoticz not working.
    I have built a ESP8266 Gateway and I connecting a BME280 sensor. It report everything right with a serial gateway but with the new wifi gateway it not reciving the battery percent. I look in the serial monitor at the gateway and where is no battery data.



  • Colleagues, tell me.
    can I make it so that hosts register on the gateway only if I press a button on the gateway?

    Perhaps there is an example?



  • Hello,
    I'm receiving the following errors:
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed

    I have attempted to fix this problem through:
    *Making sure I"m using the "NodeMCU" as my board in the Arduino IDE
    *Trying different upload rates
    *Pressing and holding the flash button while and/or right before upload

    Hardware:
    PC, windows 10
    NodeMCU from eBay link above.

    Any help? It appears others have had this problem as well, but I haven't (yet) been able to fix my issues through their threads.

    Thanks!

    Toozinger




  • Mod

    Welcome to the Mensors community @blackY !

    If you're new to building MySensor nodes, I recommend that you stick with the recommended build examples.

    It is probably possible to use the modules you link to, but it will require knowledge far beyond building the existing examples.



  • yes, I know...but if you are still staying by given examples, you don't develop yourself 😉



  • @blackY I'll just leave this here for a relative reference to that... link text



  • @zboblamont ROTFL...
    I'm kidding. This does not solve the problem. Isn't nice or exploring too.



  • I just want to bypass inbuilt wifi connection method in GatewayESP8266 and use my own code of SmartConfig to create WiFi connection. I'm not able to achieve this. is there any way to do this?
    Ive tried changing library (MyGatewayTransportEthernet) code, but it throws TSM exception. I've tested SmartConfig separately and it works fine with my Android App.



  • Sorry but can someone explain the differance between "Server" and "Client" modes. I got my ESP8266 working with my Vera but then I install a RPi 3 I'm using for MQTT. Do I need 2 gateways, one for the Vera and another for MQTT? Even though I'm moving away from the Vera it's still usfull. Thanks for the help.



  • One for thing will this work with a ESP32?



  • Sorry about the typing. I also have a question about radio pins. The ESP8266 sketch shows different pins for the radio then "Connecting the Radio". I don't see the pins defined in the sketch so where do I go to change them?


  • Mod

    @rwoerz thanks for reporting the difference between the wiring instructions. I have created https://github.com/mysensors/MySensors/issues/1096 to update the sketches.

    As long as you use the default pins, there is no need to change them. If you want to change them, see https://www.mysensors.org/apidocs/group__RadioSettingGrpPub.html



  • HI there, i have been using this code a while, but had to made some changes in my wifi connection info (because it seems that my Domotica controller couldnt command the gateway), but after a failed flash, i have managed to flash it again correctly, but it doesnt seem to connect to the gateway anymore, how can i check this? it wouldnt respond on a ping and i see no wifi connection in de serial log?


  • Mod

    Have you tried other sketches if they work? You may also try to flash a blank .bin file to erase everything on the esp8266



  • seems to work again indeed, had to flash something empty first.



  • Hi,
    I built a ESP8266 gateway using a wemos D1 mini and RFM95. I'd like to debug some communications with sensors with being attached to serial port of a computer, so I tried to connect via telnet.
    I can connect as telnet, but I don't see many details.. First, text in telnet is not aligned on the left, and second, it only lists some raw values instead of displaying same kind of verbose debug info like in the serial monitor.
    Is there a way to display same verbose text than in serial monitor ?

    Thanks,
    ricorico94



  • Hi,
    I answer to myself as it may help some other beginners like me.

    • there's a way to get the debug info via telnet session to the ESP8266 gateway: look fro MyNetDebug library in this forum.
      https://forum.mysensors.org/topic/7044/debug-messages-over-wi-fi

    • be careful if you reuse sketches from 2.2.0 with 2.3.0 library release : now instead of
      #define MY_ESP8266_SSID "MySSID"
      #define MY_ESP8266_PASSWORD "MyVerySecretPassword"

    you should use:
    #define MY_WIFI_SSID "MySSID"
    #define MY_WIFI_PASSWORD "MyVerySecretPassword"

    br,



  • I get the following errors when trying to Verify/Compile. I am trying to use the example sketch without any edits. Any ideas on what to do to fix this problem?
    Under additional Board Mangers I have the following.
    https://raw.githubusercontent.com/mysensors/ArduinoBoards/master/package_mysensors.org_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json
    I have MySensors version 2.3.0 installed and have trying using previous versions.

    Errors:
    In file included from E:*\MySketchesNew\libraries\MySensors/MySensors.h:420:0,
    from E:*
    \MySketchesNew\GatewayESP8266\GatewayESP8266.ino:118:
    E:*\MySketchesNew\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:57:53:
    error: declaration of C function 'void ets_update_cpu_frequency(int)'
    conflicts with extern "C" void ets_update_cpu_frequency(int freqmhz);
    In file included from C:\Users*
    \AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/pgmspace.h:10:0,
    from C:\Users*
    \AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/Arduino.h:256,
    from C:\Users*
    \AppData\Local\Temp\arduino_build_755180\sketch\GatewayESP8266.ino.cpp:1:
    C:\Users*
    **\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/include/ets_sys.h:218:6:
    error: previous declaration 'void ets_update_cpu_frequency(uint32_t)' here void ets_update_cpu_frequency(uint32_t ticks_per_us);

    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

    Thank you for the assistance.


  • Mod



  • I have some strange issues with my ESP8266 Wifi gateway and NRF24L01 connection.
    All goes well for a day or so or sometimes 3, but than the WiFi communication stops, rebooting my WiFi access point solves the problem.
    It shouldn't be a DHCP issue, because that is handled through the firewall, so it must be something else. Problem is i cannot see what goes wrong, because i don't have a log anywhere on the device?
    What could be the best steps to solve or find the issue ?


  • Mod

    @richard-van-der-plas to get a log, activate MY_DEBUG in teh sketch and connect the esp8266 to a computer or a log device like sundberg84's logger.



  • @richard-van-der-plas I recognise the problem you describe. Resetting the router seems related, but the effect of the restart is that the ESP loses its Wifi connection, making it crash and restart. Then it works again, so I think it is because it was reset.
    You could try to program the ESP with an empty bin file to make sure it will be emptied completely, and than reprogram the ESP with your sketch.



  • Hello! I'm so happy with the MySensors community the forum helped me so much to find answers, but I can't figure out the following:
    I'm building an Wi-Fi Gateway using an ESP8266. That gateway is running now but I want to add the LEDS and inclusion mode button. In the comments of the code I find out that I have to use pin 16 for all the leds?

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

    Is that correct? And with D? Pin do I have to use?

    For the inclusion mode button I have to use pin D1:

    // Digital pin used for inclusion mode button
    #define MY_INCLUSION_MODE_BUTTON_PIN D1
    

    But I can't compile this because I have to use an pin number and not just D1. How can I fix that? And how can I test/debug the button to see of it's in the inclusion mode?

    Thanks in advance!
    Robin


  • Mod

    Hi @b0wi, welcome to the forum!

    Some boards (for example Wemos/Lolin) define the Dn pins. If your board does not use the Dn naming convention, or if you like the gpio numbers better, just use the (gpio) number.

    Depending on your board, different pins can be used for different things. Some pins control boot behavior for example. See https://forum.mysensors.org/post/64783 for an earlier discussion on the same subject.



  • Thanks @mfalkvidd, I'm using this board: https://nl.aliexpress.com/item/NodeMcu-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266-module/32448461056.html?spm=a2g0s.13010208.99999999.329.1df83c00aOlGkL

    I've to use different pins for each LED right?

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

    And how can I test my inclusion button?
    Is there something to see in the log output?


  • Mod

    Indication leds: the same pin can be used. Pro: only one pin is needed. Con: you won't be able to see the type of indication. An alternaive, if you can't find enough pins, is to only activate one or two.

    Inclusion: hopefully someone else can assist. I have never used inclusion.



  • @mfalkvidd said in 💬 Building a WiFi Gateway using ESP8266:

    Indication leds: the same pin can be used. Pro: only one pin is needed. Con: you won't be able to see the type of indication. An alternaive, if you can't find enough pins, is to only activate one or two.

    Inclusion: hopefully someone else can assist. I have never used inclusion.

    It's working now!
    I'm using the following pins for the leds:

    // Flash leds on rx/tx/err
    // Led pins used if blinking feature is enabled above
    #define MY_DEFAULT_ERR_LED_PIN 0  // [D3 / GPIO 0] Error led pin (Red)
    #define MY_DEFAULT_RX_LED_PIN 2   // [D4 / GPIO 2] Receive led pin (Green)
    #define MY_DEFAULT_TX_LED_PIN 16  // [D0 / GPIO 16] Send led pin (Yellow)
    

    Pin layout ESP8266

    The leds where on all the time except when there was some activity, so I had to invent the leds:

    // Inverses the behavior of leds
    #define MY_WITH_LEDS_BLINKING_INVERSE
    

    For the inclusion button I've used:

    // Digital pin used for inclusion mode button
    #define MY_INCLUSION_MODE_BUTTON_PIN 5 // [D1 / GPIO 5] Button pin
    

    I needed to use an pull up resistor (10K ohm) for more stability.
    Pull Up Resistor



  • @mfalkvidd
    Quotes:
    "Don't define MY_RADIO_NRF24 and you're good to go. It will still be a gateway, but a gateway with local sensors and no radio."
    and
    "On one MySensors network there can only be one MySensors gateway. But on one IP network, there can be many MySensors gateways. Exactly how many depends on geography and chosen transports but at the very least a few hundred. Thousands if you really need and plan accordingly."

    Let´s say I have multiple ESPs, which should all act like a sensor node. I have a RPi w Domoticz, Mosquitto and MySensors MQTT ethernet gateway.
    I add the MQTT gateway to Domotics, listening on port 1883 (Mosquitto port). Now I set up a sketch, using

    #define MY_IP_ADDRESS 192,168,178,151
    #define MY_CONTROLLER_IP_ADDRESS 192,168,178,200 
    #define MY_PORT 1883
    

    which sets the gateway to client / node mode (as read on the documentation).
    Setting a node Id is ignored, ID is 0 and can´t be changed, so it is recognized as a gateway at domoticz.
    If I now set a second node to a different IP address and name, it overwrites the old one (as you say, there can be only one gateway).
    The question now is: how can I set up another ESP? Do I need another RPi or virtual machine with different IP address to install another gateway?



  • @inso said in 💬 Building a WiFi Gateway using ESP8266:

    Setting a node Id is ignored, ID is 0 and can´t be changed, so it is recognized as a gateway at domoticz.

    Imo using ESP8266-based devices all as GW's with locally attached switches (or other actively addressed children) conflicts also with other controller types (e.g. FHEM also doesn't like that on more than one GW).
    If you want to use that type of hardware, better use a different firmware like ESPEasy or Tasmota. The later seems to be a good fit for any installation using a MQTT-Server. (I personally don't like that kind of setup, wifi shouldn't be used for HA purposes imo).

    Just my2ct.



  • @rejoe2
    If I only would set up 8266´s I´d give it a try - problem is, I´m in love with the ESP 32.
    Bluetooth LE, multithreading, a second core only for the wifi stuff so no crashes on high wlan activity and no problems with time-critical events, lots of GPIO, awesome processor power, combined with the lower power consumption makes this the most-used chip here 🙂
    As far as I can see, both solutions you mentioned are not made for the ESP32 😞 .
    So I´d like to stick to MySensors as I could use lots of the sketches almost 1:1 (can´t be that hard to get more then one MQTT-"Client" running -.-).
    Only real other options I see is using MQTT-Clientsoftware from Basecamp or just set up an asynchronous http socket and code / decode the JSON-parameters send from and to Domoticz myself..



  • Sorry, I'm not familiar with the ESP32; perhaps you have a look around for other more powerful platforms on MySensors, starting here: https://forum.mysensors.org/topic/6961/nrf5-action.

    The problem within MySensors afaik is a double one:

    • First you have to make sure the GW get's the message. Eg. in FHEM, this is a problem, as one node basically is only identified by it's NodeID. As already described, internally there's a distinction between the GW part and the Sensor (node-) part. And the Sensor part gets unavoidably (at least afaik) the NodeID 0 - so for the controller all the Children are located at the same Node.
      As the controller notes just one IO (aka GW) per Node, Messages to the "unified" Node 0 will always be routed to the same GW. If this is different when using MQTT as transport layer and not serial or IP communication? (could be, as more clients can subscribe to a "Node 0"-topic...)

    • Second thing then is to make sure to not mess up messages intented for different GW's when doing some "broadcasting" by MQTT. Means: use different ChildID's for all the GW's sensors and actuators.

    Best success!



  • @andre65 did you figure this out? I have the same problem! Thanks.



  • @rejoe2
    You´re absolutely right.
    After 4+ hours debugging the MQTT gateway + ~10h trying to get MySensors MQTT on ethernet working properly, I tried a different way:
    installed NoteRed on the RPi and an asynchronous MQTT client on the ESP32, and within ~1 hour I had a fast and stable way to send messages from and to my nodes. Adding JSON parser on the ESP, and I can perfectly communicate with dummy Domoticz devices.
    Also, except of you and one very helpful guy within a private chat, noone preplied to MQTT-questions and ESP-stuff. Seems working with ESPs is reluctantly seen here on the forum.?
    So I assume a different way then using MySensors for everything except (battery-powered) Arduinos is the best I can do, to also have no problems in the future..



  • @inso
    Thanks for the feedback, sorry for your ineffective messin around with mysensors. I completely agree to your conclusion using MQTT directly on more powerfull boards able to communicate directly via WiFi.

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

    Seems working with ESPs is reluctantly seen here on the forum.?

    I can only speak for myself 😁 but indeed, I absolutely dislike having (regular) WiFi devices integrated in my home automation. My personal concept is to use as much wires as possible (thus I really love the RS485 stuff here!) and use different RF technologies whereever possible - and connect the corresponding GW's using a USB plug!

    So atm I exactly have 2 ESP8266-based devices integrated: One is a bridge for my MiLight stuff (avoid that type of devices, but in case if, use the sidoh-firmware!), one is a IR-Device to play around...

    But everybody has to find his own way. Just my personal thoughts on that topic 😏


  • Mod

    I am running nrf24 and rfm69 gateways on the raspberry directly, so I don't have the need for additional hw. I am planning to use the esp32 as a presence detector though


 

Suggested Topics

312
Online

8.0k
Users

8.8k
Topics

94.3k
Posts