Getting Started with ESP32 Wireless Networking in C | Wirelessly Enable Any Project with ESP32

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • The ESP32 by Espressif is an extremely powerful development board. You can use it to give the power of Wifi and Bluetooth to any IOT project you're working on, with zero hassle.
    In this video, we explore how to setup the Espressif IOT Development Framework, or IDF, and use it to write C code to connect the ESP32 to a Wireless Network. Once the device is connected, we are able to connect the ESP32 to a TCP server and retrieve data from that server.
    The ESP32 IDF uses FreeRTOS, an open source real time operating system that is used on smaller embedded boards. FreeRTOS allows you to make tasks for different features on your board. Pairing this with the IDF allows you to write powerful Wifi programs to the ESP32.
    Drop a like and subscribe to be alerted about new videos!
    ESP32 IDF Setup: • Getting Started with t...
    Code: www.github.com...
    Follow me on Twitter: / lowleveltweets
    Follow me on Twitch: / lowlevellearning
    Join me on Discord!: / discord

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

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

    This channel such a breath of fresh air, for many years there such a scarcity of high value embedded knowledge, glad see tide is changing. keep it up champ!

  • @r_be
    @r_be ปีที่แล้ว +15

    "but we don't do that here... we are writing this in C" - it is at this point I knew I have to like and subscribe this! :)

  • @ericbwertz
    @ericbwertz 11 หลายเดือนก่อน +11

    I'm from 20+ months in the future and your promise to do a video about ESP32 peripherals was a lie. Time travelers are embarrassing, aren't they?

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

    ESP32 is just the perfect balance between accesibility and performant low level. Also, built in FreeRTOS with the IDF is just perfect

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

      Can you recommend resources to learn ESP32?. I tried to use BLE on ESP32 but I got very confused and I couldnt find any guides or tutorials.

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

      Not really. The fact that the ESP32 is built to require an RTOS sucks for anything real time. It's decent for hobby projects as it has wireless but its actual architecture is way inferior to virtually any other chip

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

      @@TheChrisey Could you elaborate a bit more? I'm actually curious as to what architecture differences are you talking about

    • @conorstewart2214
      @conorstewart2214 11 หลายเดือนก่อน

      @@TheChrisey the ESP32 is good at what it is meant for, which is a wifi or Bluetooth connected device. It is also good enough for most real time tasks.

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

    I modified and built one of the ESP32 MQTT examples and I was shocked that I was able to login to my WiFi and connect to the MQTT broker software successfully.
    I also tried one of the ESPNOW examples and I was able to get two ESP32 devices to talk to each other. I am pretty impressed with the ESP32 sample code.

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

    I'm starting to see the light at the end of the tunnel with this video and the other ESP32 installation video from you, and the hours I spend in front of my PC. Very well explained. Muchas Gracias.⭐⭐⭐⭐⭐

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

    Your videos are top notch. Considering some merch... but would like something more discrete, like a small chip design or something

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว

      I was literally designing this as you commented! Coming soon

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

    this video is a great help. Are you thinking of making a video for LCD display with ESP32? That would be awesome

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

    Dont't know if it was on purpose, but I almost did not click the video becaude of the arduino logo. Not because I hate it but because I am intrested in learning esp-idf toolchain. So you might think about that.
    Great video! Your really help me getting into embedded :)

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

    First to watch and comment 👌 this is very informative thank you, so from now on I'll prefer using the C way instead of arduino,

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว

      Thanks for watching!

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

      You welcome, i have a question:
      I was using est32 bavk in 2018 and if I still remember there was Bug that prevented me to commercially use it, the bug was about the esp32 that halt after some time of using and there was no way to reboot it even with the internal watchdog, i had to counter it with external capacitor that trigger the reset pin after a while but that as silly, in that time i was using an arduino bootloader with other libs like mqtt,
      In C haven't you got any type of that bug?, is it even stable in the long terme use ?

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว

      Interesting.... that bug sounds like either two things were happening.
      1.) Your code had a bug that was causing the board to reset. Could have been some long-time-use integer overflow or maybe you didn't manage memory correctly and exhausted all the memory. Or
      2.) Maybe there is a hardware fault in the ESP32 CPU and over time it just flips over.
      No clear answer, but no that doesnt seem very usable in the long run XD

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

      @@LowLevel-TV lol definitely, it's a crash actually that the esp couldn't survive and it appears to be kinda random, if i still remember many users in the internet where facing the same thing and hope that is related to the arduino stack itself, other than that this device is wonderful for its price, even if it operates badly on batteries due to the bad handling of low energy consumption...

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

    A video like this for the pi pico would be awesome! The example projects for tcp are very hard to understand.

  • @davewuqio2516
    @davewuqio2516 10 หลายเดือนก่อน

    thank you for the video, it made the code so much more digestible for me

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

    Thank you for the upload!

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

    Thank you for making this video, it was so useful - I was struggling with the example until I found this. The next step would be to make the wifi startup code non-blocking and create a task to monitor when the wifi becomes available. I'm going to see if I can work out how to do this, but would love to find a video on it (hint hint) :P Thanks again, off to the races now...

  • @32_bits
    @32_bits 2 ปีที่แล้ว +3

    Your channel is excellent. Which ESP32 board are you using as I will order one? As there are so many types available will your code work on them all?

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว +1

      Thanks for watching! I use the ESP32-DevKitC. That's a great question, I'm actually not sure about the compatibility. I would imagine that as long as my code adheres to the ESP API and doesn't directly control individual pins, the code should be compatible. I'll have to test, though.

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

    First I thought, that you want to build some rover 😎😅

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

    Very nice video, THX.

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

    Awesome video! thankyou

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

    Fantastic tutorial! I finished up an arduino project recently for an adafruit ESP32, but wanted to try it closer to bare metal. Are there any other cool features of the ESP32 you could demo, like DMA or debugging FreeRTOS?

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว +5

      I will be going deeper into a bunch of these features :)

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

      @@LowLevel-TV Cool, thanks! Looking forward to it.
      Also happen to know how to use an ESP32 via SPI for slave communication?

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

    So after some thinking, i must say I am a little underwhelmed by this approach. While it's more intricated and tedious over the "Arduino" approach, it doesn't really seem to show any benefit, like access to the low level registers of the radio. I have heard that using the wifi functionality uses the second core of the ESP 32 that is hence not available in Arduino, but could we use it in this context?

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว +4

      I'm gonna be totally transparent with you, I actually haven't explored the Arduino option at all. I just like shitting on Arduino XD
      Me personally, I'd rather dive deep on the API's that the Espressif developers came up with to learn their base abstractions, and THEN learn how Arduino wraps it. As opposed to the other way around. I'm pretty sure you can use Wifi on Arduino ESP32 though?

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

      @@LowLevel-TV yeah the setup is easier of course but that wasn't really my point; even with the IDF we don't really "see" the radio device and how it works 😭

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว

      Oh I understand.... hm. I wonder how much deeper I could go into the radio interface. Food for thought 🧐

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

      @@LowLevel-TV In particular - can we use the second core (available through freertos calls) while wifi - or in general the radio - is being used? What limitations would there be (besides a lot of the ADCs not be available) etc. Can the radio be hacked to provide SDR, as in software defined radio, to receive arbitrary spectrum? Etc. Take it easy, keep up the fantastic job

  • @sidpan-op8dm
    @sidpan-op8dm ปีที่แล้ว

    when will you release new video about esp32 bro?

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

    does it work with nodemcu ??

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

    connect to or build http small server - sockets just handle protocol

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

    Thank you Great vid! Can you explain the cmake and configuration files in esp-idf GitHub examples? plz

  • @kumarkumar-md7ee
    @kumarkumar-md7ee 2 ปีที่แล้ว

    can you make bare metal programming or some videos on beagle bone black linux drivers please thank you

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

    Thanks

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

    If you are an embedded C engineer please reach our to us! Our project needs additional firmware engineers!

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

    Good videos, I recently had to switch to the esp32, and now im having a heck of a time converting my arduino wifi AP and http code into c, not fun.

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

    S-Tier tutorial

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

    Sweet. C! C! C! not c++, not Arduino. It is C. The awesomesauce!

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

    💜💚💙❤️🖤

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

    Interesting but way way too many adverts (every two mins plus pop overs) - TV does not have an ad blocker - TH-cam must have it in for me today,
    Lost track in the end...

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว +1

      Interesting, I definitely don’t have them in there that often. I’m sorry to hear that.

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

      @@LowLevel-TV it's very very odd - TH-cam advert quantity differ by time of day / night it seems in the U.K. since the last Amazon Fire stick app update! I'll try it again at some point in the day as I was enjoying it 👍 I'm wondering if TH-cam are pushing Amazon users to the pad subscriber level deliberately but £17 per month is way way too much!
      As for finding use for this - I won a single board computer without wifi from Electromaker so this gives me a way of linking it to the network - just need to build in a little web server but my C skills are zero so it should not be too hard 🤔 😲 😱 ❗️Going to be a fun year ahead I think...
      Take care and thanks for getting back to me.

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

    you twetter handle doesn't exist.

    • @LowLevel-TV
      @LowLevel-TV  ปีที่แล้ว

      fixed tyty

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

      @@LowLevel-TV started binging your channel. thanks for making videos. they are helpful.

  • @adanpantoja7116
    @adanpantoja7116 ปีที่แล้ว +31

    Finally a video showing how to do something with the ESP32 that ISN'T Arduino! Thank you!

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

    Thanks for the ESP32 content. I tried to use the ESP-IDF a year or so back and getting the hang of how to use it properly was just overwhelming-went back to Arduino. Demystifying all the esp_err_t things would be great but I’m also a relative idiot in these regards.

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว +6

      Happy to hear it was useful!
      Don't be afraid of all the different types. The API is well documented and I'm sure you could find the definitions for what you're looking for.
      In the case of esp_err_t, it's just an int :) (docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_err.html#_CPPv49esp_err_t)

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

    ESP32 can do not only wifi and Bluetooth, but also LoRa

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว

      Oooo good to know, wasn''t aware of the LoRaWAN

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

      @@LowLevel-TV my friend is using and ESP and LoRa to connect some barn with sheep down to town 😂

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

    Thank you for making this video! I am so glad I found your channel! Great quality. I found you while trying to learn to control a MG995 servo with ESP 8266 & 32. Didn't find that but found soooo much more 🙂

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

      Did you figure it out?

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

    I would love to see this in Rust. I've never used Rust but I've watched your latest two Rust videos and am strongly considering learning it. You got a sub from me!

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

      Unfortunately rust doesnt natively support esp32. But there is a rust compiler fork but i dont thinks its a good idea to use something experimental unless that is what you want. I have been looking into this. Stm32 is well supported with Rust. So that's what i am looking at.

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

    Hey i have a question, why do you use a event group for just one bit? Isnt it beter and less complex to use something else? I am just new and trying to learn so thats why i ask the question.

  • @antonioinochi9170
    @antonioinochi9170 5 หลายเดือนก่อน

    I tryng to write code for esp32 in rust, for me rust is a new language and this way for me is the best to learn new lany. I have. Aproblem to set stati ip address for router in accesspoint mode.someone jave advice?

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

    I love examples from internet. They are never working :))

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

    They python at the end is it in the raspberry pie or esp32????

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

    Brilliant as usual!

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

    Omg man, you're gold. I just subscribed and start watching and pressing like on every video of yours. Keep it coming please

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

    I find it difficult reading the server address as hex. I would prefer, if the s_addr was converted using inet_pton(AF_INET, ip_address, &addr.sin_addr);

  • @AdamS-lo9mr
    @AdamS-lo9mr 4 หลายเดือนก่อน

    i watched this 3 times and it still going way over my head. maybe im just dumb.

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

    Such a good video
    I'm wondering if it is possible to create a tcp_ ip server instead of connect to it? (Wifi station mode + TCP server)

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

    Enjoyed the video ! Got my subscribe.
    Would like to see a Bluetooth video like this one sometime

  • @Mohamed-kr8jt
    @Mohamed-kr8jt ปีที่แล้ว

    nice video, it was very useful
    can you explain how to control GPIO using register addresses
    I have try to look in the datasheet but I can't understand anything

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

    "But we don't do that here". That got you a new subscriber

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

    I would love to see BLE and WiFi combination

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

    Hi, could you share source code for this? It would be useful to see the includes at the beginning.

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

    cool tutorial, shown simply and clearly. Thanks a lot

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

    10:15
    we successfuly falid 👍

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

    I'm a big fan of your videos, they've helped me design a course focused in Hardware and Microcontrollers. Just a quick question. Which Linux distro do you use for your projects? From the looks of it I think you have Debian or Ubuntu

    • @LowLevel-TV
      @LowLevel-TV  2 ปีที่แล้ว

      Thanks for watching! I use Ubuntu 20.04 LTS with i3 window manager and a bunch of custom foo (feh, compton)