Serial monitor gibberish

Serial monitor is outputting, but it’s all gibberish, nonsense characters. I’ve connected at a few speeds, and it’s not working. New nonsense is added after the delay.

I need serial monitor to work. The scripts are uploading to my WeMos- I can see the Wifi signal, but I can’t read the serial.

Haven’t tried outputting to OLED.

Can you show the contents of the platformio.ini file so we can see what board and framework you are using?

1 Like

[env:d1_mini]

platform = espressif8266

board = d1_mini

framework = arduino

; Custom Serial Monitor speed (baud rate)

monitor_speed = 9600

1 Like

Check that your Serial.begin value matches the one in your platformio.ini. If necessary, some boards need to be manually reseted right after upload is done.

1 Like

Thanks. I checked that. I have experience with Arduino IDE.

1 Like

We’d need to see your code then. Also a screenshot of the VSCode IDE where the garbage characters are printed at the start would help.

Are you also sure that it’s targetting the correct serial / COM port, if multiple ones exist in the system?

1 Like

Unfortunately, the inevitable PC issues have finally come. This is my first real day, two days with PlatformIO, and I like it. but I can’t figure out the libraries thing. So now I can’t get that far anymore.

Very irritating: Loop. Redefinition of loop. Loop appears one time. Why is it flagging loop?

It always works like this: I have a great day, then another, and then nothing works and i have no way of understanding why.

We also cannot have an understanding of why if we don’t see the code you’re running. Can you show it along with the full error message?

Please, one thing at a time, concentrate on one error without changing up the code and introducing a new one.

1 Like

Good morning. Thank you for being patient. I’m not used to being the patient.

Before I can get back to my serial monitor problem, I’m going to have to get past this one:

.

I’ve seen this before, and it seems to be independent of anything in the script.

1 Like
/*********
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/

#include <Wire.h>
 
void setup() {
  Wire.begin();
  Serial.begin(115200);
  Serial.println("\nI2C Scanner");
}
 
void loop() {
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address < 127; address++ ) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
      nDevices++;
    }
    else if (error==4) {
      Serial.print("Unknow error at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  }
  else {
    Serial.println("done\n");
  }
  delay(5000);          
}
1 Like

From the error you can see that your src/ folder has two CPP files: src/main.cpp and src/Access_Ping.cpp.

You should only have one CPP file in there. If both want to define functions like setup and loop, you get an error. Test only one sketch at a time.

1 Like

I’ve made zero edits. Sometimes the script you download doesn’t work, but it obviously worked for someone. There are too many realms of error. I’m standing at the center of the Venn diagram of the realms of error.

This is a new folder. Ping is not in it.

Try and execute the Clean project task in the PlatformIO sidebar then.

Can you provide a screenshot of the file structure of the project within VSCode?

Going to look for Clean, then get back to you with the outline

I found ‘Inspect’:
Errors

PIO Core Call Error: “Processing nanoatmega328new (platform: atmelavr; board: nanoatmega328new; framework: arduino)\r\n--------------------------------------------------------------------------------\r\n\n\n========================== [FAILED] Took 2.62 seconds ==========================”

I was uploading yesterday.

1 Like

I got it. Thank you for walking through the darkness with me.

2 Likes