This is a weird one.
I am using USB serial emulation to debug some code. So the native, built in USB controller with no USB to serial chip. I can program the ESP no problem, and Serial.print as well as printf work perfectly.
I have tried using the Arduino serial console, Teraterm and Putty (the latter I can disable flow control). The relevant code fragment is
if( Serial.available() > 0 ) {
input = Serial.read();
I never get a NZ value for Serial.available. I have even tried the Arduino example to the same effect.
I downloaded and installed ESP-IDF, which I expect to install the USB driver, but device manager says it is using the Microsoft driver date 2006, version 10.0.22621.160. Updating the driver has no effect.
Any suggestions?
Thanks!
ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
Re: ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
I think I figured it out. Pretty hard to find with the googles but for the benefit of the next person look at this reddit reply
https://www.reddit.com/r/esp32/comments ... e/hzoq904/
In my case, I edited board.txt as found at \AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6 and changed the lines
esp32c3.serial.disableDTR=false
esp32c3.serial.disableRTS=false
to
esp32c3.serial.disableDTR=true
esp32c3.serial.disableRTS=true
https://www.reddit.com/r/esp32/comments ... e/hzoq904/
In my case, I edited board.txt as found at \AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6 and changed the lines
esp32c3.serial.disableDTR=false
esp32c3.serial.disableRTS=false
to
esp32c3.serial.disableDTR=true
esp32c3.serial.disableRTS=true
Re: ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
Uploading sketches and serial data worked so intermit and poorly for me that I ended up adding a CP2104 usb chip. After that it all worked perfectly. I was hoping after a few updates it would work better but nope.
Re: ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
I have mostly had to overcome "hurdles" like this one where things don't work, I solve the problem and then they work no problem since then.
I think part of the issue is that internal ESP internal USB challenges are not particularly well documented so you can hit a brick wall pretty easily. Even things like making sure the states of IO2, 8, and 9 (and 9 being used as a boot switch) at bootup should be in bold in the documentation.
So I have been able to program via internal USB without any issues once I figured those things out, and have only had issues with serial emulation with this issue. The issue baffles me because its an Arduino file (boards.txt) and I wasn't using the Arduino serial console.
I'm biased though: I think the Arduino software platform is an abomination but I'm using it so my friend can modify the code after I'm done.
I think part of the issue is that internal ESP internal USB challenges are not particularly well documented so you can hit a brick wall pretty easily. Even things like making sure the states of IO2, 8, and 9 (and 9 being used as a boot switch) at bootup should be in bold in the documentation.
So I have been able to program via internal USB without any issues once I figured those things out, and have only had issues with serial emulation with this issue. The issue baffles me because its an Arduino file (boards.txt) and I wasn't using the Arduino serial console.
I'm biased though: I think the Arduino software platform is an abomination but I'm using it so my friend can modify the code after I'm done.
Re: ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
it seems that esp32??? serial port is a complete flying rooster
i've spent days trying to get it working when i tripped over this thread
SO
i edited boards.txt
changed every occurance of .serial.disableDTR=false to true
and every occurance of .serial.disableRTS=false to true
closed arduino, re-opened arduino and uploaded the sketches again
now some serial monitors work and some dont, I am using ESP32 DEV units and ESP32S3 units
whether they work or not seems to be a complete lottery
either Arduino and or Espressif need to get their acts together we are buying your devices and using your firmware
AND NOW IT LOOKS AS THOUGH WE ARE TROUBLE SHOOTING FOR YOU AS WELL
where does your part come in ???????
and extreemly cheesed off Dave
i've spent days trying to get it working when i tripped over this thread
SO
i edited boards.txt
changed every occurance of .serial.disableDTR=false to true
and every occurance of .serial.disableRTS=false to true
closed arduino, re-opened arduino and uploaded the sketches again
now some serial monitors work and some dont, I am using ESP32 DEV units and ESP32S3 units
whether they work or not seems to be a complete lottery
either Arduino and or Espressif need to get their acts together we are buying your devices and using your firmware
AND NOW IT LOOKS AS THOUGH WE ARE TROUBLE SHOOTING FOR YOU AS WELL
where does your part come in ???????
and extreemly cheesed off Dave
Re: ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
FWIW, I stopped using Arduino and deleted all Arduino related stuff from my computer shortly after my last post. I also exclude the term Arduino from all Google searches. Everything I do now is c language and FreeRTOS only.
There is simply too much garbage floating around the Arduino world to waste any time on it.
There is simply too much garbage floating around the Arduino world to waste any time on it.
-
lbernstone
- Posts: 1131
- Joined: Mon Jul 22, 2019 3:20 pm
Re: ESP32-C3 Serial.available() doesn't work over native USB - print, printf works fine
being unable to give up on a problem i reported this issue at https://github.com/espressif/arduino-esp32/issues/11725
with guidance from Ibernstone, on my system I have proved that this is an Arduino 2.3.6 problem
first thing was to put boards.txt back to the original (changing boards.txt i felt was wrong, the developers know what they are doing)
running the code below on Arduino 1.8.19 works perfectly
running the same code on Arduino 2.3.6 does not work
i am about to report the issue to Arduino developers
Dave
with guidance from Ibernstone, on my system I have proved that this is an Arduino 2.3.6 problem
first thing was to put boards.txt back to the original (changing boards.txt i felt was wrong, the developers know what they are doing)
running the code below on Arduino 1.8.19 works perfectly
running the same code on Arduino 2.3.6 does not work
i am about to report the issue to Arduino developers
Code: Select all
void setup() {
Serial.begin(115200);
while(!Serial);
Serial.println("Serial started");
}
String kbdInput = "";
bool inptrdy = false;
void loop() {
//-------------------
if(Serial.available()) {
char c = Serial.read();
if(c != 13) {
kbdInput += c; // add c to string
}
else inptrdy = true;
Serial.print("serial ok c: ");
Serial.println(c);
Serial.println("kbdInput: " + kbdInput);
Serial.println("inputrdy: " + inptrdy);
}
if(inptrdy) {
Serial.println("inptrdy true kbdInput: " + kbdInput);
if(kbdInput == "c") {
Serial.println("Keyboard commands:");
}
else if(kbdInput == "tables") { // print tables
Serial.println("printTheTables()");
}
else if(kbdInput == "restart") { // restart node
Serial.println("Power On Reset this node");
}
kbdInput = "";
inptrdy = false;
}
}
Who is online
Users browsing this forum: ChatGPT-User and 4 guests