#152

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 271

  • @deangreenhough3479
    @deangreenhough3479 7 лет назад +7

    Another quicky!!!! Keep them coming Andreas

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +4

      Next two weeks it will be difficult...

    • @EwaldBurger
      @EwaldBurger 7 лет назад +1

      Andreas Spiess Enjoy your holidays then Andreas (at least I hope that is the reason why it seems the coming two weeks we have to do without you 😀)

  • @klassichd10
    @klassichd10 7 лет назад

    Great, thanks a lot! The lack of a second HW-Serial is one of the biggest disadvantages of the ESP8266

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      This is why I was disappointed at the beginning...

  • @ruegalfonso
    @ruegalfonso 4 года назад

    very useful, very clear, enough speed but at the same time no too fast.
    Excellent. I subscribed

  • @AlexandreLeone
    @AlexandreLeone 7 лет назад

    Andreas the Legend! I wish I could be able to communicate so complicated things in such an easy way. The underground room explain a lot of the way you see the world today. I'll always remember this tour, Andreas. Hopefully it will make me a better human being as it, for sure, does for you! Danke's a lot! 😘

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Thank you for your compliment. I appreciate it!

  • @Weldod909
    @Weldod909 6 лет назад +1

    I just discovered your channel right now, really nice ! Thanks a lot for your videos, you're great !

  • @RuiRex
    @RuiRex 7 лет назад +17

    I think that you can call Serial.begin(baud_rate, config, , ) (or something like that) and define the pins you want to use without having to mess with the library files...
    I haven't tried it yet so I can't confirm if it works...

    • @RuiRex
      @RuiRex 7 лет назад +2

      Also mentioned here: www.esp32.com/viewtopic.php?t=328

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +1

      Thanks for the tip.

  • @aemvasconcelos
    @aemvasconcelos 7 лет назад

    I like your videos. Well done. In this video you touched the subject of flow control and said that speed and buffers solved anything, but, look around, there's some kind of flow control everywhere in electronics.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      +Ocsav I I only referred to RS232 which is very slow. Faster protocols of course use flow controls.

    • @aemvasconcelos
      @aemvasconcelos 7 лет назад

      Andreas Spiess I thought that only asynchronous communication (like rs-232) needed flow control but it looks that communication between chips use 1 pin to do some kind of flow control even when there is a clock.

  • @EduardoCaporale
    @EduardoCaporale 5 лет назад +1

    Muchas gracias por compartir conocimientos Andreas, un cordial saludo desde Mar del Plata, Argentina.

  • @Gocast2
    @Gocast2 Год назад

    Well, it's been over 5 years since you made the video, and your edit of the .cpp file is the only thing that worked for me for Serial1 😂!!! Even the suggestion to use Serial1.begin (115200, SERIAL_8N1, 4, 2) continued to result in crashes. thanks!!!

    • @AndreasSpiess
      @AndreasSpiess  Год назад +1

      I think you can now specify the pins in the Serial.begin command

  • @bruceedwards8003
    @bruceedwards8003 Год назад

    I continue to enjoy your clear and concise videos. Thanks 😊

  • @tawsifbit
    @tawsifbit 7 лет назад

    Everytime I am trying to solve a problem you already have a solution you are like angel helping me out...thank you so much...😊

  • @mikoajwojciechowski9507
    @mikoajwojciechowski9507 7 лет назад +5

    Great tutarial Andreas, as always :-) You are making incredeble work. I like you channel very much.

  • @gafotaku
    @gafotaku 4 года назад

    You were just the solution for three days of search!! than you so much.

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      You are welcome! If you subscribe you do not need to search next time ;-)

  • @PhattyMo
    @PhattyMo 7 лет назад

    Happy to help out fellow tinkerers,Cheers!

  • @deangreenhough3479
    @deangreenhough3479 6 лет назад

    Back again, I knew id seen a video somewhere....... This has been a great help thank you

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      You are welcome. I recently myself had to go back to this video because I needed this info for a project...

  • @Really2950
    @Really2950 2 года назад

    Im still watching your old content :)

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      Obviously. This is truly an old one ;-)

  • @byxlettera1452
    @byxlettera1452 6 лет назад +1

    Interesting as usual! Very clear and you hit the point.
    Thanks

  • @DamienWise
    @DamienWise 7 лет назад

    This is a game-changer -- you can use one serial port for your application, and use another to debug at the same time.

  • @p._7555
    @p._7555 4 года назад +1

    Does the ESP8266 /NodeMCU applies for this "hack" ?

    • @AndreasSpiess
      @AndreasSpiess  4 года назад +1

      No

    • @p._7555
      @p._7555 4 года назад +1

      @@AndreasSpiess Thanks Andreas ! And thanks so much for your channel!!

  • @reanimationxp
    @reanimationxp 6 лет назад

    Just saved my project's butt Andreas. Thank you.

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      Glad to read that!

    • @reanimationxp
      @reanimationxp 6 лет назад

      I owe you, you're a fantastic person. I think you're gonna be my first Patreon sub, you earned it.

  • @andreaswimmer2392
    @andreaswimmer2392 6 лет назад +1

    Great video! That was exactly what I was looking for! Thank you!

  • @SA-oj3bo
    @SA-oj3bo 6 лет назад

    Hi Andreas, I made a design with ESP32-WROVER and I was shocked to find out that only 1 UART is free. I would be extremely happy if I can use the 3 uarts. Do you think it is possible to use any free pin for the TX and RX from Uart1,2,3? Is it possible to use interrupt buffers for every RX and TX ? IF so how to do that please? Thanks and kind regards.

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      1. You can try to use other pins. Most should work.
      2. I do not know about the buffers
      3. Maybe you watch this video: ruclips.net/video/eUPAoP7xC7A/видео.html

  • @CliveChamberlain946
    @CliveChamberlain946 7 лет назад

    In the drawing at 4:05, RTS/CTS you show as one signal coming from the receiving computer, but RTS comes from the sender (also called Data Terminal Equipment) and CTS is on another separate pin coming from the receiver (called Data Communications Equipment). Often, this RTS to CTS delay was caused by slow modems that didn't empty-out their small send buffers quickly enough onto the analogue line, or modems still waiting on the process of dialing-out and/or carrier sync.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      There was always some confusion with these names and who has which role, if I remember right. Fortunately, we do no more have to deal with them too much.

  • @roycejp
    @roycejp 5 лет назад

    Maybe this is a silly question... but where is this file (HardwareSerial.cpp) located ?

    • @AndreasSpiess
      @AndreasSpiess  5 лет назад

      Just search it on the PC. On my PC it is here: ruclips.net/video/GwShqW39jlE/видео.html

  • @carlopane4368
    @carlopane4368 3 года назад

    This might be a bit off topic, but would you have an insight into why an ESP32cam can send data to a serial monitor but when using pyserial it causes it to reset and no longer connect to wifi. As soon as I stop the program attempting to read from pyserial and go back to the serial monitor, the esp32 reboots and works fine.
    I have made sure my baudrate is set correctly.

    • @AndreasSpiess
      @AndreasSpiess  3 года назад +1

      I never looked into these ESP32cam boards, so I do not know:-(

    • @carlopane4368
      @carlopane4368 3 года назад

      @@AndreasSpiess I sorted it out, it seems to be an issue with the flow control sequence, github.com/pyserial/pyserial/issues/124

  • @amiga68k75
    @amiga68k75 6 лет назад

    Hi Andreas. Great video as usual! Helped me a lot. Thank you!

  • @alanlovett3412
    @alanlovett3412 7 лет назад

    What ESP32 do you use? Mine is a Geekcreit® ESP32 Development Board and only has 30 pins.

  • @colinparker9267
    @colinparker9267 4 года назад

    Does anyone know where I can find this HardwareSerial.cpp file on a mac with Arduino installed? I have added ESP32 boards in my boards manager but I'm not sure if I need to do something else so I can get to this file.

  • @chuckwilcox6997
    @chuckwilcox6997 7 лет назад

    Great work again, very interesting. Thank you for taking the time to share your findings and knowledge.

  • @mohamdazize8953
    @mohamdazize8953 9 месяцев назад

    Thank old man
    your are the best
    i search all RUclips and you like always help me
    Thanks and stay safe

  • @fredrikakerlund9819
    @fredrikakerlund9819 7 лет назад +10

    Joke:
    - "What's the best thing about living in Switzerland?"
    - "I don't know, but the flag is a big plus"

  •  7 лет назад

    How do i clear serial buffer in the smallest amount of lines possible plz im using esp 8266?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Somethin like that?
      void serialFlush(){
      while(Serial.available() > 0) {
      char t = Serial.read();
      }
      }

    •  7 лет назад

      Thanks il try it out later :)

  • @windowofwords
    @windowofwords 2 года назад +1

    I am working with nextion display and ESP32 earlier i uploaded the code in esp8266 to get value from the nextion using nextion.read using nextion.h library but now I am using ESP32 in ESP32 nextion.listen is working but nextion.read is not working i get value like 255 255 224 255 255 ...which are undesired values so kindly tell me what to do to solve this problem??

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      Unfortunately, I cannot remote debug :-(

    • @windowofwords
      @windowofwords 2 года назад

      @@AndreasSpiess you don't need to debug I am just asking and can you guess what actually be a reason behind this because same code is working with esp8266 but when i use ESP32 it's not working 😅

    • @AndreasSpiess
      @AndreasSpiess  2 года назад +1

      @@windowofwords I have no idea 😞

  • @FinneyDale
    @FinneyDale 6 лет назад

    If I understand correctly, pins 1,3 (tx,rx) are used for serial 0. Can I map serial 1 or 2 to these pins?

  • @udayangas
    @udayangas 4 года назад

    I'm using Wemos LOLIN32 (Retired). HardwareSerial1(2); is not working for me. But by using Serial2.begin(115200); in the setup I get it working. Any idea why this is happening?

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      No maybe they changed definitions since then.

  • @betojasz
    @betojasz 7 лет назад

    I have an issue with ESP32: I used it as a beacon scanner and tried two libraries different to scan(Using Arduino and Idf). Both, after a while, still searching for beacons but not finding anything at all and never back to find again untill reset!! Did you experienced the same? Thanks!!

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      So far, I have no experience with ESP32 and bluetooth. Maybe another viewer?

  • @MikeKranidis
    @MikeKranidis 7 лет назад

    Good fast lesson dear Mr. Andreas Spiess! The topic of ESP32 is in top priority for me. I am trying to learn how to work with IDF, ex how to "install" libraries in the Arduino IDE sense. It looks not easy at all though... If you know this topic please offer me/us a informative video when you can. Thanks in advance.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +1

      So far, I only know the Arduino IDE and have no other experience.

  • @MPElectronique
    @MPElectronique 7 лет назад

    Andreas, i got 3 mA in deepsleep with the module you showed on this youtube videos, is it normal?
    maybe i will have to remove the red led ?
    thank you.
    Marc.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +1

      There are a few things on these boards which consume current, the LED for sure, too

    • @MPElectronique
      @MPElectronique 7 лет назад

      Andreas Spiess if i remove the led do u think i can sleep for years ?? Thanks. I got 1 week now... :(

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      No. You have to use a WROOM module only without the Serial to USB chip and the LDO. Development boards are not optimized for low current consumption

    • @MPElectronique
      @MPElectronique 7 лет назад

      Andreas Spiess :-(

    • @MPElectronique
      @MPElectronique 7 лет назад

      Andreas Spiess thank you.

  • @HansVledder
    @HansVledder 7 лет назад

    Excellent video again Andreas! Thank you very much!

  • @fabricemenard4929
    @fabricemenard4929 5 лет назад

    Thanks a lot for this very understandable video. Nowadays, the path to HardwareSerial2.cpp looks to have changed, not in ProgramFiles x86 anymore (only the one for AVR platform), do you know where the esp32 files are now located? I looked for in users folder without success.

  • @markangelonambatac5791
    @markangelonambatac5791 7 лет назад

    Can you help me? Is it possible that If the BLE of esp32 will not detect any beacons it will send a notification through the internet?

  • @yomboprime
    @yomboprime 7 лет назад

    Hi Andreas. I bought a Lolin32 board and it gets hot very quick. I will not use the sleep modes because it is for a robot that will transmit video. I've put it a heat sink and a fan and it remains cool.
    ¿Do your different modules also get hot when active and using the WiFi?
    Thanks

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      So far I have no experience with heavy Wi-Fi traffic. But it is well possible that the module heats up as Wi-Fi is quite power hungry.

    • @yomboprime
      @yomboprime 7 лет назад

      Thanks. I must buy one of those USB mA and V display meters to see the current it consumes.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Or a electronic load/Monitor I showed in one of my latest videos... ( a little more expensive, but with PC connections for monitoring)

    • @yomboprime
      @yomboprime 7 лет назад

      Very interesting. Unfortunately the software is for Windows only, and I use GNU/Linux. Do you know if the serial protocol is documented?

    • @yomboprime
      @yomboprime 7 лет назад

      Finally I bought two of the cheapest ones. I measured the Lolin32: 140mA idle (making delay(1000) in a "for" loop), and between 300 and 350 mA with heavy processor and WiFi usage :-)

  • @ahmadmuhaimin2852
    @ahmadmuhaimin2852 Год назад

    where can i find the folder location on mac? i use IDE 2.0

  • @elixesachterachtet
    @elixesachterachtet 6 лет назад

    I'm searching for the excel file, you showed at 0:33. Where can i get it ?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      I put it here: docs.google.com/spreadsheets/d/12qL3ui2BkSn91O0ISJU8QIL2mcG-r_vlX0briknA2QQ/edit?usp=sharing

  • @starlingwatch3921
    @starlingwatch3921 3 года назад

    Grüetzi und Vielen Danke. It works! -Frank

  • @alexramos2568
    @alexramos2568 4 года назад

    Great info, but I still don't get it to work, I'm messing things up.
    I have a Heltec WiFi kit 32, the one with Oled and a GPS6MV2 module.
    I can't get the GPS module and the Oled to work at same time.
    Like to show GPS info on the screen.
    Is it even possible?
    Tried many code example, changed the code, add, remove lines...
    GPS woks alone, Oled woks alone but not together.
    Can use all the help.
    Thanks

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      Unfortunately I cannot do remote debugging... I usually start with a running system and add line by line till it stops working...

    • @alexramos2568
      @alexramos2568 4 года назад

      @@AndreasSpiess Im at the point were I using the UART1 to program the board and after to connect the GPS.
      But this is not the ideal configuration.

    • @alexramos2568
      @alexramos2568 4 года назад

      @@AndreasSpiess Can you explain how to connect a serial sensor on UART3 and show the values on the Oled.
      I'm trying to used a Heltec WiFi kit 32 and a GPS module to make a position device for my cat over wi-fi.
      Thanks

  • @MrAlekoy
    @MrAlekoy 7 лет назад

    is it possible to run one of the ports in 1200baud, 8n2? I have a meter I want to connect to that has those parameters..

    • @stryk187
      @stryk187 7 лет назад

      I believe the baud rates on these microcontrollers are configurable. In the setup code: Serial.begin(115200) change to Serial.begin(1200) to specify 1200 baud (after checking the datasheet specs to make sure 1200 baud is supported, of course)

    • @MikeKranidis
      @MikeKranidis 7 лет назад

      stryk187 he wants non parity, also 2 stop bits ( aka 8n2 ). That is not so easy or common...

    • @MrAlekoy
      @MrAlekoy 7 лет назад

      Correct, the teensy does it, and I have tested most of my code on one, so I know that I can get the data I want from my power meter.
      I probably have to use the teensy to gather data from the meter, and pass it on to an ESP to send MQTT or modbus over to my node red or openhab server.

  • @Mobeone
    @Mobeone 7 лет назад

    Another great video Andreas. Please keep them coming! By the way, will you be testing the ESP32's CAN bus interface at any point?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      I do not know for the moment. It has no high priority for me.

  • @distancelab2010
    @distancelab2010 7 лет назад

    Awesome as usual. Thanks for the video. Very interesting.

  • @CraigHollabaugh
    @CraigHollabaugh 7 лет назад

    Hey thanks. I needed this exactly! Didn't know that pin routing for esp23 uarts was possible.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      I also discovered it by chance and thought, it could be useful for others...

    • @CraigHollabaugh
      @CraigHollabaugh 7 лет назад

      Yes, many Arduino users don't know about pin muxing. I've updated my original post here with a hackaday explanation.

  • @mrkumar6020
    @mrkumar6020 2 года назад

    Hello @Andreas Spiess I am afraid to say that I tried it with ESP32 and not worked for me at all. Any further help will be greatly appreciated to fix this. Thanking you.

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      Serial.print() and Google are your friends for debugging...

  • @guilhermeaugusto2396
    @guilhermeaugusto2396 4 года назад

    May i have 4 or 5 UART Channels by editing the file hardwarSerial.cpp?
    Thanks

  • @fabianrogg4272
    @fabianrogg4272 4 года назад

    Thx for the video.
    Do you have an example, where one esp sends data to another esp via UART?

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      No. I usually do this wirelessly ;-) I think you find such a project.

  • @joska9744
    @joska9744 3 года назад

    a very interesting video for me!! Thank you!

  • @mikehudson3620
    @mikehudson3620 7 лет назад

    How did you implement flow control when you were a morse operator?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      +Mike Hudson we stopped after a few words and the receiver either confirmed or asked what he did not understand. And we repeated

  • @TomaszDurlej
    @TomaszDurlej 7 лет назад

    RTS/CTS stuff aren't unnnecesary nowdays, with it a MCU can archive higest speeds of UART.

  • @petrdvorsky6615
    @petrdvorsky6615 4 года назад

    So, I can REMAP UART1 and UART2 to any GPIOs I want?

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      Yes. Just check: Not all pins can be used because they are used for other things.

  • @hamidrasyid1560
    @hamidrasyid1560 5 лет назад

    hi, thanks for your tutorial, it's really helpful, but when I try this "extra" serial, my wifi performance from esp32 down, and cannot connect.. do you experiencing this?

    • @AndreasSpiess
      @AndreasSpiess  5 лет назад

      No.

    • @hamidrasyid1560
      @hamidrasyid1560 5 лет назад

      @@AndreasSpiess so any suggestion to check my this problem?

    • @hamidrasyid1560
      @hamidrasyid1560 5 лет назад

      @@AndreasSpiess can I have your email? so we can discuss furthermore

  • @OFCIFR
    @OFCIFR 3 месяца назад +1

    I think there is software serials library even for esp32 now, it's easier to use

  • @vipinckty1
    @vipinckty1 4 года назад

    Thank u for sharing the knowledge

  • @Aemilindore
    @Aemilindore 6 лет назад

    Hi, the files no longer exist in that directory. Where can be locate the files? Have things changed now?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад +1

      Maybe you watch my newest video and install the ESP32 accordingly. Then go to the directory where the preferences.txt file is installed. From there you go "packages\esp32\hardware\esp32\1.0.0\cores\esp32" and you will find hardwareserial.cpp

    • @Aemilindore
      @Aemilindore 6 лет назад

      Andreas Spiess got it. I will do it that way. Thank you. It seems of you follow the official repos instructions, this file you say is not available. Thanks for quick response

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад +1

      I pinned a comment with the exact path. So it should be visible to everybody. A few other viewers asked the same question.

    • @Aemilindore
      @Aemilindore 6 лет назад

      Andreas Spiess oh thank you. Will find it.

  • @viniciusmay6580
    @viniciusmay6580 6 лет назад

    Hi, thanks for your patience to teach us.
    I need to connect 3 serial ports on my esp32.
    Hw Serial 0 -> fw update and logs
    Hw Serial 2 -> gps
    Sw Serial -> gsm
    I already know that Serial 1 is connected to flash memory.
    So I need to emulate a serial port through GPIO's.
    I tried using an Arduino "Serial Software" library, but unfortunately on a compilation error. Reading in some forums and making some changes in the library, I was able to compile the "Sketch"; but the communication of my GSM modem via SoftwareSerial did not work.
    Note: By connecting the GSM modem separately to a USB / SERIAL converter the communication worked as expected. That is, the problem really is in SoftwareSerial emulation.
    Could you help?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад +1

      Why do you not use this solution?

    • @viniciusmay6580
      @viniciusmay6580 6 лет назад

      Andreas Spiess because this dont works too :(

    • @viniciusmay6580
      @viniciusmay6580 6 лет назад

      Please, i want that you see my image in this link: screenshot.net/pt/d65llbv
      So. I need this configuration in my esp32 project:
      The GPS module sends data position to UART0.
      The GSM module sends data to UART0 It also receives commands that must be sent by UART0 (at commands, for example).
      Finally, "uart0" serves as interface for the computer or other microcontroller, both for data traffic and firmware update
      Please, can you help-me?
      /*********************************************************/
      HardwareSerial Serial1(1); // is not linked to flash memory
      HardwareSerial Serial2(2); // hardware serial (uart2 on esp32)
      void setup()
      {
      Serial.begin (115200);//uart0 - flash firmware update and serial monitor interface
      Serial1.begin (9600) ;//uart1 - gps - only send data position to uart0
      Serial2.begin (115200);//uart2 - gsm
      }
      void loop()
      {
      while(1)
      {
      char r = Serial1.read ( );
      Serial.print (r);
      Serial2.println ("at");
      Serial.print(Serial2.read () );
      }
      }
      /*******************************************************************************/

  • @shapathsust8948
    @shapathsust8948 7 лет назад

    Sir I am new in esp32 and arduno .i want communicate arduno mega to esp32 serialy.what can ido?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      You have to connect the two serial connections and use serial.print() on one board and Serial.read() on the other.

  • @ERICRAC
    @ERICRAC 7 лет назад

    Very nice as always

  • @AbiChess.tricks
    @AbiChess.tricks 6 лет назад

    So efficiently we can use only 2 Uart for our purpose apart from programming am I right?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      I am not sure what you mean. You can only use 2 if you do not want to change the library.

    • @AbiChess.tricks
      @AbiChess.tricks 6 лет назад

      Andreas Spiess if I didn’t change the library then I can use only two Uart even in that one goes to programming memory am I right so finally I can use only one

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      You can use 2 UARTs on the ESP32 without changing the library.

  • @dominpiano
    @dominpiano 4 года назад

    I don't have "espressif" folder in arduino\hardware....

    • @AndreasSpiess
      @AndreasSpiess  4 года назад +1

      Maybe you watch the videos about installing the ESP32 in the Arduino IDE first

  • @philliptoone
    @philliptoone 6 лет назад

    2:45 Is this "secret" UART using any arbitrary GPIO pin a software or hardware UART?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      I do not understand what you mean.

    • @philliptoone
      @philliptoone 6 лет назад

      @@AndreasSpiess I believe the Arduino will allow you to use any pin for UART by implementing the UART through a serial library rather than the hardware that is built into the chip for specific pins. Is that what you are doing here or does the ESP32 allow for hardware UART on any pin?

    • @paulcgn
      @paulcgn 6 лет назад +1

      @@philliptoone AFAIK the ESP32 has remappable PINs, thus it should still be hardware UART (see Chapter 4.2 and 4.3 Peripheral Output via GPIO Matrix in www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf)

  • @scharlesworth93
    @scharlesworth93 6 лет назад

    Helpful man I was wondering how to do this.

  • @montectronyxz
    @montectronyxz 3 года назад

    Thanks. Great Video. Very useful.

  • @KroceBow
    @KroceBow 7 лет назад

    Nice video, I am having some troubles setting the esp32 as a keyboard, I think either it's not yet implemented or I'm doing something wrong. I hope in your next videos you will cover this section :) !

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      So far, I have many other topics which have a higher Prio. As you mention, maybe there is no library around...

  • @B4x4
    @B4x4 7 лет назад

    This video was useful. Thanks.

  •  5 лет назад

    great explanation. thank you.

  • @iamsuperroot
    @iamsuperroot 4 года назад

    What is use for 3rd? another tx?

  • @wei48221
    @wei48221 7 лет назад

    Always enjoy your video....

  • @LUCKY007725
    @LUCKY007725 6 лет назад

    Thanks for useful information
    I have some sensors and relays connected with arduino uno and i want to make a communication between UNO and esp32 via SDA and SCL pins...
    On the uno, both are mentioned and working fine whereas the problem is with esp32
    Please guide me how to connect them and what code is required for esp32 for affective communication
    Regards

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      Maybe you search for an I2C tutorial for the ESP32. It has some specialties like the wire command.

  • @EwaldBurger
    @EwaldBurger 7 лет назад +1

    Thanks for yet another interesting video Andreas. As others have said, you do not have to mess with the esp files as you can define the pins you want to use during the call to serial.begin. Using the pins you choose, this would become: Serial1.begin(115200, SERIAL8_N1, 4, 2);

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Unfortunately, this did not work in Arduino IDE when I tried (both, Serial1 and SERIAL8_N1 are not known)

    • @EwaldBurger
      @EwaldBurger 7 лет назад +1

      Hi Andreas,
      It seems I made a typo in my reply. Instead of SERIAL8_N1 you should use SERIAL_8N1 (note the location of the underscore).
      When I posted my comment I was on holiday in Austria so had no possibility to test it. I just looked up the relevant library files then on my iPad.
      Today, it took me quit some time before I found out that I made this typo.
      You'll find all possible definitions of the serial port settings (like SERIAL_8N1) in the header file "esp32-hal-uart.h" that lives in the same folder as the esp file you modified.
      Object variable Serial1 should be recognized as long as you instantiate it first (like you did in your example). Don't know what goes wrong there at your set up.
      Here's the code that works for me (Here I choose to change both serial 1 and 2 pins):
      HardwareSerial Serial1(1);
      HardwareSerial Serial2(2);
      #define TX1_pin 12
      #define RX1_pin 13
      #define TX2_pin 2
      #define RX2_pin 4
      void setup() {
      Serial.begin(115200);
      Serial1.begin(115200, SERIAL_8N1, RX1_pin, TX1_pin);
      Serial2.begin(115200, SERIAL_8N1, RX2_pin, TX2_pin);
      }
      void loop() {
      Serial.println("This message is sent to USB Seriall");
      Serial1.println("This message is sent to UART1 Serial");
      Serial2.println("This message is sent to UART2 Serial");
      delay(1000);
      }
      Hope this helps.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Now the code compiles! Did not yet check the pins, but I assume, you did ;-) Thank you very much for this hint.

    • @naasikhendricks1501
      @naasikhendricks1501 6 лет назад

      hi guys can someone just clear something up for me? UART0 is the uart that is standard connected to the serial that one uses for the loading the sketch?
      which is pins marked RX and TX on the dev board...?
      Many thanks in advance!!!

    • @okj205
      @okj205 6 лет назад

      Yes. Rx and Tx are GPIO pins 3 and 1 which are connected to UART chip to upload sketch to the Esp32. These pins are also used by UART0 to print text to the serial monitor (Serial.print(), you can see this in the HardwareSerial.h library). However UART0 is not tight to pins 3 and 1, you can change it to other pins but you can no longer use command Serial.print()

  • @AdrianCosic
    @AdrianCosic 7 лет назад

    Nice video, I want to build a PM2.5 monitor with three serial sensors and this could be very useful.

  • @Salfke
    @Salfke 4 года назад

    Hi Andreas, I knew you made a great video about getting both UARTS to work with ESP32.
    Unfortunately the content of the video results in a not working result if you use the latest ESP32 software.
    if i use the following lines: HardwareSerial Serial1(1); / HardwareSerial Serial2(2); the serial ports don't work at all.
    without using HardwareSerial lines, the ports work fine.

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      True. They changed the syntax. Thank you for mentioning it.

  • @dileepgowda6586
    @dileepgowda6586 3 года назад

    how to receive data from rs232 to esp32 using rts and cts in arduino

    • @AndreasSpiess
      @AndreasSpiess  3 года назад

      RTS and CTS do not carry data, they just signal readiness of the device.

  • @PaulSchulinck
    @PaulSchulinck 3 года назад

    Andreas thank you for the very informative video !
    I use an ESP32-S2-Saola-1R (WROVER). It has pin 43 marked as TXD and pin 44 as RXD. I see in the installed \cores\esp32\HardwareSerial.cpp the following(lines 63-69
    #if CONFIG_IDF_TARGET_ESP32
    rxPin = 3;
    txPin = 1;
    #elif CONFIG_IDF_TARGET_ESP32S2
    rxPin = 44;
    txPin = 43;
    #endif
    so, I don't have to change the definition for rxPin and txPin.

    • @AndreasSpiess
      @AndreasSpiess  3 года назад

      Thanks for the update. This is an old video.

  • @omaryanas435949
    @omaryanas435949 7 лет назад

    Great video, thanks alot.

  • @h200330
    @h200330 7 лет назад

    Wow, this really helps a lot!!!!!!! Thanks~~~

  • @codebeat4192
    @codebeat4192 4 года назад

    What about a BlueTooth Serial? Is this possible?

  • @zgryx8428
    @zgryx8428 2 года назад

    Hello sir can you do ESP32 Camera module and Arduino Serial communication? it doesn't work for me. Thank you so much for a wonderful tutorial❤️

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      Unfortunately, I cannot do remote debugging :-(

  • @СистемныйАдминистратор-э3ц

    Thank you for your video !! It really helped me! You can make a link to the file with contact numbers and the notation of ESP32.xlsx?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      You find the link in other ESP32 videos.

  • @mbueno0
    @mbueno0 6 лет назад

    Anybody getting this error when trying to use attachInterrupt() on esp8266 or esp32? (Arduino IDE v.1.8.5, esp8266 v.2.4.1, latest esp32 board defs as of this week)?...
    functions.h:164: error: invalid conversion from 'boolean (*)() {aka bool (*)()}' to 'void (*)()' [-fpermissive]
    attachInterrupt(digitalPinToInterrupt(stepCounterInterruptPin), stepCountHandler, RISING);
    ^
    In file included from C:\Users\Bueno\_Arduino\hardware\espressif\esp32\cores\esp32/esp32-hal.h:52:0,
    from C:\Users\me\_Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:35,
    from sketch\exp32Driver_v0_01.ino.cpp:1:
    C:\Users\me\_Arduino\hardware\espressif\esp32\cores\esp32/esp32-hal-gpio.h:81:6: note: initializing argument 2 of 'void attachInterrupt(uint8_t, void (*)(), int)'
    void attachInterrupt(uint8_t pin, void (*)(void), int mode);
    ^
    stepCounterInterruptPin is pin 2, aka '2', the unsigned, 8 bit integer.
    email me with solution if you have one (please)! mbueno0@gmail.com

  • @ikeo8666
    @ikeo8666 4 года назад

    why does uart2 have 5v on the rails tho? esp32 uart is so weird.

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      I do not think that any ESP32 pin has 5 volts.

    • @ikeo8666
      @ikeo8666 4 года назад

      @@AndreasSpiess The volt meter doesn't lie. GPIO 16 & 17 are reading high 4's. But you know what after trying out those esp32s wrooms I've come to the conclusion they are garbage. They go into a reboot cycle if you don't supply the exact volts/amps on the 5v pins.. but work fine when using the USB connector. My ai thinker esp32 cam works like a champ. Think I'll stick to AI thinker esp32s from now on.

  • @andreyl2705
    @andreyl2705 Год назад

    very useful. thank you)

  • @krissutikno2136
    @krissutikno2136 Месяц назад

    But where location thats file?

    • @AndreasSpiess
      @AndreasSpiess  Месяц назад

      I do not understand your question :-(

    • @krissutikno2136
      @krissutikno2136 Месяц назад

      @@AndreasSpiess thanks, now already solved, last i can't found hardwareserial. cpp on my hardisk 😁, and i can't install that library, anyways thanks a lot🙏

    • @PresidenteHollanda
      @PresidenteHollanda 12 дней назад

      I am using Platform IO and aan ESP32-WROOM-32D bord, noticed that the HardwareSerial.ccp has been completely rewritten. It now detects by default if you use other pins for serial communication. But still in doubt for UART 1, because somehow i did not get that UART 1 to be used even on other pins defined.
      HardwareSerial Sender(0); // UART 0 => default pins TX0: 01 RX0: 03
      HardwareSerial Receiver(2); // UART 2 => default pins TX2: 17 RX2: 16
      Assigned receiver 2 to different pins as the default for testing;
      Sender.begin(115200);
      Receiver.begin(115200, SERIAL_8N1,/*Tx=*/ 13,/*Rx=*/ 12);
      Testing Sending and Receiving between those two UART's on the same ESP board, and that works without problems.

  • @victorlabracaceres7947
    @victorlabracaceres7947 5 лет назад

    no me funciono tengo esp32 con 38 pines

  • @javiercabesa7616
    @javiercabesa7616 Год назад

    thank you!!

  • @vidanatural_oficial
    @vidanatural_oficial 7 лет назад

    very nice.. thank you.

  • @aspzx
    @aspzx 7 лет назад +1

    But... why would you ever want 2 serial buses, let alone 3?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +1

      Always if you want to connect one serial device and still need the Serial Monitor for debugging

    • @DamienWise
      @DamienWise 7 лет назад

      aspuzling, excellent question; Andreas Spiess, perfect answer. Thankyou both!

    • @aspzx
      @aspzx 7 лет назад

      Sorry, I still don't understand. What kind of serial device are you talking about? The only device I know of is the serial monitor.

    • @rusty0101
      @rusty0101 7 лет назад +2

      You may be using the esp32 as a control interface for an external device that doesn't talk i2c or spi. For example you may be using the esp32 to provide a wireless link for a weather station, or as a means of controlling a cellphone device to send sms text messages advising of something like a water leak filling your basement. Many of these devices either communicate via uart or rs232/serial. While you may only need a single serial connection for these most of the time, having a second, or third for some situations, may be the only way of debugging what the esp32 is seeing as you are developing your project.

    • @MagivaIT
      @MagivaIT 6 лет назад

      i would think this is useful for offloading (sharing work), having more than 1 esp32 to do tasks, for example one could be used for motor control and one for balancing calculations, feeding data back to a central esp32, think of a robot dog (although there probably isnt enough power with the esp32), this way you technically increase the processing power by offloading work to other esp32's

  • @avejst
    @avejst 7 лет назад

    Thanks for sharing

  • @klassichd10
    @klassichd10 7 лет назад

    Just a notice: A few days ago the github.com/espressif/arduino-esp32 has been updated. This also contains a new partition table (default.csv) for flash and a migration of EEPROM lib from ESP8266. And it works (up to 4096) as described there github.com/espressif/arduino-esp32/issues/525

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Thanks for the tip!

    • @klassichd10
      @klassichd10 7 лет назад

      Now I also have NTP and OTA running. OTA is not always shown in the arduino IDE but it works using espoty.py from Batch or command line. Now I have more hope in migrating some ESP8266 projects to ESP32

    • @klassichd10
      @klassichd10 7 лет назад

      Great! I had some trouble with the migration of the webserver.
      But this github.com/espressif/arduino-esp32/tree/5e89f5e9fabe56d8e8af956bcd7635bf218e29a0/libraries/ESPWebServer/src helped.
      But as you can see there github.com/espressif/arduino-esp32/pull/430 unfortunately this will not be supported by the "official ESP32 community" in the future. But for now it seems to work.

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      :-)

  • @AmauryJacquot
    @AmauryJacquot 4 года назад

    you can specify pins in HardwareSerial.begin()
    see here : github.com/G6EJD/ESP32-Using-Hardware-Serial-Ports/blob/master/ESP32_Using_Serial2.ino

  • @basementjack2
    @basementjack2 7 лет назад +7

    Please setup a patreon account so we can send you a few dollars a month!

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +11

      Thank you for your offer. Maybe at 50'000 subscribers. For the moment, I can finance my hobby...

    • @rafalmag
      @rafalmag 5 лет назад

      Here there are:
      Patreon Page: www.patreon.com/AndreasSpiess
      Alternative: flattr.com/@andreasspiess

  • @parasbhanot
    @parasbhanot 7 лет назад

    Please make video about HTTPS request with esp32

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      This is for sure something I am interested in

  • @MaxintRD
    @MaxintRD 7 лет назад

    Nice and concise! +1

  • @labkitadev
    @labkitadev 6 лет назад

    there is no pin 16 and 17 in lolin32 pro

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      So you can shift these pins also to different pins using the method shown in this video. Or use another board ;-)