Code Keeps Uploading Text as ASCII Numerals

I'm currently creating an RFID-based attendance system for my school. I managed to get my machine to successfully read and upload data to a Google Sheet, but one last problem remains - it transmits textual data from each student's RFID chip as ASCII numerals, when I need it to be in a readable text format.

To demonstrate what I'm talking about, I've created a fake student's chip as a demo. The first name should be 'Jonathan', last is 'Joestar', ID is '111222333', Grade is '12', and homeroom is 'Zeppeli'. (Heh, Jojo reference.)

Any help would be greatly appreciated.

Here's a link to my code.

You are using Serial.write which would do as you explain, use Serial.print instead.

here is your code:

//PRINT FIRST NAME

for (uint8_t i = 0; i < 16; i++)
 {
   if (buffer1[i] != 32)
   {
     Serial.write(buffer1[i]);
   }
}


// If spaces must be ignored have your heard of 'for range'?
// it removes a lot of work for standard for loops and out of range errors.

char buffer1[18]; //  Use char not byte
// some code...
for (const char& val : buffer1) {
  if (val != ' ')
    Serial.print(val);
}

but you should be able to use byte as the for range is outputting chars, i tested it at work
but with C++, as closely as possible to C "no byte data type and used unit8_t instead.

typedef std::uint8_t byte;

int main()
{
    byte buffer1[18] = "test some code";
    for (const char& val : buffer1) {
      if (val != ' ') // ignore spaces
        std::cout << val;
    }
}

output:
testsomecode

Buffer has been declared as byte data type; print() method will not do the job; therefor, cast it to char to see the readable characters.

{
   Serial.write((char)buffer1[i]);
}
#include <ESP8266WiFi.h>        // Include the Wi-Fi library
#include <SPI.h>
#include <MFRC522.h>

//--------------------------------------------------------------------------------------------------------------

#define RST_PIN         D3           // Configurable, see typical pin layout above
#define SS_PIN          D8          // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance

const char* ssid     = "REDACTED";         // The SSID (name) of the Wi-Fi network you want to connect to
const char* password = "REDACTED";     // The password of the Wi-Fi network
const char WEBSITE[] = "api.pushingbox.com"; //pushingbox API server
char devid[] = "REDACTED"; //device ID from Pushingbox

//--------------------------------------------------------------------------------------------------------------

void setup() {
  Serial.begin(9600);         // Start the Serial communication to send messages to the computer
  SPI.begin();                                                  // Init SPI bus
  mfrc522.PCD_Init();                                           // Init MFRC522 card
  delay(10);
  Serial.println('\n');

  WiFi.begin(ssid, password);             // Connect to the network
  Serial.print("Connecting to ");
  Serial.print(ssid); Serial.println(" ...");

  int i = 0;
  while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
    delay(1000);
    Serial.print(++i); Serial.print(' ');
  }

  Serial.println('\n');
  Serial.println("Connection established!");
  Serial.print("IP address:\t");
  Serial.println(WiFi.localIP());         // Send the IP address of the ESP8266 to the computer
  delay(10);
  Serial.println('\n');
  Serial.println(F("Please scan a card."));    //shows in serial that it is ready to read
}

//--------------------------------------------------------------------------------------------------------------

void loop()
{

  // Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.
  MFRC522::MIFARE_Key key;
  for (byte i = 0; i < 6; i++) key.keyByte[i] = 0xFF;

  //some variables we need
  byte block;
  byte len;
  MFRC522::StatusCode status;

  //--------------------------------------------------------------------------------------------------------------

  // Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle.
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
    return;
  }

  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    return;
  }

  Serial.println(F("**Card Detected:**"));

  //--------------------------------------------------------------------------------------------------------------

  mfrc522.PICC_DumpDetailsToSerial(&(mfrc522.uid)); //dump some details about the card

  //mfrc522.PICC_DumpToSerial(&(mfrc522.uid));      //uncomment this to see all blocks in hex

  //--------------------------------------------------------------------------------------------------------------

  Serial.println(F("Name: "));

  byte buffer1[18];

  block = 4;
  len = 18;

  //-------------------------------------------------------------------------------------------------GET FIRST NAME

  status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 4, &key, &(mfrc522.uid)); //line 834 of MFRC522.cpp file
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Authentication failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  status = mfrc522.MIFARE_Read(block, buffer1, &len);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Reading failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  //PRINT FIRST NAME
  for (uint8_t i = 0; i < 16; i++)
  {
    if (buffer1[i] != 32)
    {
      Serial.write(buffer1[i]);
    }
  }

  //----------------------------------------------------------------------------------------------------GET LAST NAME

  byte buffer2[18];
  block = 1;

  status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 1, &key, &(mfrc522.uid)); //line 834
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Authentication failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  status = mfrc522.MIFARE_Read(block, buffer2, &len);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Reading failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  //PRINT LAST NAME
  for (uint8_t i = 0; i < 16; i++) {
    Serial.write(buffer2[i] );
  }
  Serial.println(" ");


  //-----------------------------------------------------------------------------------------------------------GET ID
  Serial.print(F("ID: "));
  byte buffer3[18];
  block = 6;

  status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 6, &key, &(mfrc522.uid)); //line 834
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Authentication failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  status = mfrc522.MIFARE_Read(block, buffer3, &len);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Reading failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  //PRINT ID
  for (uint8_t i = 0; i < 16; i++) {
    Serial.write(buffer3[i] );
  }
  Serial.println(" ");

  //--------------------------------------------------------------------------------------------------------GET GRADE
  Serial.print(F("Grade Level: "));
  byte buffer4[18];
  block = 8;

  status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 8, &key, &(mfrc522.uid)); //line 834
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Authentication failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  status = mfrc522.MIFARE_Read(block, buffer4, &len);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Reading failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  //PRINT GRADE
  for (uint8_t i = 0; i < 16; i++) {
    Serial.write(buffer4[i] );
  }
  Serial.println(" ");

  //-------------------------------------------------------------------------------------------------GET ROOM

  Serial.print(F("Homeroom: "));
  byte buffer5[18];
  block = 10;

  status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 10, &key, &(mfrc522.uid)); //line 834
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Authentication failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  status = mfrc522.MIFARE_Read(block, buffer5, &len);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("Reading failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  //PRINT MANAGER
  for (uint8_t i = 0; i < 16; i++) {
    Serial.write(buffer5[i] );
  }
  Serial.println(" ");
  Serial.println("Card read successfully. Uploading to Google Sheet...");

  //-------------------------------------------------------------------------------------------------

  WiFiClient client;

  //Send RFID card data to Pushingbox API, then Google Sheets
  if (client.connect(WEBSITE, 80))
  {
    client.print("GET /pushingbox?devid="); //Upload data to Google Sheet.
    client.print(devid);

    client.print("&LastName=");
    for (uint8_t i = 0; i < 16; i++)
    {
      client.print(buffer2[i] );
    }
    
    client.print("&FirstName=");
    for (uint8_t i = 0; i < 16; i++)
    {
      client.print(buffer1[i] );
    }

    client.print("&IdNumber=");
    for (uint8_t i = 0; i < 16; i++)
    {
      client.print(buffer3[i] );
    }

    client.print("&Grade=");
    for (uint8_t i = 0; i < 16; i++)
    {
      client.print(buffer4[i] );
    }

    client.print("&Manager=");
    for (uint8_t i = 0; i < 16; i++)
    {
      client.print(buffer5[i] );
    }


    Serial.println(F("\n**Card data successfully sent to Google Sheet.**\n"));

    //Necessary Info for Upload
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(WEBSITE);
    client.println("User-Agent: ESP8266/1.0");
    client.println("Connection: close");
    client.println();


    delay(1000); //change value if you want to read cards faster

    mfrc522.PICC_HaltA();
    mfrc522.PCD_StopCrypto1();

  }
}

To clarify, printing to the Serial comes out fine, as it's in readable text. It's with uploading to the Sheet, or client.print. I tried using ((char)buffer1 ); but it won't upload to the Sheet at all; I also tried using client.write, but it won't upload.

It's with uploading to the Sheet, or client.print. I tried using ((char)buffer1 ); but it won't upload to the Sheet at all; I also tried using client.write, but it won't upload.

//Send RFID card data to Pushingbox API, then Google Sheets

I think the issue is not with what is being sent, but how either Pushingbox or Google Sheets is interpreting it as either numerical bytes or characters.

All transmission or serial output is in the form of bytes.

I've checked my Pushingbox and Google Sheet GScript, and everything seems to be alright, with no lines that specifically state to only accept ASCII.