Open lucasolives opened 11 months ago
Making some tests, we noticed that esp32 wasn't sending data to both port serials[Serial1(TX0, RX0) e Serial2(TX2, RX2)]. We tried some strategies to solve this problem:
Changing HardwareSerial.cpp as the following video suggested: https://www.youtube.com/watch?v=GwShqW39jlE
Use SoftwareSerial with esp32, but, aparently, it's impossible since esp32 no longer supports to this library.
Trying the Esp32SoftwareSerial. Unfortunately, it didn't work either, even though we moved UART1 to other recommended pins.
Making some research, we found out that esp32 has some gpio's not recommended for use in serial communications, as they're used for flash memory. Aparently, to use uart1, it's necessary the reassignment of pins: https://microcontrollerslab.com/esp32-uart-communication-pins-example/ Obs: It's weird, because our esp doesn't have GPIO9 and 10.
We found out a repository that modified the dynamixel2arduino library to improve serial communication with esp32 in order to make it easier using 2 serial ports, but also didnt't work: https://github.com/maehem/ESP32-Dynamixel/tree/master. click here to see the code
OBS: Everytime it didn't work, the data was being sent to just one serial port.
Pin out Esp32:
Utilizar preferencialmente as GPIOs: tx -> 0,2,12,13,14,15,16,17,25,26,27 rx -> 0,2,12,13,14,15,16,17,25,26,27,32,33,34,36,39
Using the circuit attached to this comment, we tried to use two serial ports in esp32 in order to put one leg on each serial port.