Easy ESP32-ESP32 Communication (BOTH TCP & UDP Tutorials with trigBoard)

Sdílet
Vložit
  • čas přidán 12. 09. 2024
  • Kind of a long one here, but these methods can be used to easily communicate between ESP32s - I have been updating my "Ultimate Home Security System" to use TCP instead of UDP, and so decided to make a video here showing that. Sorry for the long rambling :) This could be perfect if you only want to send data between two devices and even for a lot of trigBoard projects, like if motion occurs in the back yard, you can sound an alarm or turn lights on... something like that anyhow.
    Lots of resources:
    trigBoard Docs: trigboard-docs...
    The Ultimate Home Security Project is here: trigboard-docs...
    Links to sample Gateway code and other things you see here: trigboard-docs...
    I made a good tutorial on working with character strings: • Text String Tutorial i...
    Tindie link to trigBoard: www.tindie.com...
    Thanks to all the Patrons for dropping a few bucks in the tip jar to help make these videos happen!
    / kdarrah
    Twitter: / kdcircuits
    For inquiries or design services:
    www.kdcircuits...

Komentáře • 56

  • @hippie-io7225
    @hippie-io7225 Před 3 lety +13

    Everyone could benefit from having a long term project, passionately engaged! Good on ya' and congratulations!

    • @Kevindarrah
      @Kevindarrah  Před 3 lety +3

      thanks yea, took the week off from work and this is what I've been doin.. nice and relaxing

  • @alanmitchell6132
    @alanmitchell6132 Před 3 lety

    Thank you for the clear and concise instructions, it's easy for a novice to understand and very much appreciated.

  • @andraznovak6735
    @andraznovak6735 Před 3 lety

    I have worked with ESP-NOW. I combined it with 802.11LR and a cheap external antenna and I got at least 1500m (I couldn't test more) line of sight range and about 200m in an urban environment without a line of sight. You could easily halve "on" time even with ACK. The clunky part is addressing. You'll have to somehow set MAC address. But the good thing is that it's just incredibly fast. One of my gateways could handle 100 messages per second from 5 different devices. Just don't use the broadcast feature if you need the range because it doesn't retransmit missed packets.

  • @santopino2546
    @santopino2546 Před 3 lety +1

    Excellent
    Well done

  • @ZelleJ
    @ZelleJ Před 3 lety

    Cool stuff, Kevin! l.t.n.t. Hope things have been good for you. yeah i can see how versatile this could be. love keeping iot local. Keep up the awesome work! ~Bleu

  • @tinkmarshino
    @tinkmarshino Před 3 lety +1

    Kevin I want to set up a little bugler system and this seems right to me.. But my problem is I am a 68 year old newbie.. I have a very little knowledge but this is still a little over my head.. mostly the nomenclature. Do you have a paper on this? I have saved this to watch again slowly later.. But a good paper on it would be nice.. also do you have other videos on your channel that would help?

    • @Kevindarrah
      @Kevindarrah  Před 3 lety +2

      yea, check out the description - there's links there to the docs page for this project. Also, you can start with a simple system first - see the QuickStart tab

  • @MrBobWareham
    @MrBobWareham Před 3 lety +1

    Do you still do the original board with TH components please as I would like to make some?

  • @luizcarlosf2
    @luizcarlosf2 Před 3 lety

    If Iam not mistaken the minwifi lib is 64 conections... And for embebed is 256

  •  Před 3 lety +1

    Thank you for sharing.

  • @rdotkey
    @rdotkey Před 3 lety

    Awesome project(s)!!

  • @bennguyen1313
    @bennguyen1313 Před 2 měsíci

    Any thoughts what would be involved in writing an ESP32 application, that takes data from the uart, and passes it wirelessly either via bluetooth** (SPP) or via Wifi?
    For Wifi, I imagine the ESP32 could act as a web server (TCP) and display the RS232 data, but maybe there's also a UDP way to send data to a PC on the same network? I imagine, if the receiving application (mobile or PC) is written with the flutter framework, it could display the RS232 data with style!
    **I purchase some USB-bluetooth dongles (Feasycom BP102, HC-05/HC-06/CP2102 master modules, etc).. but none can connect to any android phone! For example, when a Samsung S5 tries to connect to one of the bluetooth dongles, it will stop blinking, but after a couple seconds, Android says 'Can't communicate with the FSC_BP102' or HC-05, or HC06, etc.

  • @rajveersingh2056
    @rajveersingh2056 Před 3 lety +1

    Hey Kevin.
    Please give me some keywords.
    I have a Server setup with esp32 and a pc with rest end points and all, you know. Everything works wirelessly and all my devices are wifi controllable now.
    Problem is, I need one esp for each board. Irrespective of how many pins I need. I have a feeling that one entire esp is a bit overkill for a board where one 1 or 2 devices are there.
    Question: Do you think there are devices that can connect to my wifi and turn off or on a PIN? Little bit cheaper and more compact than a full fledged esp32

    • @TheRainHarvester
      @TheRainHarvester Před 3 lety

      Use esp12e. They are much cheaper and use less power. Only 1 analog in. 16gpio. It's all I use.

  • @JimBeshears
    @JimBeshears Před 3 lety

    Nice job!

  • @RoamingAdhocrat
    @RoamingAdhocrat Před rokem

    which ESP32 releases the hounds?

  • @alessandrodellecoste1161

    this type of sketch will let 2 or more esp32 communicate in real-time?

  • @fredericguiet2077
    @fredericguiet2077 Před 3 lety

    Hi Kevin. This is a great improvement. I would like to build a LoRa trigboard...are you going to open source the trigboard datasheet of V8 as you did for the old version...that way I could do the LoRa version. Thank from France. Fred

    • @Kevindarrah
      @Kevindarrah  Před 3 lety

      maybe at some point - still pretty new

  • @TheRainHarvester
    @TheRainHarvester Před 3 lety

    Very awesome! I have a greenhouse I want to monitor but esp won't reach without a relay (no electricity in the middle). Is there a way to use a battery powered esp broadcast repeater that won't use the battery up ? Like a way to wake and be low powered to broadcast back to my house? (My greenhouse has solar).

    • @Kevindarrah
      @Kevindarrah  Před 3 lety

      I do use ESP32's as WiFi repeaters - trigboard-docs.readthedocs.io/en/latest/cellularProject.html#repeaters-range-extenders But they would not last long on batteries - maybe you can place one at the very edge of your house?

  • @annoorkhan4219
    @annoorkhan4219 Před 2 lety

    Do you use Mosquito MQTT ?

  • @ChrisS-oo6fl
    @ChrisS-oo6fl Před 3 lety

    Probably a dumb question but could the trig be used for a combination low power Bluetooth beacon/receiver and Pir sensor to help with location detection for home assistant?

    • @ChrisS-oo6fl
      @ChrisS-oo6fl Před 3 lety

      Apparently it was a dumb question. Sorry about that I guess.

  • @EmilFihlman
    @EmilFihlman Před 3 lety

    Why are you sending http data as a query string and not just normal data after the headers?

    • @Kevindarrah
      @Kevindarrah  Před 3 lety

      actually was just testing this today and works both ways, but almost think things go faster with the HTTP stuff... need to test more, but at least does not seem to slow things down

  • @L8rCloud
    @L8rCloud Před 3 lety

    If you could analyse the spectrum could you then jam that spectrum and completely disrupt communication,
    have you tried to play ‘devil’s advocate’ and break your own security system?

    • @Kevindarrah
      @Kevindarrah  Před 3 lety

      was thinking about doing a video on this - "Jam detection" and wouldn't be too hard to do - just have to setup cheap ESP32's around pinging back and forth with the gateway like some kind of heartbeat. If the connection with the beacons is ever lost, then you know something's not right.

  • @maser9433
    @maser9433 Před rokem

    Could you please share the code?

  • @Jm-my1rd
    @Jm-my1rd Před 3 lety

    Oh man I'm struggling on how to program and set up my BLE BL651 from Laird connectivity. Is there anyway can you have a video how to get start on BL651 module?

    • @Kevindarrah
      @Kevindarrah  Před 3 lety

      see the description and reach out through my contact page

  • @achalasamapriya2701
    @achalasamapriya2701 Před 3 lety

    if you send messages from the server to the client randomly ?? if you send them by surprise will they able to get that ??

    • @Kevindarrah
      @Kevindarrah  Před 3 lety +1

      yea I was curious about this too, instead of polling... I think it's possible. I mean, could easily mix UDP with this TCP method, so Monitors are still UDP broadcasted to. That would allow the client connections be reserved for the high priority trigBoards

  • @shyamsunder3859
    @shyamsunder3859 Před 3 lety

    If we have to transfer large data, what is the through put from ESP32 to mobile

    • @Kevindarrah
      @Kevindarrah  Před 3 lety

      search for the ESPasync library - that's how I transfer files

  • @carlosvaldez9281
    @carlosvaldez9281 Před 3 lety +1

    Have you tried using ESP-NOW?

  • @georgelavra6296
    @georgelavra6296 Před 2 lety

    Where is the code for TCP?

  • @ColinMcCormack
    @ColinMcCormack Před 3 lety

    I am very interested in espNow. I'm not really surprised there's no significant power difference between TCP and UDP ... it seems like a lot of the overhead would be wifi association. I like the use of an esp32 as a gateway. I have an esp32 with ethernet, have a desire to bridge espNow and ethernet. Using http server is unnecessary overhead - you could just listen on a port for a tcp connection and process it directly. Http protocol adds no value in this app.

    • @Kevindarrah
      @Kevindarrah  Před 3 lety +1

      hmm, yea I might try that out - I just started playing with this a couple days ago and started with example code from the ESPAsync lib

    • @ColinMcCormack
      @ColinMcCormack Před 3 lety

      @@Kevindarrah yeah, a straight 'wait for connection on socket with a callback, read content from fd, write reply to fd, flush fd, close fd' kind of server and 'open connect to ip+port, write to fd, flush fd, read content from fd, close fd' client would do. Only complexity is the format of your content. You could use fprintf, fscanf if you want to stick to ascii, which the young kids are doing these days, or you could just send binary.

    • @ColinMcCormack
      @ColinMcCormack Před 3 lety

      So I guess I contradicted myself - the only value http adds is the encoding of content as ascii or utf8, which you could achieve with fprintf/fscanf, or maybe json encoding. You're not sending much content though, so maybe fputs/fgets or write/read would suit you. Networking-wise, though, http doesn't give you anything but overhead.

    • @Kevindarrah
      @Kevindarrah  Před 3 lety +1

      thanks - gonna have to study up on that and try out - I'd like to eliminate as much overhead as possible

  • @neogeo8267
    @neogeo8267 Před 3 lety

    Any jamming detection?

    • @Kevindarrah
      @Kevindarrah  Před 3 lety +1

      nah, but that would be cool! Like maybe setup a beacon and if the gateway does not ever see that beacon, we know somethins up - idea for a video!!!

    • @neogeo8267
      @neogeo8267 Před 3 lety

      @@Kevindarrah that's exactly how I'd implement it. I suggest several at different extreme ends. If possible, dial back their radio power.

  • @emerymatteo2732
    @emerymatteo2732 Před 3 lety +1

    Really nice 👌 😍💋 💝💖❤️

  • @alanmarc2665
    @alanmarc2665 Před 3 lety

    Awesome 😍💋 💝💖♥️❤️