Super Simple ESPNow to Wi-Fi / MQTT Gateway & Why I Use Two ESP8266s

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.พ. 2022
  • A quick video on how to build the hub 3 at home with a simplified Hub3 source code.
    Get 10 PCBs for $5 USD at www.pcbway.com
    Buy the Hub3 PCB - store.mrdiy.ca/p/thehub_ver3_pcb
    Source code is available for download to my TH-cam channel members as part of your membership benefits! Access it here: • Post
    Join the channel - / @mrdiyca
    Shopping for D1 Mini?
    ==================
    ■ MrDIY store = store.mrdiy.ca/p/wemos-d1-mini
    ■ Amazon - geni.us/84rr
    ■ AliExpress - s.click.aliexpress.com/e/_Af36zD
    Hub 3 - • The Hub 3 - an ESPNow ...
    Hub 2 - • The Hub 2 - an ESPNow ...
    Ultra Low Power Door Sensor - • Contact Sensor 3 - an ...
    Music by Coma-Media from Pixabay
    The links above usually are affiliate links that support the channel (no additional cost for you).
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 41

  • @steveswoodworking2504
    @steveswoodworking2504 8 หลายเดือนก่อน

    Great videos and projects!

  • @Bianchi77
    @Bianchi77 2 ปีที่แล้ว +1

    Nice video, thanks for sharing :)

  • @zyghom
    @zyghom ปีที่แล้ว

    very nice, I am actually working on similar project because my current sensors use wifi and I am not able to get anywhere near less than 1s from wake up to sleep (including: measuring temp/humidity/light, battery etc., sending to mqtt broker and going to sleep). With espnow I am below 0.5s but of course without sending to mqtt. So I need a gateway. But instead of 2 esp I am thinking like that: gateway receives data on espnow, then reconfigures itself to normal wifi/sta, sends to mqtt and then back to espnow receiver role. The only problem: gateway might miss the next data from another device (in case sender was trying to send to gateway/receiver, when gateway was sending to mqtt). Will try more before I give up and do it with 2 esp ;-)
    Your project is very neat - I like it.
    btw with espnow in place and 0.5s of sender being active, when it goes to sleep I went down to 4uA (all my sensors get power 3.3V from one of the esp32 pins, so when esp32 sleeps there is no power delivered to any sensor) - I am not using any LDO - direct power from lipo battery - esp32 works fine up to 4.2V I can see.
    btw2: I saw you are using cuts on the pcb for the programming - you could use soft serial for sending data between esp, right? and the hardware serial for programming. did you try?

  • @ryanhughes8137
    @ryanhughes8137 ปีที่แล้ว

    what do i use for the mqtt_server? sorry iam new at mqtt

  • @ernestogutierrez1153
    @ernestogutierrez1153 2 ปีที่แล้ว

    Dear MrDIY thanks for sharing this great gateway, do you know if it´s possible to use with Cayenne ? I suppose gateway code must be modified to add Cayenne Library

    • @MrDIYca
      @MrDIYca  2 ปีที่แล้ว

      Thank you. No, sorry. I am not familiar with the project.

  • @jeffrule1648
    @jeffrule1648 6 หลายเดือนก่อน

    Interested in building my own small stacked hub. How do you get TX/RX pins crossed in this design? By default TX->TX and RX->RX

    • @MrDIYca
      @MrDIYca  6 หลายเดือนก่อน

      I broke the pins and crossed the serial

  • @hermannsmobaspurn1885
    @hermannsmobaspurn1885 ปีที่แล้ว

    Where can I find the code?

  • @Photograaf11
    @Photograaf11 ปีที่แล้ว

    Maybe a weirdt question, is ESPNOW better then using the normal wifi on the esp boards and directly send to an mqtt server?
    Example: i currently have all my esp configured it sends the mqtt messages over WiFi BUT, i saw that the esp doesnt like my UniFi wifi setup and keeps disconnecting (even the one thats like 4 meters from the ap) at random moments. can ESPNOW send the date better?
    If so i was thinking about maken the gateway and use 1 esp8266 as espnow receiver and then a normal arduino chip with Ethernet.

    • @tjwatts100
      @tjwatts100 7 หลายเดือนก่อน

      ESPNow will be more efficient for battery devices as it can wake, send a packet and go to sleep. Normal Wifi will require quite a bit of overhead on each wake to achieve comms with the base station. So ESPNow has two options: reliable (wait for ack packet) and simple send-and-sleep. So it's like UDP but minus the additional WIFI overheads.

  • @rico8192
    @rico8192 2 ปีที่แล้ว

    What about using esp01 for EspNow? Thanks for the cool project

    • @MrDIYca
      @MrDIYca  2 ปีที่แล้ว

      Yes, you can use any ESP8266 module or board

    • @Andrew-rc3vh
      @Andrew-rc3vh 2 ปีที่แล้ว

      I had some problems with the ESP-01. When transmitting it take a lot of power and the chip can easily overheat and crash. The boards which come with a screened module seem to have enough surface area to stay cool and run reliably. The D1 mini is good and cheap.

  • @TwanJaarsveld1
    @TwanJaarsveld1 ปีที่แล้ว

    Could it be used in esphome instead of mqtt

    • @MrDIYca
      @MrDIYca  ปีที่แล้ว

      you should be able to

  • @ChrisS-oo6fl
    @ChrisS-oo6fl 2 ปีที่แล้ว

    I’m still super confused as to why this is better than using ESP home with HA and MQTT My current Esphome sensors are updating almost instantly with little to no lag each sensor has its own web page, I can subscribe to the MQTT topic with all my other devices, and HA displays all my sensors anyway. Sorry for my ignorance.

    • @MrDIYca
      @MrDIYca  2 ปีที่แล้ว +1

      Hi, no it doesn't make a difference if you are going over Wi-Fi. I assume your sensors are plugged into the wall and are not battery powered? I used ESPNow and a hub to minimize the time the sensors are powered on and consuming the battery. ESPNow is MUCH faster than W-Fi from a cold boot.

    • @tablatronix
      @tablatronix 2 ปีที่แล้ว +2

      ESPnow doesn't use wifi, so no 802.11 overhead, good for batery powered devices, and much faster than wifi negotiations on deep sleep

    • @zyghom
      @zyghom ปีที่แล้ว +2

      check how much time it takes for ESPHome based device from power on to sleep - you will be astonished - minimum 3-4 seconds. With espnow in place you can be done with 0.5s - that is the reason why building a gateway that is always powered on with clients (sensors) that communicate only with gateway and go to sleep might be reasonable. Battery life

    • @rahulkundu4u
      @rahulkundu4u ปีที่แล้ว +1

      Most of AP has a maximum client limit. Beyond that the connection sometime get unstable. This architecture resolves that issue too.

  • @jensschroder8214
    @jensschroder8214 2 ปีที่แล้ว +1

    I dont understand why you are changing the WIFI constantly.
    But maybe this is a good project to receive serial data and send it as MQTT.
    I have my weather station with the Mega2560 in mind. A serial output is quickly added.
    Then the ESP can take that and throw it over WIFI.

    • @MrDIYca
      @MrDIYca  2 ปีที่แล้ว

      Modern APs change channels all the time for better performance. Yes, you can use it that way too if you need Serial-to-MQTT gateway.

    • @zyghom
      @zyghom ปีที่แล้ว

      @@MrDIYca btw when you set up on your AP fixed channel (and on esp32 as well), then the connection from esp32 to AP takes 100ms as it does not need to scan channels

  • @abhiramanne9649
    @abhiramanne9649 2 ปีที่แล้ว

    yup making a single esp module to work with esp now and wifi together is a pain in the Ass

    • @Xander054
      @Xander054 13 วันที่ผ่านมา

      Is this still the case?

    • @abhiramanne9649
      @abhiramanne9649 13 วันที่ผ่านมา

      @@Xander054 I still think it is

  • @DocMicha
    @DocMicha ปีที่แล้ว

    Nice Video, but this is not a real gateway. As I understood you can only receive Data an change them to mqtt, but not vice versa....

  • @edwardsoares3838
    @edwardsoares3838 2 ปีที่แล้ว +2

    Or just change wifi channel from automatic to a static channel as you should anyway, especially if running multiple APs.

    • @MrDIYca
      @MrDIYca  2 ปีที่แล้ว +1

      If you are running multiple APs, you shouldn't be using the same channel.

    • @edwardsoares3838
      @edwardsoares3838 2 ปีที่แล้ว

      @@MrDIYca My point exactly, just didn't spell it out. Figured it was implied by setting channels rather than relying on background scanning to set these for you.

    • @MrDIYca
      @MrDIYca  2 ปีที่แล้ว

      Ok, maybe I am misunderstanding your point.

    • @edwardsoares3838
      @edwardsoares3838 2 ปีที่แล้ว

      @@MrDIYca Maybe I miss yours as well, I was thinking the second ESP was to provide a static WiFi channel for the first ESP. In which case someone should just set their AP or router to a static channel instead of automatic. This is still great info for someone who is not in control of the available WiFi.

    • @georgedlake
      @georgedlake 2 ปีที่แล้ว +2

      I had this problem. I made a sensor array for a client and at each site wifi channel was diferente and sometimes they would change it. This was why I made a gateway with 2 esp32

  • @s6a6n6d6m6a6n
    @s6a6n6d6m6a6n 26 วันที่ผ่านมา

    2:51 where is the source code? ah i see... you fail to mention that the code is only for paid subscribers thus you're technically "selling" it. I don't mind buying your products but this is trickery.

    • @MrDIYca
      @MrDIYca  24 วันที่ผ่านมา

      Sorry if that was misleading. I state in the description the source code is available as a perk for my members. The source code for my full and more complex espnow gateway (a video I made a while back) is available fully to everyone on my gitlab repo.

  • @crouchingchicken007
    @crouchingchicken007 7 หลายเดือนก่อน

    Thanks for video, I was able to use 1 ESP32 as receiver and connect over wifi with Blynk but only when wifi router is on channel 1. for me channel 7 on router is most stable but when peer is set to channel 7, error code appears saying peer channel is not the same as home channel, even though router is on 7, but it works when all components are set to 1. Does anyone know the reason for this? I've also seen a code that obtains the wifi channel on receiver board. If we can send this information from receiver to sender and this changes once every day or 2, would it be sustainable?

    • @MrDIYca
      @MrDIYca  6 หลายเดือนก่อน

      ... that is why I use two ESP8266

  • @schuballaa
    @schuballaa ปีที่แล้ว

    hi, my receiver olny receives J⸮f`⸮]7⸮⸮⸮@ olny myData.mesh_id etc is clear, why?

    • @MrDIYca
      @MrDIYca  ปีที่แล้ว

      That is the unreadable struct data. If you are not using the gateway code, you need to parse the data in the receiver itself.

    • @andreasbaumgartner7404
      @andreasbaumgartner7404 ปีที่แล้ว

      @@MrDIYca I have the same problem, I used the original source code and flashed it onto my wemos d1 minis. Do I need a espnow sensor to test it? Or is it possible to test it via the debug monitor? Are there any further tutorials you might recommend for a beginner like me to get it working? thx for helping :=)