![]() I've had something weird going on, since I'm connecting VCC of RS232 on ESP32 3v3, and some chars are weird, then I took my Arduino Uno and connected 5v to VCC on RS232 and there wasn't any problem, but hey both approaches worked for now. What you type on Putty opened on that COM port, will be printed on the Serial monitor of the ESP and putty too, just to check. If I use Serial2, there's no need to #include anything or call a constructor as it is already defined on the ESP libraries or so I understood. ![]() I didn't need to necessarily change the name of the serial, so if I included HardwareSerial.h or called HardwareSerial Serial2(2) i.e., resulted in an error saying there were multiple calls to Serial2, since it is called in some library of the ESP. The final goal is to be able to type something on Serial2 so it's sent to the ESP32, and read it correctly.Īm I missing something? Should I not be crossing the TX/RX pins?Īfter changing some things, I realised that I didn't need to cross the TX/RX pins (against my own logic but w/e). With this code I can print on both serials just fine (sort of) but I can't seem to be able to read from Serial2: look and the output on 2nd attachment. ![]() I'm using HardwareSerial since I've seen everyone saying it's better that SoftwareSerial, and what I want to do is to read from the Serial2 (connected to the RS232) and print it on Serial (ESP32). You create a Serial communication between your board and your computer, and then you can visualize the messages using the serial monitor. Serial.println("Serial Rxd is on pin: " + String(RX)) In most of your ESP32 projects, you use the serial monitor to output debugging messages that help you better understand what’s happening with the microcontroller. Serial.println("Serial Txd is on pin: " + String(TX)) Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin) So I wired it to the ESP32 like the image attached, crossing the TX/RX pins. I'm currently trying to communicate my ESP32 DevKitV1 through serial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |