Read remote txt then print with Thermal Printer

OK, then change the declaration:

uint8_t buffer[BUFFER_SIZE];

or change the write line to

Thermal.write((const uint8_t *)buffer, pos);

Both modifications should work. But you cannot remove the pos parameter!