Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read USB serial input #32

Closed
2 tasks done
mgrouch opened this issue Dec 23, 2024 · 3 comments
Closed
2 tasks done

Can't read USB serial input #32

mgrouch opened this issue Dec 23, 2024 · 3 comments

Comments

@mgrouch
Copy link

mgrouch commented Dec 23, 2024

Describe the bug

Example of code with ESP32Console (https://github.com/jbtronics/ESP32Console)


#include <M5AtomS3.h>
#include <M5Unified.h>
#include <ESP32Console.h>
#include <FS.h>
#include <SPIFFS.h>
#include <ESP32Console/Helpers/PWDHelpers.h>

using namespace ESP32Console;

Console console;

void setup() {
  auto cfg = M5.config();
  AtomS3.begin(cfg);
  
  //Initalize SPIFFS and mount it on /spiffs
  //SPIFFS.begin(true, "/spiffs");

  //Modify prompt to show current file path (%pwd% get replaced by the filepath)
  //console.setPrompt("ESP32 %pwd%> ");
  console.setPrompt("m5> ");

  //Set HOME env for easier navigating (type cd to jump to home)
  setenv("HOME", "/spiffs", 1);
  //Set PWD to env
  //console_chdir("/spiffs");

  //Initialize Serial port on UART0 (the onboard USB Serial Converter)
  //Serial.begin(115200);

  //console.begin(115200, G2, G3, 0);
  console.begin(115200);
  //Serial.begin(115200);

  //Enable the saving of our command history to SPIFFS. You will be able to see it, when you type ls in your console.
  //console.enablePersistentHistory("/spiffs/.history.txt");

  console.registerSystemCommands();

  //Register the VFS specific commands
  //console.registerVFSCommands();

  //delay(2000);
  //Serial.flush();
}

void loop() {
  AtomS3.update();
  delay(100);
}

To reproduce

#include <M5AtomS3.h>
#include <M5Unified.h>
#include <ESP32Console.h>
#include <FS.h>
#include <SPIFFS.h>
#include <ESP32Console/Helpers/PWDHelpers.h>

using namespace ESP32Console;

Console console;

void setup() {
  auto cfg = M5.config();
  AtomS3.begin(cfg);
  
  //Initalize SPIFFS and mount it on /spiffs
  //SPIFFS.begin(true, "/spiffs");

  //Modify prompt to show current file path (%pwd% get replaced by the filepath)
  //console.setPrompt("ESP32 %pwd%> ");
  console.setPrompt("m5> ");

  //Set HOME env for easier navigating (type cd to jump to home)
  setenv("HOME", "/spiffs", 1);
  //Set PWD to env
  //console_chdir("/spiffs");

  //Initialize Serial port on UART0 (the onboard USB Serial Converter)
  //Serial.begin(115200);

  //console.begin(115200, G2, G3, 0);
  console.begin(115200);
  //Serial.begin(115200);

  //Enable the saving of our command history to SPIFFS. You will be able to see it, when you type ls in your console.
  //console.enablePersistentHistory("/spiffs/.history.txt");

  console.registerSystemCommands();

  //Register the VFS specific commands
  //console.registerVFSCommands();

  //delay(2000);
  //Serial.flush();
}

void loop() {
  AtomS3.update();
  delay(100);
}

Expected behavior

Should react to keyboard keys pressed in putty serial console connected to it at 115200 baud

Screenshots

No response

Environment

  • OS:
  • IDE &IDE Version:
  • Repository Version:

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details
@mgrouch
Copy link
Author

mgrouch commented Dec 23, 2024

@Tinyu-Zhao
Copy link
Collaborator

Your problem probably has nothing to do with this warehouse. I suggest you go to ESP32Console for help.

@Tinyu-Zhao
Copy link
Collaborator

Hope this helps you
jbtronics/ESP32Console#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants